how to reset history on note event - FM FB SYNTH

gianmaria allibrante's icon

hello, can you help me to archive history reset inside a fm feedback algorithm?
imu nable to get exactly the same sound each iteration, i think that it is because history stores values from the prevoius note modulation so this is used also for the new one.
what i think i need, in order to give same environment to each note, is reset history when a note event incoming, so the first sample of the feedback will be every time 0.

i attach the patch, it inside gen, is a kind of drum synth, for this project i tried to develo visualli as i can, thanks for sopport

Max Patch
Copy patch and select New From Clipboard in Max.

also ever all considerations are aprecieted

gian