Poly~ stuck notes (again...sorry)

WillyC's icon

Hello, I try to avoid coming to the list with problems lightly, but I am at whits end with this one.

I am getting stuck notes in a poly~ based fmsynth (see attached zip file containing parent patch, voice patch and oscillator waveforms) DESPITE what is in my mind correct usage of the 'midinote' message.

If you play the synth notes will stick very occasionally.

Say the stuck note has a pitch of 65, sending "midinote 65 0" does not switch it off - further poly~ doesn't seem to forward this message to the appropriate voice. This (demonstrated in the patch) can be verified by identifying the 'busy' voice, then sending "target X" to poly~ followed by "65 0" to the 'midinote' inlet. This 'brute force' approach will turn off the note.

The attached patches are Max4 - I am trying to make a low cpu fm synth vsti. The 'stuck notes' occur noticably more frequently when using the synth as a pluggo plugin.

Can anyone spot why this is happening? As incentive, you get a free low cpu fm-synth (albeit a simple one) for your efforts!

Cheers and any help much appreciated.

WillyC's icon

After looking into this more I can conclude that I am using the 'midinote' message correctly, and that the poly~ object is forwarding note-offs to each voice as expected.

The reason voices are sticking is that the adsr~ object in the voice (from which all the subsequent msp/voice muting follows) is not ALWAYS zeroing its output when it receives a 0 (float) input.

This can be verified in the amended version of the patch (attached).

I have fixed this problem (see the voice~ fixed patch) by detecting zeroes input to adsr~ and resending them 10ms later (via pipe), i.e. making each note-off occur twice....

I cannot tell if the problem is fixed by 'resending', or by the fact that I am sending the note-off as an integer rather than a float to adsr~....

The stuck notes now go away when the synth is built as a pluggo so I am happy!

Wondering if this is a known/fixed bug (i.e. in Max 5)?

Cheers

Eric Sheffield's icon

Hello.
Just did a search for the exact same issue the OP was having, and was bummed to find none of the threads referring to the problem had any answers.
I am using the same band-aid remedy that he used by delaying the note off (0) inside the poly~.
Anyone else have a better solution?