Hardware-style synth channel routing and muting - success!

glennyg

2014-03-06 16:43:15

I wanted to recreate the common hardware feature found on multi-timbral keyboards where you can switch midi receive/local on and off for a sound, for instance to layer strings over a piano. The hardware waits for note off or velocity=0 before turning off midi receive so you don't get hung notes even if you turn the switch off while holding notes.

I'm new at this so it took a while and the first attempt worked but wasted polyphony. This one does everything I want.

Feel free to suggest refinements. I only defined a global value for switch=on for tracking purposes. It makes it easy to see if I get offsets wrong in the re-channelling versions of the translator.

UPDATE! This is several lines shorter and doesn't use any Labels. Also previous version allowed sustain pedal to cause hung notes.

Controller is transmitting on Ch1. Switches assigned to CC102, CC103, CC104 etc.

Check for CC message > check if matches the controller switch > set global variable value.
Check for sustain=off message, always send it.
If controller is sending note-on-velocity=0 instead of note off, make it a note off message (saves polyphony) and always send it.
Check for note off message > always send it.
If flag shows switch is off, don't transmit any other message types (i.e. transmits note off and sustain off messages only).
----------
Translator 1
(for control of Ch1)

Incoming Message: pp qq vv

Rules:
if pp==176 then oo=pp+qq
if oo==278 then oo=oo+vv
if oo==278 then ga=1
if oo==405 then ga=2
if oo==240 then oo=oo+vv
if oo==240 then exit rules, execute Outgoing Action
if pp==144 then ww=pp+vv
if ww==pp then pp=pp-16
if pp<144 then exit rules, execute Outgoing Action
if ga==1 then exit rules, skip Outgoing Action
exit rules, execute Outgoing Action

Outgoing Message: pp qq vv
-----------
Translator 2
(For control of Ch2. Note the offsets from Translator 1. Apply on duplicate Translators for up to 16 channels)

Incoming Message: pp qq vv

Rules:
pp=pp+1
if pp==177 then oo=pp+qq
if oo==280 then oo=oo+vv
if oo==280 then gb=1
if oo==407 then gb=2
if oo==241 then oo=oo+vv
if oo==241 then exit rules, execute Outgoing Action
if pp==145 then ww=pp+vv
if ww==pp then pp=pp-16
if pp<144 then exit rules, execute Outgoing Action
if gb==1 then exit rules, skip Outgoing Action
exit rules, execute Outgoing Action

Outgoing Message: pp qq vv
----------

glennyg

2014-03-07 15:32:23

This is now an updated version. More economical and solved an issue with sustain messages.

kurtr2

2014-04-07 18:14:03

Hi,
thanks for the help. question:
if all of these translators are in the same preset how do i switch between them to change midi channels?
right now i have each translator in its own preset and am switching between presets with my controller in order to switch midi channels.

thanks.
kurt

glennyg

2014-04-07 18:22:30

How are you switching between presets? My translators work by you sending CC102, 103 etc to switch the value of a global variable. In Translator 1 (turns midi channel 1 on/off) it is ga. In Translator 2 (turns midi channel 2 on/off ) it is gb. In Translator 3, as you now know, it is gc. You aren't switching presets. You are using the Translators to dictate what gets sent out of Bomes.

Start with an empty everything. Create a new preset. Inside that, create as many translators as you need (one per midi channel by using the offsets you got almost 100% right).