Huge lookup table possible or json ? complex interaction between keyboard maestro, local python script and google sheet

Hello, so I have a google sheet with a large database of chord progressions, each consisting of an “x” number of chords that each have 4 voices. each voice have a number that identify which note it is (F major is the reference here)

each chord progression have a unique id “#A002#” for ex.

I have a local python script talking to the google api to pull in realtime the value of that cell everytime it changes, they the id value is sent to keyboard maestro with a webserver and stored inside a variable. Now I will create a lookup table inside keyboard maestro, to send a different value to bome depending on the id.

Inside bome, I am looking for an efficient way to map the chosen chord progression to the keys “F3, G3, A3 etc.”

I thought about using a preset that act as a preset activator, depending on the value received by bome, deactivate/activate the correct the preset. That would require a new preset for each chord in the database, and inside each preset, I will hardcode the output for each of my remote keys. Upon activation, the preset would store inside variables all notes of all voices for each chord. For ex 4 variables for the first chord, 4 for the next etc.

then output notes depending on the variable.

I am wondering if there is a more efficient way to do this, I would love to create a json file and just have bome read that to translate the id into a correct mapping, without using a billions of variables or a a billion of different presets

I am thinking maybe instead of using an id system, I should add to my database the octave value for each note, then dynamically pull all the values of the notes+octaves with my local python script, this way I can have everything inside one bome preset, maybe .. not sure

Hi,

You do it in Bome as you suggest with preset variables and each preset mapping to a chord. You could also use a translator for each incoming key and use the perform function in rules to send each chord.

For instance consider incoming pp as the key.

if pp!=23 then skip next rule
Perform ‘Chord-On’ , 12,14,16,18
if pp!=24 then skip next rule
Perform ‘Chord-On’ , 12,15,22,35

The outgoing would be the note values.

The Perform might look like this

Incoming: Perform Chord-On with parameters oo,pp,pq, rr

Outgoing Raw MIDI
90 oo 7F 90 pp 7f 90 qq 7r 90 rr 7f

You would do similar for Chord-Off.

Of course, the alternate would be to use Python to convert the keys to chords and send the notes to Bome MIDI Translator Pro separately.

Using this method, you could put all of the mapping in to the rules section of the translators, one for chord on and the other for chord off. Since you are only using 4 notes, it can all be handled with local variables.

Steve Caldwell
Bome Customer Care


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

P.S. The notes I used in this example are nonsensical chords.

1 Like

can bome receive multiple cc with multiple value from the same port, same channel, within one translator, if the data is sent to bome at the same time, I am writing a set of rules to assign the correct variables to all incoming cc data

For a single translator the MIDI data would need to be in the same order.

For example, RAW MIDI

B0 00 7F B0 01 7F
is not the same as
B0 01 7F B0 00 7F

For outgoing, you can still send raw MIDI and it will always go in the same order.

Steve Caldwell
Bome Customer Care


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