Array emulation using 4 sequential variables and Automatic generation of rules

pedro.estrela

2020-05-12 14:37:29

Hi
BOME lacks arrays (https://www.bomeloft.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.

Steve-Bome Forum Moderator

2020-05-12 18:15:35

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

pedro.estrela

2020-05-12 20:37:25

comment

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): https://github.com/pestrela/music/blob/master/traktor/tools_traktor/bome_duplicate_deck.py#L7 https://github.com/pestrela/music/blob/master/traktor/tools_traktor/bome_duplicate_deck.py#L57 And all possible operators: https://github.com/pestrela/music/blob/master/traktor/tools_traktor/bome_duplicate_deck.py#L10 Interestingly, I had to revert some replacements after-the-fact. This now produces a valid BMTP: https://github.com/pestrela/music/blob/master/traktor/tools_traktor/bome_duplicate_deck.py#L15 ---- Next step is to replace all timers as well. My pattern there is simpler: Pattern then is XXX_YYYY1 -> XXX_YYYY2

pedro.estrela

2020-05-12 21:26:05

comment

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

Steve-Bome Forum Moderator

2020-05-13 04:17:22

comment

Thanks Pedro!

pedro.estrela

2020-10-04 19:12:23

comment

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