poly~ midinote message ?

vichug's icon

Hey,

Has anyone success with using midinote message in a poly~ ? i can't seme to make it happen. The documentation is not very clear, there is no example for mdiinote, just for note. I tried: (midinote 0 $1 1) into poly~ to send a $1 1 message inside one instance, followed by (midinote 0 $1 0) to stop it (where $1 is to be replaced) ; i tried (midinote $1 1) and (midinote $1 0) but no instance receives any message. What happens ?

vichug's icon

in the meantime i use [poly] object to manage polyphony and send to a different [poly~] voice

Norman Freund's icon

Confirm, 6 years later, the midinote method in poly~ does not do what the manual says, in the process of voice allocation it completely ignores the velocity=0 event. Agree the poly object is the only work around I found. Hey Max developers, you need to update the manual to reflect what the software actually does.

Jean-Francois Charles's icon

Norman, I've been using the midinote feature successfully for years. Would you have a simple example showing what doesn't work?

Norman Freund's icon

Jean-Francois Charles,
I have revisited using the midinote messages sent to poly~, now working as it should. In my humble opinion, it's one of those strange beasts, that needs a good example to explain how it is intended to work. I came across a very dated YouTube video from Cycling'74 explaining how it this:

"Cycling74 Max/MSP/Jitter Tutorials: Polyphonic Synth", Cycling'74, 11-Jan-2011, Link: https://youtu.be/y0mcWhrFrEY

I could repeat the above in my own code, enhanced and added liberal comment codes as part of my knowledge base, ready for the next time I need to use it, see below:

Top level M4L patch -- basic polyphonic synthesiser responding to midi note on.

The patch loaded by the poly~ object which processes the midinote messages sent to the first inlet of the poly~ object.

_NOF_LearnPolyphonicADSR02.amxd
amxd 32.76 KB
Top level M4L patch (Live rel 11, Max 8.5.3)

_NOF_LearnPolyphonicADSR_synth01.maxpat
Max Patch
Basic synth patch loaded by the poly~ object (Max 8.5.3)


There is this dance happening between the instances that poly~ creates for each voice and the thispoly~ object for voice allocation and digital signal processing (dsp) muting. When coding by just reading the reference manual, that path is difficult to find, but the above worked example makes it clear. I get the impression that the above YT example from Cycling'74 represents the best practice to make this happen. Please correct me if I am wrong.

See next message for updated code.

Norman Freund's icon

Update on my previous message. Using signal cords to the adsr~ object inside the code that the poly~ object loads gives trouble, so I replaced it with message cords. Also added a gen object for the midi pitch to frequency calculations which in turn uses a codebox for the final calculation, a simple enough example but will pay off for more advanced frequency calculations.

The updated coding:

_NOF_LearnPolyphonicADSR02-3.amxd
amxd 40.33 KB
Top level patch for Max for Live device, basic polyphonic synthesiser explaining how to allocate voices using poly~ and midinote messages

_NOF_LearnPolyphonicADSR_synth01-3.maxpat
Max Patch
patch that poly~ loads that acts as the synthesiser

_NOF_LearnPolyphonicADSR_synthGen01-3.gendsp
gendsp 2.21 KB
gen code using codebox for the midi pitch ID to frequency calculations.

All full of comments to explain how it works and the pitfalls of what not to do. There are some extra outputs, boxes in blue that are not necessary for the calculations but serve as a teaching aid, explaining how it work and what comes out of the important Max objects.