Sending same CC to several MIDI channels simultaneously (MPE use)

Hi there, some MPE/multi-channel keyboards (Expressive E Osmose for example) work by sending each new note played to the next MIDI channel so that when you send an AfterTouch message, or CC, etc… after playing that latest note it is sent to that latest MIDI channel only, typically resulting in polyphonic aftertouch or polyphonic expression.
So if you want - for example - to move the general cutoff of the whole synth from the Electra, only the cutoff of the latest voice played via the latest MIDI channel will be changed, leaving all other voices at the previous cutoff position (hope I’m making myself understood).
To solve this unwanted result it would be great to be able to send a CC to different MIDI channels at the same time.
So would it be possible to allow the selection of several MIDI channels for 1 pot/CC ?

Easy to do with a small bit of LUA programming, but I’m guessing you want that option built into the web GUI.

Ideally yes. However since I guess Martin is busy with many other more urgent features at the moment, having it as a template in Lua in the meantime might allow me to reproduce it throughout my preset…

Take a look at the Config preset

There’s a control labeled Multi-Send. It is set up to send CC #17 to channels 1-8.
If you look at the control in the web GUI, you’ll see the function it calls is: sendMulti

If you open up the LUA code, around line 55 you’ll see how it is implemented.
The way the function is written, you can re-use it for many different CCs since the first thing it does is ask the control which CC number to use. So to send a different CC from that example, just change the parameter number in the Web GUI. For multiple controls, set each control to the parameter number you want to send and then put multiSend in the function name slot.

For now, it is only sending CCs. In theory you could make it more generic to send Notes, NRPNs, etc, but I’d probably just copy the function and create dedicated ones with different names for each type of control.

The other thing that is somewhat hardcoded is the range of MIDI channels to use. You could make those dynamic parameters that you configured in some setup screen or if you always know the range of channels, you can just set them up once in the code. A more flexible method (but harder to implement) would be to watch which channels are being used for incoming messages or for other outgoing messages and just use those channels, but that definitely requires more coding and more coordination between sending and receiving sections.

1 Like

Hey thanks ! It looks like it’s behaving just as I hoped it would. I’m only getting a few glitches that I’m trying to understand but that maybe due to my setup, as sometimes it suddenly sends CCs to only 1 MIDI channel, but I will look into this…
The next thing I tried to do is to copy that MULTI-SEND fader to a brand new preset and it looks like the “multiSend” LUA script you wrote is not following although the FUNCTION field has the word “multiSend” in it. Is there a simple way to copy it along with the whole fader ?

In my experiences you have to separately copy the LUA script to the new preset.

My typical approach is to keep the entire LUA script in a text file in the same folder as my presets so that when I need to re-use something, I just copy and paste from the text file.

With the web GUI open and you are editing the LUA code, a simple ctl-a, ctl-c, then ctl-v (or command a,c,v on the Mac) to select it all, copy it, then paste it into the text file.

Worked well, thanks again !