Keyboard split?

florian

2008-09-23 20:50:59

a user of MT asks the following:
I have a very simple MIDI keyboard with no SPLIT function. Do you know a way to do a real-time channel split (based on keyboard position) and feed it into a soft synth ?

florian

2008-09-23 20:54:00

yes, no problem with "Midi Translator".

You need:

- Bome's Midi Translator Pro (MT)
http://www.bome.com/midi/translator/
- a virtual MIDI cable like Yoke

Then you can configure MT to sit in between keyboard and soft
synth (see MT manual). Now you can add a translator like this:

Code: Select all

INCOMING: MIDI pp qq rr
RULES:
 if pp < 128 THEN exit rules, execute outgoing
 if pp > 159 THEN exit rules, execute outgoing
 ss = pp
 ss = ss & 15
 pp = pp & 240
 if ss != 0 THEN exit rules, execute outgoing
 ss = 0
 if qq > 40 THEN ss = 1
 if qq > 60 THEN ss = 2
 if qq > 70 THEN ss = 3
 if qq > 80 THEN ss = 4
 pp = pp | ss
OUTGOING: MIDI pp qq rr
This will look quite cryptic to you, but it gives you maximum
flexibility:
  • Whenever you press a key or turn a knob or similar, a MIDI
    message is sent to your computer
  • MIDI translator receives it in the INCOMING line. Most MIDI
    messages are 3 bytes, and each byte is stored in the variables
    pp, qq, and rr.
  • in the rules, I first do a sanity check that if pp (the first
    MIDI byte) is smaller than 128. If it is, then it's not a regular
    MIDI message and we just pass it through by jumping to OUTGOING
    directly.
  • further, if the first byte is larger than 159 (0x9F) then this
    MIDI message is not a NOTE message and again, we do not alter it
    but "play" it directly.
  • then we define variable ss to contain the channel (from 0..15,
    rather than 1..16)
  • if the channel of your incoming message is not 1 (i.e. test for
    ss!=0 because ss starts channel count with 0), then again we just
    pass it through and do not do any channel mapping.
  • the following lines are the "gist": they set the new channel
    for this message in ss. qq is the variable that contains the MIDI
    message's note. If the note (in semitones) is larger than 40
    (this is an arbitrary value, you can set the split note to any
    other value), I remap the channel to 2 (need to set ss to 1,
    because channel counting starts from 0 here). For fun, I've added
    some more split notes to map to channels 3, 4, and 5. You can
    remove those lines.
  • at last, we set pp to the patched NOTE ON (or NOTE OFF) message
    with, possibly, the different channel
  • the OUTGOING message is the original MIDI message, but possibly
    patched with the different channel.

yvon

2009-04-27 04:14:13

How would this differ and/or be most flexible/logical when using version 1.70's own yoke-like feature?

ruediger

2009-05-07 14:32:09

Hi,

build in Midi Ports are included in installation procedure. So difference is that user don´t have to install a additional software.

And last but not least. The build in virtual Midi Ports should be more stable than Midi Yoke.

Cheers,
Rüdi

yvon

2009-05-07 20:48:31

Thanks Rudi!
So .... the code above would work exactly as it is? Just send the output to a Translator virtual midi port?

Sorry to be so lacking in Translator ability. Time problems this past while as I could figure stuff out if I had the days to play. Hopefully soon, yet I would like to add translator it very much looks like. Brilliant! Really appreciate the help.

This post I made here ties in with my other post towards committing to Translator as an essential if I can get it happening. So, if you have time could you look at my other post maybe. Whatever happens I understand for sure.

http://www.bome.com/forums/viewtopic.php?t=2473

my second post there is the clearest I guess.

florian

2009-05-11 23:58:18

yvon wrote:So .... the code above would work exactly as it is? Just send the output to a Translator virtual midi port?
yes :)
Florian