Note, Target, Midinote note off messages to poly~?

J Mangel's icon

AdditiveSynthMain2.maxpat
Max Patch

AdditiveSynthVoice.maxpat
Max Patch

I have tried all three and I cannot get note offs triggered through poly steal or physical keyboard note off 0 velocity messages to target the correct poly~ voice. Ideas?

here is the main patch and sub for poly~.

Source Audio's icon

use either poly or poly~, not both

Jean-Francois Charles's icon

Have a look at MSP Polyphony Tutorial 1: using the poly~ object.
Look at the two following subpatches:
- simple_poly
- poly_using_mute
The most important thing is how [poly~] deals with the "note" message.
Other subpatches in the same tutorial show a combination of [poly] and [poly~], but this is really not idiomatic, no need to spend time on that.

J Mangel's icon

Thank y'all. I thought I had tried a strictly target based triggering system but I must have done it wrong. Using the method in poly tutorial 1 works perfectly. Now on to sending envelope values.

Jean-Francois Charles's icon

Then have a look at the adsr~ help file, especially the poly~ tab.
My piece of advice with poly~ is to try to use the power of the note message, understand busy, mute, thispoly~, and avoid using the target message when you get started. One of the most powerful objects in Max, so it's worth spending time with it!

J Mangel's icon

That makes sense but then i run back into the trouble of sending a 0 to its targeted note right? I've been looking at the ads help file, but perhaps I'm not grasping what you mean. Ill continue to work from the help file. Thanks

Jean-Francois Charles's icon

I really mean to say that when you use the [note] or [midinote] messages, [poly~] deals with voice allocation: [poly~] checks which notes are currently busy, and gives the [note] message to a voice that is not busy.
The voice itself, using [thispoly~] marks itself busy (and optionally unmutes itself). When you're done playing the voice itself marks itself not-busy, and optionally mutes itself.
So, in most cases, you don't need to use the target message.
In the [adsr~] help file, poly~ tab, there is only an initialization 'target 0' message, to make sure that the envelope ADSR values are forwarded to all voices.
By the way, the two important messages to [poly~] are note and midinote. Check out the Reference to understand the difference. Basically, 'note' is good when you want to play notes which duration is fixed or determined by some process; 'midinote' is good when you want to turn off a note from outside the poly~ (usual if you play notes on a keyboard and want to turn the note off when you release the key).
It's a little confusing, because the tutorial I mentioned does not use midinote. That's where the [adsr~] help file is a good example to get started with a "standard" synth.

J Mangel's icon

Yes! That what I wanted to know. The problem is that I haven't found any good info addressing 0 velocity note offs triggered by keyboard. So Ill be looking into the adsr~ help file and midi note. Good info Jean-francois.

My idea here overall is to use a sequencer I'm working on based around the m4l sequencer object that allows for quick editing and sequencing of parts, which runs through ableton to record midi, and routes back to an additive synth I'm working on, or into vcv rack, finally recording the live result. My main goal is to write species counterpoint with room for timbral modulation and automation for each voice.

Roman Thilenius's icon


when you only want to send in note on and note off, this is done better automatically, if you plan to send in arbitrary data in a non-midi way, it is better to use target messages and do the voicing allocation outside with custom patching.

so you are good adviced to experiment a while with both worlds and not combine them until you are good in both. :)

J Mangel's icon

Using the tutorials suggested and help files on adsr and poly~ I have not found a better way to allocate voices and envelope parameters than this. I just cannot get the note message to send offs to the voice i need. poly cycles forward to the next voice every time it receives a note off. Maybe I'm missing something but this method seems to work well except for the clicking I get when voice steal kicks in. I tried putting a 10-20ms delay on the note off to Mute 1, 0 message but the clicking remains. Any help here would be much appreciated.

AdditiveSynthMain2b.maxpat
Max Patch

AdditiveSynthVoice.maxpat
Max Patch

Source Audio's icon

Clicking problem is caused by turning voice off using bang and delay.
It should be done same as what adsr does - mute voice when control signal is at zero.
insert edge~ at output of curve~ and use bang on non zero to zero transistion
to mute the voice.
Should a voice be retriggered if it gets new note before it got released ?
retrigger means turn off using short fade, than start the adsr again.
If not, that would cause next click, when cycle changes the frequency.