Bome MIDI Translator Programing Question

  • Q&A Forum
  • Bome MIDI Translator Programing Question
0
0

I am very pleased with how versatile the Bome MIDI Translator is 🙂

I’m doing my first preset with conditionals.  My question is how to label a subroutine?

I have a conditional that if met calls for a Jump (goto) to a subroutine called “or1.”  I’m used to programing in basic where I would have a line “or1,” and all the programming steps after, with a return or a Jump at the end.

Is it the same in Bome MIDI Translator?  Do you have a specific label or just name the first step “or1?”  Should every translation be named “or1?”

If you could post a short example with a subroutine it would be greatly appreciated.

Thanks

Steve

Marked as spam
Posted by (Q&A Forum: 7, Answers: 35)
January 7, 2019 3:50 pm
41 views
0
Private answer

I’m not exactly clear.  It looks, to me, that the “routine” is part of rules.  I want to call a “routine” as part of my translations.

Do I just put in a translation called Label “routine?”  Or just “routine.” followed by my translations for that conditional?  I have a translation; “if l1==2 then goto “or2.”  I put in a translation called “or2return”  Jump back to.  Can this be done like this?…

Marked as spam
Posted by (Q&A Forum: 7, Answers: 35)
January 7, 2019 4:46 pm

Hi, Each translator has it’s own rules and label. They are not shared between translators.

If you are thinking of something like a “subroutine” that any translator can call and are shared, then this is not implemented in Bome MIDI translator.

Any communications between translators needs to be done by means of global variables. For instance, you can set a global variable in one translator and then trigger a timer with rules to manipulate the variables (kind of like a function call). When the rules complete in the timer, you could then trigger another event to indicate that the timer function has completed. The final event triggered could then look at the global variable results. It is a bit clunky to do things this way so perhaps if you can give me an idea on what you are doing, I can recommend a more efficient way.

Having globally available function calls has been requested in the past so a future release might having something like this.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

( at January 7, 2019 5:00 pm)

Hi Steve – I’m not always clear on the names used in BMT.

I have a single preset with all the translations on the same page. What I need to do is branch of from a translation on a conditional to co to a series of translations then return to the original translation.

Below is part of the translation copied from the preset”

[x] Translator 1.26: Orville1 if2
Incoming: Control Change on ch. 1 with CC#:45 (0x2D) and value:127 (0x7F)
Rules: if l1==2 then Goto “8k1”
Outgoing: (none)

[x] Translator 1.27: Orville1 if3
Incoming: Control Change on ch. 1 with CC#:45 (0x2D) and value:127 (0x7F)
Rules: if l1==4 then Goto “8k2”
Outgoing: (none)

[x] Translator 1.28: Orville1 if5
Incoming: Control Change on ch. 1 with CC#:45 (0x2D) and value:127 (0x7F)
Rules: if l1==5 then Goto “or2”
Outgoing: (none)

[x] Translator 1.29: o2return
Incoming: (none)
Rules: l1=4
Outgoing:

[x] Translator 1.30: Orville1 set
Incoming: Control Change on ch. 1 with CC#:45 (0x2D) and value:127 (0x7F)
Outgoing: MIDI F0 1C 70 04 01 0F 0F 0F 0F 0F 07 0F 0F F7

…s

( at January 7, 2019 5:11 pm)

Could you give me an idea on what the routines 8k1, 8k2 and or2 would actually do be for returning to o2return? I assume when youa re done you always want to set i1 back to value of 4. I further assume 1.30 would always execute.

More than likely you will want to have a single rule to trigger a timer and then have the timer perform the necessary actions based on the value of i1.

( at January 7, 2019 5:34 pm)

Like minds, I was just reading the 0ms timer sections in the manual.

My issue is that I need to do the conditional translations before I do the main translation:

Its complicated but I am switching MIDI ID#s. The Eventides, in order for the MIDI and Serial ports to both operate they both have to be ID# 1. So, what I am doing is finding the last of the 4 units to be changed to ID# 1 and changing it to its real ID# e.g. 4, then and only then I change the new selected unit e.g. ID# to to ID#1.

Would it work if I send a conditional to a 0ms timer below the conditional and at the end of the conditional I create a return timer to get the pointer? back to just below the conditional?…

( at January 7, 2019 5:48 pm)

I should ask: Can a raw system exclusive MIDI message be sent from “Rules?”

( at January 7, 2019 5:53 pm)

Yes, you have a single input that should handle all of the conditionals in rules within one translator and the output to a timer that can do the clean up work when you are done and then send the desired output message if desired.

( at January 7, 2019 5:54 pm)

Great! I don’t follow how to do it e.g. how do I send a raw MIDI message “F0 1C 70 01 01 0F 0F 0F 07 0F 0F 0F 0F F7” from rules?

If that can be done there would there still be a need for a 0ms timer?…s

( at January 7, 2019 5:59 pm)

Hi, rules are rules, output is output.
You can have multiple translators with the same input and each having different rules.
You can have multiple translators with the same input that can trigger different MIDI messages (raw or otherwise), or even send keystrokes or mouse movement.
The output will happen in order of the translators from top to bottom. You can also inhibit future translators to execute if you check the box “Stop Processing after Executing this Translator”

( at January 7, 2019 6:03 pm)

Hi Steve,
Would this work:
There are 9 translations per key press, 4 keys to be translated;
If I put a translation with a conditional rule for each translation looking to match a variable and either “if l1==2 then exit rules, execute Outgoing” or “if l1==3 then exit rules, skip Outgoing Action” it seems it should work, its just a lot of translations 3x9x4!

( at January 7, 2019 6:37 pm)

Or … Can timers be used to “goto” and “return” from a “subroutine?”

( at January 7, 2019 6:37 pm)

No, goto is only within the given translator.

( at January 7, 2019 7:09 pm)

Could you provide a generic flow of what you are trying to accomplish? I assume you want different output depending on the value of i1. In that case you can do something like this.
// Note on channel 1
oo=0x90
// which note
if i1==1 then pp=25
if i1==2 then pp=27

Outgoing
Raw MIDI : oo pp qq

( at January 7, 2019 7:17 pm)

I think I got it to work but I have to do the full programing in order to test. It’s a lot of translations, 3x9x4, whew!

What seems to be working is to put the first set of translations as conditionals (if l1==x then …) for each of the 9 steps (translations) for each condition of “l1.”

Thankfully I can cut and paste between Project Files. I set up a project file to build and test each module, but I won’t know if it is working until I run it on the whole system.

Thanks for the help…s

( at January 7, 2019 7:48 pm)

Steve – is there a limit as to the size of a project file?…s

( at January 7, 2019 7:55 pm)

I don’t think so. I’ve never found a limit. Maybe based by the amount of memory on the platform it is running on.

( at January 7, 2019 7:57 pm)

How big of a project can the BomeBox take?…

( at January 7, 2019 9:05 pm)

16 MB I think is the max. I don’t think I’ve every seen a project even to 1MB.

( at January 7, 2019 9:24 pm)
0
Private answer

Hi, and thanks for the good words.

These are not really subroutines per-se. When you jump to a label after done, execution will not return to the caller so if you want it to return you have to jump back to the original spot.

Here is an example

//… do some stuff

ga=1

goto “routine

label “return 1”

//.. do more stuff

ga=2

goto “routine”

label “return2”

//… do other stuff

goto “done”

 

label “routine”

// do routine

if ga== 1 then goto “return1”

if ga==2 then goto “return2”

// default would be to continue flow after routine.

label “done”


Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Marked as spam
Posted by (Q&A Forum: 35, Answers: 2542)
January 7, 2019 4:26 pm