Polyphonic microtonal midi pitch-remapper (by pitchband)
Hello!
I attempt to make in MAX7 midi-utility for play microtonal music on any midi instrument with pitchband = 2.
So, this utility has midi in and midi out. Between this ports I want to remap incoming notes to frequences from list. Then utility will convert frequences to midi (ftom) with pitchband messages. My general question is about polyphonic - as I understand, I need to route each incoming note on own midi channel for make a pitchband messages be polyphonic. But there is not easy way to handle multyple note-on and note-off messages on different channels without mistakes.. As I understood, makenote function no good for this purpose, because I just need to transmit incoming notes to out with other pitches, but makenote fuction need to enter note duration value for generate note.
Is there any patches or help-functions for this purpose?
In Plogue Bidule (in many cases i make midi patches in this soft) there is automatic function for this - I am select my mono-patch and click on "polyphonize" function in pop-up menu. Is there any same in MAX?
Best regards,
Vadim
You could use midiout object.
Midi note on channel 1 starts with 144, followed by note number and velocity,
145 for midi channel 2 and so on.
like Note On 144 48 100, note off 144 48 0.
Note Off can also be sent or received starting with 128 for midi ch 1, which is implementation with release velocity.
Pitch bend starts with 224 for midi channel 1.
So at the end You would send Pitch Bend followed by Note On in one message,
224 10, 144 48 100 or if You need 14 bit P.Bend send 224 LSB MSB.
This of course has its problems, because each midi channel has to be monophon,
new midi note must first turn any sounding note off.
So maybe send first all notes off (176 123 0), pitch bend, new note on ?
How do You want to deal with 16 channel polyphony limit ?
Which notes would end on which channel ?
for now I use 7bit P.Bend (no all instruments able to recieve 14 bit)
About which notes would end on which channel - as I understand, right way is store info (note channel) for each played note to buffer, and when note-off for this note recieved from input keyboard, send note-off message to stored channel, yes?
For now, my monophonic scratch seems like that:
It is not as simple as You think.
You are probably receiving notes on same midi channel, but have to send every new note
to different midi out channel, bundled with Pitch Bend info, and have to wait for Note Off of the same midi note
and resend it to same midi out channel.
Means that midi out channel is occupied untill Note Off gets received.
So how do You want to link a specific midi note to specific midi channel,
and how do You plan to keep track if that midi channel is waiting for midi Note Off state,
or free to accept new midi note ?
yes, I am not think that this a simple task.. - so it is a cause, why I post my question here - may be there is already complete solution of the polyphonic problem - solution, implemented within Max? As I see in this forum, I am not first, who search the way to make polyphonic pitch band possible..
To make it easier for You - there is object named Lpoly in Lobjects externals by Peter Elsea.
It would be very helpfull for stuff You are trying to do.
At least to see how it can be done.
On can set a number of polyphony - in Your case 16 ( max midi channels)
and it will prepend voice number for each midi note, and free that voice after note off gets received.
That could be used to route pitch bend as well.
Just have a look in help file and use second argument 1, like [ Lpoly 16 1}
That would give You voice numbers 1 - 16.
Lobjects are only 32 bit, I think, so Yo have to run 32 bit max to use it.
thank you for suggest!
that is a new link for downloads, even a Mac 64 bit beta.
If you don't need high pitch resolution (with 7-bit 2 semitones default you won't go too far) just detune each channel with constant pitch bend value to cover 16 (or 15 for GM instruments, like those soundfont players provided by OSes) steps in one semitone, and then dispatch notes to proper channels.
thank you, AK! I will test this patch too