Envelopes to midi

Sundar here. Remember a year ago I had asked whether it was possible to pause and resume the playing.
I tried wrapping session with threads - no success.
So I switched to using pygame and sf2_loader to convert the scamp notes to midi note_on messages myself. Using sf2_loader I was able to pause/resume. However - I liked the envelopes I have used through scamp.
The scamp envelopes play nicely without any jumps at all and sound good.
I tried generating note_on for each of pitch/durn combinations - but it sounds jerky.
Is there a way I can know inner working of envelopes to be able to generate individidual note_on for every pitch/duration combination generated by Envelope?
also pygame supports saving midi as wav or mp3 in one call.