Array emulation using 4 sequential variables and Automatic generation of rules

Hi
BOME lacks arrays (https://www.bome.com/support/kb/mt-pro-script-arrays ).
Instead of complex bit arithmetic to share variables, I just emulated them using sequential global variables.

The pattern is as follows:
- The first character are all global variables, taken from this list: 'ghijklmnyz'
- The second character goes as follows: 1234 / 5678 / ABCD / ...

Examples:

g1 = elapsed timestamp for deck A
g2 = elapsed timestamp for deck B
g3 = elapsed timestamp for deck C
g4 = elapsed timestamp for deck D

ga = track lenght for deck A
gb = track lenght for deck B
gc = track lenght for deck C
gd = track lenght for deck D

h5 = jog touched state for deck A
h6 = jog touched state for deck B
h7 = jog touched state for deck C
h8 = jog touched state for deck D

etc

For a full working example, please see my project here:
https://github.com/pestrela/music/blob/master/traktor/mapping_ddj_1000/DDJ-1000%20v6.8.0%20-%20BOME-side%20Mapping.bmtp

ISSUE: The above scheme works very well, and its very simple to understand. Issue is that I have to quaduplicate all rules by hand to change the variables.

QUESTION: does anybody used something similar? if yes, do you have an automatic way to patch the variables names?

REASON: I've just started making a pyhton program to automatically patch the variables, and I'm worndering if someone tried this before.

Hi Pedro,  

I've used Python once or twice. For creation, however I usually load up an excel sheet and copy and past as text from there.  For me it just takes less time than setting up a python program.

 

I try to make everything as generic as possible in rules. That way I can copy and paste into a text editor and then use global find and replace for various variable names.

 

Indeed arrays would be nice. So would strings.

 

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

I’ve now made a first program to duplicate a deck by replacing every possible strings

This generates all possible variables (powerset of these lists):


And all possible operators:

Interestingly, I had to revert some replacements after-the-fact. This now produces a valid BMTP:


Next step is to replace all timers as well. My pattern there is simpler:
Pattern then is XXX_YYYY1 -> XXX_YYYY2

now uploaded a versipn that changes timers and channels as well.

Thanks Pedro!

I’ve added this post to the advanced mappings index: https://www.bome.com/support/kb/index-of-advanced-posts-and-tools