Accesso rapido:  

Forum: General Discussion

Topic: Applying seperate actions for merged buttons
If I have four decks on my dj-hardware and want to create four different variated characters, one for each deck on pad button 8. How do I apply the variated characters to the seperate decks so e.g '$varChar3' that is supposed to only handle deck 3, will not interfere with deck 2 etc.

Hypothetically thinking as if you could apply actions to each deck's "pad button 8" individually.
 

Inviato Mon 03 May 21 @ 10:04 pm
Can just query what deck button was triggered at, if I understood you correctly...

get_deck 3 ? do this : else do this

 

Inviato Mon 03 May 21 @ 10:27 pm
Actually you should use:
action_deck 1 ? action1 : action_deck 2 ? action2 : action_deck 3 ? action3 : action_deck 4 ? action4


However, if action1, action2, action3 and action4 are all the same and only the variable is different, then you could use local variables instead of global.

$MyVar is a global variable. It has the same value for all decks.
However, MyVar (without the dollar sign $) is a local variable and it can have different value per each deck.
Look at the following example. We check 4 different global variables (one for each deck) and then we perform the same action:
action_deck 1 ? var_equal '$MyVar1' 1 ? play : nothing : action_deck 2 ? var_equal '$MyVar2' 1 ? play : nothing  : action_deck 3 ? var_equal '$MyVar3' 1 ? play : nothing  : action_deck 4 ? var_equal '$MyVar4' 1 ? play : nothing


While the above code is 100% correct and it will work perfectly, it can be simplified to this:
var_equal 'MyVar' 1 ? play : nothing

In other words we removed the 4 global variables (one per deck) and we substitute them with one local variable.
 

Inviato Wed 05 May 21 @ 4:14 pm
Solved it. Thanks!
 

Inviato Wed 05 May 21 @ 5:26 pm