The root note of any inversion of the chord

First of all, I would like to thank you for BMT and all your work. This software is absolutely great.

I’m trying to create some kind of auto accompaniment to using arps in my DAW to live performance. I splitted keyboard left/right. On the left side the only problem is the bass line. I would like the bass to always play the root note, regardless of the played chord inversion, but a synthpad in the other port should still play the inverted chord.
I have created a project with major and minor triads 1-4-7, 1-3-7 in all play sequences and inversions but it doesn’t work always.

[x] Translator 0.2: note off
Options: stop,swallow
Incoming: MIDI 90 oo 00, on port keyboard in
Outgoing: MIDI 90 oo 00, to port CX-Keys-1-ROOT

[x] Translator 0.3: 1-4-7 (123 pressing sequence1)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=pp-oo
tt=qq-oo
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 oo vv, to port CX-Keys-1-ROOT

[x] Translator 0.4: 1-4-7 (132)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=qq-oo
tt=pp-oo
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 oo vv, to port CX-Keys-1-ROOT

[x] Translator 0.5: 1-4-7 (213)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=oo-pp
tt=qq-pp
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 pp ww, to port CX-Keys-1-ROOT

[x] Translator 0.6: 1-4-7 (231)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=oo-qq
tt=pp-qq
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 qq ww, to port CX-Keys-1-ROOT

[x] Translator 0.7: 1-4-7 (321)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=pp-qq
tt=oo-qq
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 qq ww, to port CX-Keys-1-ROOT

[x] Translator 0.8: 1-4-7 (312)
Options: swallow
Incoming: MIDI 90 oo vv 90 pp ww 90 qq xx, on port keyboard in
Rules:
if vv==0 then exit rules, skip Outgoing Action
if ww==0 then exit rules, skip Outgoing Action
if xx==0 then exit rules, skip Outgoing Action
ss=qq-pp
tt=oo-pp
if ss!=4 then exit rules, skip Outgoing Action
if tt!=7 then exit rules, skip Outgoing Action
Outgoing: MIDI 90 pp ww, to port CX-Keys-1-ROOT

I used for inversions similar translators with 7-1-4, 4-7-1 and minor chords 1-3-7, 7-1-3, 3-7-1
Is there a more efficient method for the root of the triad?

By the way, Is there a way to use incoming RAW midi editor to input channel variables 9(pp) qq rr or message type (pp)0 qq rr, eventually ignore/use any channel number or type message 9(all) pp qq without using special rules?

Marcin K.

Without looking too deep, I think there are a few issues here.

  1. Your incoming messages seem to indicate that the 3 keys are always hit at “exactly” the same time which is probably not normal behavior when you are playing. You probably should give the translators a little time before evaluating the notes. You would do this by capture them and then using a timer to evaluate them (maybe 10ms delay).

  2. You are using local variables in your translators which are not remembered between iterations. It is probably better in this case to use global variables.

For number 1 you should use a single note number into an empty slot global variable (g0, g1 or g2). The single translator would handle the entire chord so that if the note order is a bit off, then it really won’t matter. Also if there is a control message that sneaks in between notes, it could be handled separately.

Then 10ms later have the timer evaluate the values of each to determine the root note to send. You might want to play around with the delay a bit.

For note-off you could set the variable, g0, g1 or g2 to -1 to indicate the slot is empty along with passing through the note-off message.

As far as note evaluation I ususually do this:

Incoming : oo pp qq
Rules
// check for note message
rr=oo&0xe0
if rr!=0x80 then exit rules, skip outgoing action

With the above if incoming is 0x9n or 0x8n, it will be interpreted as a note message

I hope this helps!

Steve

Thank you for the quick reply
It took me a while to understand, especially how to assign separate notes to variables when all the translators can see the input at once. I don’t know if that’s exactly what you meant
I wasn’t familiar with resetting variables before, and this filter formula is great. Maybe a few of such tricks and ready-made patterns for pasting should be added to the manual

My preset isn’t particularly elegant, but it works!
And I learned a lot again
Thank you and best regards.

[x] Preset 55: chord 2

[x] Translator 55.0: start
Incoming: on activation of this preset
Rules:
// initialize
n1=-1
n2=-1
n3=-1
Outgoing: (none)

[x] Translator 55.1: n3
Options: swallow
Incoming: MIDI oo pp qq, on port keyboard in
Rules:
// check for note message
rr=oo&224
if rr!=128 then exit rules, skip Outgoing Action

if qq==0 then exit rules, skip Outgoing Action
if n1<=0 then exit rules, skip Outgoing Action
if n2<=0 then exit rules, skip Outgoing Action
n3=pp
Outgoing: One-shot timer “n3”: 0 ms delay, delay:10 millisec

[x] Translator 55.2: n2
Options: swallow
Incoming: MIDI oo pp qq, on port keyboard in
Rules:
// check for note message
rr=oo&224
if rr!=128 then exit rules, skip Outgoing Action

if qq==0 then exit rules, skip Outgoing Action
if n1<=0 then exit rules, skip Outgoing Action
if n3>0 then exit rules, skip Outgoing Action
n2=pp
Outgoing: One-shot timer “n2”: 0 ms delay, delay:10 millisec

[x] Translator 55.3: n1
Options: swallow
Incoming: MIDI oo pp qq, on port keyboard in
Rules:
// check for note message
rr=oo&224
if rr!=128 then exit rules, skip Outgoing Action

if qq==0 then exit rules, skip Outgoing Action
if n2>0 then exit rules, skip Outgoing Action
if n3>0 then exit rules, skip Outgoing Action
n1=pp
Outgoing: One-shot timer “n1”: 0 ms delay

[x] Translator 55.4: n0
Options: swallow
Incoming: MIDI oo pp qq, on port keyboard in
Rules:
// check for note message
rr=oo&224
if rr!=128 then exit rules, skip Outgoing Action

if qq!=0 then exit rules, skip Outgoing Action
// note off
n1=-1
n2=-1
n3=-1
Outgoing: One-shot timer “n0”: 0 ms delay, delay:10 millisec

[x] Translator 55.5: ROOT rules
Incoming: On timer “n3”
Rules:
// 1-4-7 (123)
pp=n2-n1
qq=n3-n1
if pp!=4 then skip next 2 rules
if qq!=7 then skip next rule
nr=n1
// 1-4-7 (132)
pp=n3-n1
qq=n2-n1
if pp!=4 then skip next 2 rules
if qq!=7 then skip next rule
nr=n1

//=========================================
exit rules, execute Outgoing Action
Outgoing: MIDI 90 nr 7F, to port CX-Keys-1-ROOT

[x] Translator 55.6: root 0
Incoming: On timer “n0”
Rules:
oo=nr
nr=-1
Outgoing: MIDI 90 oo 00, to port CX-Keys-1-ROOT

I’m glad you got it working. Yes the manual is more aimed at the basic tools available and not necessarily various techniques you can use to do things. For that we have.

  1. Tutorial Videos
  2. Tips and Tricks category of this forum
  3. Asking questions here

This might be a good candidate to put into Tips and Tricks.

Steve Caldwell
Bome Customer Care


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