Per-note dynamic rechannelizing using two keyboards

As 2024 winds down, Happy New Year to the Midihub community!
Here’s the scenario: I want to play keyboard A on midi channel 1, but during the performance, I want “active” or “held” notes on keyboard B to select any corresponding “note on” events within the keyboard A performance to be rechannelized to midi channel 2, and only those notes, while all other “note on” events in the keyboard A performance will remain on channel 1.
This way, chords held on keyboard B (but not heard), could then cause corresponding notes from the keyboard A performance to be redirected into radically different timbres. This would open up some exciting and unpredictable interactive musical possibilities.
I wonder if this kind of behavior could be programed into Midihub?

Referring to any given note number x, the desired rule set would be:
(1) On keyboard B, if x is currently being held ----then—> when x is played on keyboard A, assign the keyboard A “note on” event with its velocity unchanged to midi channel 2 for output.
(2) All notes only played on keyboard A remain unchanged (i.e., these notes are output, velocity unchanged, on midi channel 1).
(3) Always send all “note off” events from the keyboard A performance to both midi channel 1 and midi channel 2, so there can never be a stuck note.
(4) All pitch bend and mod wheel midi CC events are always transmitted on both midi channel 1 and to midi channel 2.

Finally, for clarification, “note on” and “note off” events from the keyboard B “performance” would never be sent to any output, since the only purpose of notes held in the keyboard B “performance” would be to selectively rechannelize the keyboard A performance.
If anyone can see a way to achieve this behavior with Midihub, I would be eternally grateful!
For creating the program, assume that keyboard A is connected to DIN midi in A, and keyboard B is connected to DIN midi in B, and that both keyboards are transmitting on channel 1. Lastly, it would be desirable for the resultant output to be assigned to the USB output port in order to play softsynths.
Thank you for any and all help in solving this puzzle!

Hey @MIDIman, how much help do you want on this:

…pointers on developing a solution

…or an actual preset/patch which does the job?

(From your precise –and pretty exhaustive :asterisk: – details of the design it looks like you’ve already anticipated the possible Note Off pitfalls/complications, etc)


If it’s the former, I think I would

  • start with a MIDI BDispatcher → … → Virtual H pipeline.

  • This line would use Transforms to set single-note ranges for a bunch of “Note Selection” Transforms in some MIDI A IN pipeline(s) elsewhere in the patch.

  • It would also create two (Ch1&2) Note Offs to be sent to USB A OUT

  • Thus, this type of solution would make extensive use of Virtual Mappings.
    (It could also take advantage of Transform’s new ability to set a CC# from Dispatcher’s output channel#, using just one Transform to create a distinct CC for each chord note)


:asterisk: a couple of extra constraints would be useful to know:

  • is there a maximum number of held “B-keys”?
  • is there an end of the keyboard that remains unused?
    (being able to use note #0 or #127, for example, would help tell the “Note Selection” Transforms to “do nothing” when all “B-keys” are up)

Realised this was unnecessary, so here’s my first (untested) sketch…

…I’ll test and document it later!
(Await discovery of errors…)
EDIT: mappings corrected file; changed:
MIDIman Two Keyboard Re-channelling.mhp (581 Bytes)

Hey resonotter, thanks so much for all your amazing help with this!
You have my eternal gratitude. I truly appreciate your knowledge for solving this problem. You’re super awesome!
I will be able to start testing this over the next week and I will post back.
All the best to you in 2025!

Hey @MIDIman, no worries

I’ve just been playing with it and agree with…

…I’ve just been testing with a GM piano on Ch1 & cheesy Tremolo Strings on ch2 (with an UpDown arp just for visual clarity ) and it still sounds interesting!

Nice idea.
I’ll post it up on PatchStorage later as good VM example.
(Watch this space)

MIDIman Two Keyboard Re-channelling

This preset uses the notes held on one (silent) input and uses them to change the channel of the same note numbers when they are played on the main input:

Here are the notes for the PatchStorage entry

The PatchStorage file is actually two presets (the second is disabled).
Read below and choose which is best for you.

Each uses a Dispatcher to create mappings for the Transforms in the next line.

These mappings are CC#0 on Ch1, 2, 3 … respectively, So

  • the 1st note sets the Note Range for Transform1

  • the 2nd note sets the Note Range for Transform2

  • etc

When a note played on the main input matches one of these Transforms it is replaced by a Note On on Ch2

Only five notes have been set as Transforms and in Dispatcher just to show the idea. Up to 16 notes are available :asterisk:

Each Note Off sets the Transform to Note#0 (ie. " do nothing" as this Note#0 is filtered out)

Pipeline 3 ensures each Note Off from MIDI B is sent to both channels to prevent hanging notes.

Versions

in both versions, a few extra pipes have been added to make them easier to rewrite for a different two channels (see pic below):



The second approach uses Transform’s new ability to set the CC# number to the Channel#:

This is version I would choose as I might be using Virtual H elsewhere as part of a more complex patch. (I find keeping mappings in a bunch on one channel helps me not trip up later down the line)


:asterisk: It would be possible to have more, actually!

PS. I tested with the most boring input possible to make the graphics easy to follow. Would be interesting to hear sounds from more creative input from @MIDIman or anyone else…

1 Like

Hi resonotter,
Awesome work! You’ve really developed the concept a lot. I look forward to diving in, but it’s getting late for me to do so tonight.
However, I have one observation. In your latest post you wrote:

This didn’t make sense to me, because the keyboard B player is not the player who is in command of timing. The keyboard B player is the “throw the mix for a loop” player who might just be randomly mashing on the keys.
So, in how I envision this working, the note off commands from the keyboard B “performance” should never be allowed to affect the length of notes in the output. The note off commands from keyboard B should only serve to cancel the duration of silent notes held which define rechannelization of the keyboard A performance.
To reflect this desired usage, for my testing I will change the third pipeline to begin with input A instead. That way, note off commands from midi A will be sent to both channels to prevent hanging notes.

Yes, @MIDIman, very good points and I can appreciate the performance differences.

it’s very early where I am, so I’ll just make the remark that my design decision is based on the priority of never having hanging notes.

I have a hunch that ensuring this, while insisting on player A being the sole Note Off controller, will complicate things considerably…

(Hoping I’m wrong on this ) :asterisk:

…but I’ll take a proper look when I’m properly up and awake! :sleeping: :smiley:


player who might just be randomly mashing on the keys

So, you’ve seen me play?!



:asterisk: EDIT: having thought on it for a few mins, I think I am wrong:
Good, I’ll check it out in a few hours!