multi channel midi out of sync and sticks

robotscantdie's icon

Hi guys - Im running some code in python to send sequencer notes on two different channels (bass / lead) (1 & 2 respectively).
When if I only send 1 channel of midi they each go to their respective routes and sound fine. When I send them both, the audio sounds weird, is out of sync, and notes stick and drone out. Any suggestions?

I ultimately want to build a sequencer in python and route all the different channels to max 8 and use various plugins to play sounds based on selections from the app.

catch-midi-channels.maxpat
Max Patch

Source Audio's icon

that midi routing is bad.
Use single midiin and route channels using midiparse, midiselect or other options
but that gate is a bad idea

robotscantdie's icon

Thanks, I havent been able to get it to work using midiselect - the channel specific output there based on my argument only seems to be sending the channel number out, not the actual midi data.

Source Audio's icon

If you use rightmost outlet of midiparse it carries the channel number
in form of midi status byte, but the problem is that VST objects that
receive it probably expect midi channel 1 as input.
So you have to:
1- split incoming channels

2- remap channels to midi channel 1 into VST objects.
means byte for midi note On , Off, CC, PB PG etc, a lot of work.
Only in case your VST plugs accept any midi chanel as input,
you could split channels like that.

That patch from the other thread you started dealing with same problem
won't get you far as is.
https://cycling74.com/forums/splitting-midi-messages-by-channel

Even that timing in max should guarantee right to left order of execution,
with moderate midi input that zl reg / trigger combo would fail,
becaues midi channel might get out faster than the midievent list.

Depending on number of midi channels at input,
which midi messages needed, one could decide for midiselect,
midiformat, or dedicated midi objects like notein etc with channel argument
and prepend midievent for vst as one had to do in old days.
-------

try this

Max Patch
Copy patch and select New From Clipboard in Max.


Roman Thilenius's icon

or...
- write data from midiparse in list
reverse list
route 1 2 3 3 4 5 6 7 8
reverse lists
vst vst vst