Many thanks to you guys for your suggestions. To clarify, what i'm trying to do is in fact just to smooth out my uneven playing after the fact (not to adjust generated tracks to match my playing).
I'll try and work with the quantizing function as you have recommended.
Best wishes to all!