Simplify or consolidate many translators into fewer

Hey :smiley:
I need a midi channel patchbay/router/forward to connect my hardware synths with and without keyboards to each other. Then plan is to send midi on any channel to my BomeBox and have it forward the midi to selected channels.

I’m drafting it so I can set the connections with my Beatstep. The principle is simple:
if ga=1 send channel 1 midi to channel 1 (by enabling preset “11”)
if ga=0 don’t send channel 1 midi to channel 1 (by disabling preset “11”)
if gb=1 send channel 1 midi to channel 2 (by enabling preset “12”)
if gb=0 don’t send channel 1 midi to channel 2 (by disabling preset “12”)
etc. with 8x8=64 global variables and a corresponding 64 presets. ( It’s 8x8 because I’m limiting the scope to midi channels 1-8 for now.)

Each of the 64 presets must then have 7-8 translators forwarding different midi messages: Note On, Note Off, Control Change (7 + 14 bit), Pitch Bend, Polyphonic Key Pressure, Channel Pressure and perhaps NRPN).

That’s a total of 64 presets and 512 translators!!

It doable to make them, since it’s mainly copy/paste. But this setup seems a bit heavy, and I’m wondering if there’s an easier way…

Any suggestions to simplify the process or consolidate the process into fewer translators and presets??

Maybe we can have “MIDI channel” as an incoming/outgoing events in a later version, but until then - what’s the best way to solve this? :slight_smile:

BR Mathias

Hi and welcome to the Bome community!

Yes, I often use less translators and more rules. For instance I can take the following 3 byte MIDI message and use the incoming values to manipulate what I want to send and on which channels. You can do the same with 2 byte MIDI messages and any given message pattern

Title: Any 3 byte MIDI message
Incoming: oo pp qq
Rules:
// determine MIDI Channel from that status byt
rr=oo&0x0f
// rr will now be MIDI CH 1 (0) to MIDI CH 16 (F)

//What is the message type
tt=oo&0xf0
if tt==0x90 then goto “Note On”
if tt==0x80 then goto “Note Off”
if tt==0xb0 then goto “CC”
if tt==0xe0 then goto “PitchBend”

//Note or cc number or Pitchbend LSB will be in variable pp
// Velocity, value or Pitchbend MSB will be in variable qq

Label “Note On”
Log “Incoming was a note ON message”
if qq==0 then Log "Velocity is 0 so it is really a note-off message)

Goto “Done”

Label “Note Off”
Log “Incoming was a note Off Message note=%pp%”
Goto “Done”

Label “PitchBend”
Log " Incoming was Pitch bend with LSB=%pp and MSB=%qq%"

Label “Done”

– End of rules

You can use Logical AND (&) OR (|) and XOR (^) to do bitwise manipulation so it is possible you may not need so many global variables. Each global variable is a 32 bit signed in so I can control on/of state of 32 LED lights with a single global variable and use bitmapping.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

Thanks! This makes a lot of sense and will save me hundreds of translators :slight_smile:

A few things I don’t understand, though:

  1. in the rules section, the prefix “0x” simply tells BMT to treat as hex instead of decimal? While raw midi used in the incoming/outgoing sections are always hex?

  2. how can rr be oo AND 0x0f? Or what does that assignment do?

  3. I assume you’re refering to setting oo pp qq as the incoming raw midi message to all 3 byte midi messages? And similarly, oo pp would catch ass 2 byte messages, but not any part of 3 byte messages?

  4. can you do an example of bitwise manipulation that allows more values to be stored in a single variable? Ie., how to “put them into” the variable and “pull them out again”…

  5. sometimes I will need to 8x the midi message (send the same incoming midi out to 8 channels). Is there a good way to handle that inside one translator? (Maybe if there’s a way to “empty” variables, so that, say, “oo pp qq rr ss tt” would output nothing if all the variables are empty, or one 3 byte midi message if “rr ss tt” are empty, and finally two 3 byte midi messages if all 6 variables are defined.)

Thanks, I’m learning a lot here! :slight_smile:

BMT and the BomeBox are just great inventions :grinning:

BR, Mathias

Correct. Also if you enter 0x40 in the rules, if you come back to after saving it will show in decimal (64).

oo and rr are both local variables, you are setting the value of rr to the value of oo AND 0x0f. This is a bitwise operation. So if oo is 0x95 after the operation rr will be 5.

Correct. Bome MIDI Translator is smart enough to know when the MIDI message ends.

See this post.

Use a repeating timer and global variables. In the timer, iterate through the number of times you want to output your message changing the values on each iteration. I think there is a good example somewhere in this forum when I do this to control the APC-MINI’s 64 LEDs. Search on ‘APC-MINI’

:+1:

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thanks again! :grinning:

I have to read up on bitwise and practice some on my own, but everything else makes perfect sense to me now, and your advice will certainly make my project much neater and efficient :+1:

One thing, though, for me to better understand bitwise: Can you explain how decimal 149 (0x95) and decimal 15 (0x0f) will equal decimal 5? (original question 2)

After that, I’ll get out of your hair :grin:

BR, Mathias

95 Hex is 1001 0101 in binary
0F Hex is 0000 1111 in binary
----------------------------------
Result       0000 0101 in binary or 5

0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = A
1011 = B
1100 = C
1101 = D
1110 = E
1111 = F



Where
 1 AND 1 = 1
 1 AND 0 = 0
 0 AND 1 = 0
 0 AND 0 = 0


Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Got it. Perfect explanation, thanks! :+1:t2::blush: