polyphony in max for live - release problem

louis's icon

Hello!

I build a little synth in MaxForLive, and I would like it polyphonic (great, isn't it?...)
But I have a problem about adsr and polyphony.

It's about the release :
When a note on (note B) is triggered before the end of the release period of the previous note (note A),
there is a variation in the level of the signal.
Ok, it's normal : release of note A + beginning of note B = it's louder when the note B is triggered
And theoretically, if I play this two notes (same velocity - same frequency) in a regular interval (a loop),
the variation of the signal should be the same each time a note is triggered.

The problem is this signal variation is irregular :
for example, I play a note (note X - no variation in frequency and velocity) in a regular interval (loop),
using live sequencer, and then I increase the release time,
(the note is triggered before the end of the release of the previous note),
it appears an irregular signal variation at the beginning of each note.

Sometime notes sound louder, sometime weaker, in an irregular period time :

X - X - X - X - X(+!) - X - X - X(-!) - X(+!) - X - X - (X-!) - X - X - X - X(+!) - (X-!) - etc...

I assume it comes from the way I build polyphony in my patch,
but I watched and read several tutorials about polyphony in Max, and I don't understand where I'm wrong.

I precise this level variation is between 1 and 2 dB (!), and increase with a high release period.

In attachment, you could find the patch I build.
If you could take a look and give me some tricks or ideas, it would be very helpful!
Thank you.

Louis

test_release.zip
zip
louis's icon

nobody?

I will loose my hair!

louis's icon

I precise : the cycle object is controlled by a phasor object, wich set the phase of the signal to 0 each time a note on message is triggered,
so the problem don't come the phase.

I observed the same problem in the tutorial patch "M4L.fm.08.Polyphony.amxd".

And also in the plugin FM8, by Native Instrument. But in this plugin, there is a button "key sync" wich fix the problem, by initialising the phase at the begging of each note.
But I already do that in my maxpatch, using the phasor object, and no results...

An idea?

broc's icon

I suppose your problem is due to the fact that Max processes audio in blocks (vectors) of samples. Since M4L uses a vector size of 64 samples it may lead to timing irregularities up to 64/44.1, ie. about 1.5ms.

louis's icon

Thank you for the answer.

So, if I understand correctly, there is no way to fix the problem !?...
Just don't play with long release times?
A bit disappointed...

Ernest's icon

Maybe a gen~based envelope can help. I haven't split it out, but you can pull it out of this: