Dynamically change the MIDI channel

florian

2015-11-22 21:30:38

A user of MIDI Translator asked the following question:
I have the Livid Instruments DS1 controller. I would like to set up a button to change the MIDI channel of the DS1.

florian

2015-11-22 21:51:09

In order to use MT for this, you can use the standard "pass through" set up with MIDI Translator Pro (MT): your control surface (e.g. DS1) is connected to MT, and MT passes on the MIDI data to your DAW or other music performance software.

The user's manual has a tutorial on that, but in a nutshell it's this:
  1. in MT's virtual MIDI settings, make sure that you have at least 1 virtual MIDI port
  2. in MT, create a preset (e.g. named "From Controller"). In the Preset Properties, check your controller in the MIDI IN list, and the "MIDI Translator Virtual 1" in the MIDI OUT list
  3. in MT, in the Project Properties, go to the Routes section, and draw a line (route) from your controller to "MT Virtual 1", and from "MT Virtual 1" to the controller.
    your controller's MIDI OUT section.
  4. in your DAW's MIDI settings, disable your controller for both MIDI IN and MIDI OUT, and use MT Virtual 1 instead (for both).
By now, your controller should work just as if directly connected to the DAW. But all MIDI data is going through MT, and the Event Monitor's LED's should light up when using the controller.

Now you can use translators to modify it.

1) modify the MIDI channel
We use the global variable "gc" for the MIDI channel. By default, all global variables are initialized with 0, corresponding to MIDI channel 1.

Code: Select all

Translator 0: patch Note On messages
Incoming:
  Note On on any channel, set 'qq' to note and 'vv' to velocity
  Options: [x] swallow MIDI message
Outgoing:
  Note On on channel 'gc' with note:qq and velocity:vv

Translator 1: patch Note Off messages
Incoming:
  Note Off on any channel, set 'qq' to note and 'vv' to velocity
  Options: [x] swallow MIDI message
Outgoing:
  Note Off on channel 'gc' with note:qq and velocity:vv

Translator 2: patch Control Change messages
Incoming:
  Control Change on any channel, set 'qq' to CC# and 'vv' to value
  Options: [x] swallow MIDI message
Outgoing:
  Control Change on channel 'gc' with CC#:qq and value:vv
Now these 3 translators above will react on Note On, Note Off, and Control Change messages, respectively, and send out the same message -- except that the MIDI channel is set to the value of variable gc. Make sure that for all the Translators above, the "Swallow MIDI message..." is checked! Otherwise, the DAW will receive on the original channel, and on the modified channel!

2) Set up Translators to modify gc
Create a 4th Translator, select MIDI as Incoming action and use MIDI Capture for the button you want to use to change the value. In the following example, we assume you have captured a Note On message on note 10. Make sure to change the channel and velocity to "any".

Code: Select all

Translator 3: Set specific channel
Incoming:
  Control Change on any channel, on note 10, and with any velocity
Rules:
  gc=gc+1
  if gc>15 then gc=0
Outgoing:
  None
Now as the informed reader might have guessed, the Rules section will increase the channel by one. Because there are only 16 channels available (gc=0 to gc=15), we do the IF statement to wrap back to 0 if we exceed 15.

It should be easy for you to set up another translator for decreasing the MIDI channel. Or, even easier, to set the MIDI channel to a specific value ("gc=9" --> MIDI Channel 10).

Hope this helps!
Florian

i@mJONNY

2016-01-25 17:19:01

Hi Florian, just registered & hoped to find this thread - a quick perusal of your posts, and I spotted the titled :D

I'll be using BMT in conjunction with GlovePie (I assume I need to use this to distinguish between input from keyboard/mouse/wii1,2... unique device ID's) and maybe AHK (tempted to fiddle with context-dependent mappings, so I can re-use CC's or SCANCODES etc, and the action performed will vary based on activeWindowTitle or element under mouse pointer.. but that's level 3 stuff)

Browsing the Bome manual last night, it looks like some of this may be possible with rules..

My first use-case is mapping my DJ2GO to channel 2, reading this ^ it outlines the controller > translator routing.

Is left input & right output?
Is this correct?
Image

Or this?!
Image

Thanks!

florian

2016-01-28 12:29:26

Hi, you can use either Router setup. The first will use the actual name of the port, while the second uses the "auto alias" of the first virtual port. MT creates an "auto alias" for every virtual port. The auto alias name is always the same, no matter if the project is used on Windows, Mac, iOS (to come), BomeBox (ditto), etc. So, in general, we recommend to use the auto alias.

You can find more about MIDI port aliases in the user manual, and here in the forum.

Regards,
Florian

Jagian

2016-02-07 06:03:11

Hi all:

Is fascinating read how with version 1.8 could do this things, i mean you can separate in a translator the type of MIDI message (note on,off, CC, etc), from the MIDI channel, the note itself, CC number, velocity, etc. This things can't be made in version 1.72, because of the use of hex codes i thing. So i'm wondering (im not sure) if some translators post here can be "adapted" in previous versions?
I mean specifically the way to change CC MIDI channel (Translator 2: patch Control Change messages)....is there a way to implement this or do something similar with the same result?:
Incoming:
Control Change on any channel, set 'qq' to CC# and 'vv' to value
Options: [x] swallow MIDI message
Outgoing:
Control Change on channel 'gc' with CC#:qq and value:vv
...in version 1.72?

Thanks in advanced!

DvlsAdvct

2016-02-08 20:10:20

Hi jagian

It can definitely be done. You would just need to reference local variables. So it would be something like

Code: Select all

Incoming: pp qq rr
Rules: if pp<0xB0 then exit rules, skip outgoing action
if pp>0xBF then exit rules, skip outgoing action
Outgoing: gc qq rr
And you'd need to set gc correctly in a different translator, obviously. Does that make sense?

Jared

Jagian

2016-02-09 15:21:08

Hi DvlsAdvct:

Thanks for the hints, finally i could made it. I taked your translator and add the "gc" translators for change CC MIDI channel up/down. In my case i've used 2 buttons that that send PC (program changes) to change MIDI channel, but it could used note ON, or CC as well:

Here is the 3 translators:
Translator 0: reference local variables (as you suggested)
Options: stop=false
Incoming: MIDI pp qq rr
Rules:
if pp<176 then exit rules, skip Outgoing Action
if pp>191 then exit rules, skip Outgoing Action
Outgoing: MIDI gc qq rr

Translator 1: CC MIDI channel UP
Options: stop=false
Incoming: MIDI C0 02
Rules:
gc=gc+1
if gc>191 then gc=191
Outgoing: (none)

Translator 2: CC MIDI channel DOWN
Options: stop=false
Incoming: MIDI C0 01
Rules:
gc=gc-1
if gc<176 then gc=176
Outgoing: (none)

Well this are very nice translators!...Thanks a lot again, and have a nice day!

florian

2016-02-25 00:31:13

Hi Jagian,
just out of curiosity: why aren't you switching to version 1.8? It's a free update.
Regards,
Florian

Flamusic

2016-08-02 09:50:03

I also tried this setup.
If i switch between the channel i can see in MT how the channels go up.
But in ableton alway the same channel is recieved.
Any Ideas ?

florian

2016-08-07 23:32:34

make sure that
- Ableton's MIDI IN ports do not include your MIDI controller (only MT virtual port)
- all your incoming actions have "swallow" checked. Otherwise, the message is passed through to Ableton on the modified channel AND on the original channel.

Florian