Sorry, just can't find the post: Alternating Output Channel

Looking for info on how to take a series of Incoming MIDI Events and alternate their output between 2 different MIDI Channels

I know either Steve posted the HowTo on this or it's on the Old Forum, but I can't find it and this is my next project.

Sorry. Guess i didn't bookmark it. If someone bookmarked it, could you post it for me. Many apologies. Ugh. Sorry.

Hi Jim,

There are several tutorials on how to dynamically change channels but nothing specific to your request so I went ahead and created a project. See attached.


The translator first looks for note-on or note off. If you AND 0xe0 with the incoming controll variable oo, it will be 80 for note-on or note off otherwise it is not a note message.

We then switch channels if it is a note-on. We don’t want to do that for note-off otherwise you will have a hung note. Note off can either be with incoming of 0x8n or 0x9n with value of 0 (where n is the MIDI channel number) so we set up rules to only modify the value of ga when it is a note-on message.

We then strip the message type from the channel and or it back with the new value of ga to get the complete command byte.


You could do this with two translators (one for note-on and one for note-off) but as you know, I like to create as few translators as possible in my projects.



Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist



I’m including method 2 (using note instead of raw), just in case you have a problem getting your head wrapped around the bitmapping of raw midi. Much easier to understand (even for me).



Thanks Steve!
I’d swear I saw it somewhere and I usually bookmark stuff that I figure I can use later, but couldn’t find it. ack

As you know: I’m not terribly bright – kind of an idiot.
Trying to figure my way through the script you wrote for me (Thank you!) but it doesn’t seem to work quite ‘right’. I think it points me in the right direction tho, thank you!

Okay, the couple of issues I ran into are:

  • Note Off isn’t always a Note On with Velocity 0 for all controllers
  • Situation where the second note is pressed before the first note is released doesn’t send the Note Off to the correct channel. (I think – it didn’t do it ‘right’, nevertheless)

So I kludged this together. It’s far from as elegant as yours, but I figure if I asked the question and came up with my solution, I should post. Chances are the person looking for that solution is me but 6 months from now. LOL

I’m in the dining room doing this theoretically with only an Input device and no Output device, so…YMMV. LOL


So, now I\'m going to put the bitwise stuff into that. nom nom nom
fun Fun Fun!


Oh, and thank you for the insight into bitmapping and logic functions with raw midi. I’ve been using a different convention mostly because I have one INIT Translator and set the MIDI Channels for devices (Incoming & Outgoing) there, so I just put in a value for which channel and the INIT routine comes up with GB for an Incoming Note On and GC for Note Off for the channel of interest.

I think this was the best way for me to address portability in that if I need to use a different controller I can just get into the INIT file and modify one variable

I’ll take a look.
Note off can be:

0x9n pp 00 – Where n= MIDI Channel and pp is note number
0x8n pp qq – Where pp is note number and qq is value (any value)
Some controller like the APC-MINI sent note-off as 0x80 pp 0x7f, which is like note-of full velocity. Unfortunately for updated MIDI LED’s it doesn’t respond. To turn an LED off it has to be 0x9n pp 00

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist

You don’t give yourself enough credit. I think you are very bright! You are a lot like me, a bit older so some times the gears get mixed up a bit. Sometimes, things flow like water, sometimes it is like squeezing out toothpaste or a dried super glue tube.


OK, my example assumed you only press and release 1 note at a time, before the next note. Yours seems to look at last note so that if 2 note-ons come before a note-off, you can go back and turn of the note on that is 1 back. Of course it probably will not work with 3 consecutive note-ons before a note off.

The case for handling multiple note on’s for switching channels and remembering them later for note off would be more complex. (and for another day).
However the logic would be to store all previous note-ons and channels and then when the note-off comes, go back and turn off the note and channel for the one that originally fired.
So note-on would always select new channel and note-off would always lookup to determine which channel originally fired the note and then turn it off on the proper channel.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist

Well, it depends on the destination.
My destinations are monophonic (Octatrack tracks), so sending a second Note On if a Track already has a Note On just replaces that note, and the Note On replaces the value in the holding variable.
I think.
I’ve been playing with it and haven’t experienced anything unexpected. I also set the Velocity to Volume and Filter Cutoff (So, louder & brighter when hit harder).
My application so far is just to play a monophonic melodic phrase but I don’t want the notes to cut off. I might up this to 3 Tracks and we’ll see! Also the situation of releasing notes & overlap is more about error correction. In a perfect world, we can always plan on pressing a new note AFTER the previous note is released, but I’m not really a keyboard player and I make lots of mistakes, so it’s basically error correction to deal with unexpected situations. heh
Then I got sidetracked and something else isn’t functioning as expected but that’s again an OT thing. LOL
Thanks again, Steve!
Hate to bug you, but I really thought I’d seen this situation either here or in the Old Forums but just couldn’t find it.