Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Scripting Variables Local to Track
Hello, I'm working on modifying the loop functionality for my DDJ-FLX4 mapping. When saving a loop to memory, the current implementation saves the loop into save slot 1, overwriting whatever was there previously. I want it to save to the next open slot, but I'm not sure how to do this. My first thought was to store a `@%loop_counter` variable, but this won't work because the value needs to be different for each track, but that would store the variable to the deck, and would be persistent as I load different tracks. Any tips on how I should go about this?

Here is the code I currently have mapped to by 4BEAT_LOOP button, which currently does not work as I want it to:

loop ? var '@%loop_counter' ? cycle '@%loop_counter' 8 & (get_var '@%loop_counter' & loop_save) & loop_exit : set '@%loop_counter' 1 & (get_var '@%loop_counter' & loop_save) & loop_exit : loop 16

I'm very new to VDJScript, so I'm not sure I'm doing everything right. Particularly getting the variable and saving the loop, so if I'm doing something wrong here please let me know. Thanks!
 

geposted Tue 17 Dec 24 @ 10:35 pm
locoDogPRO InfinityModeratorMember since 2013
saved_loop 1 !? saved_loop 1 : saved_loop 2 !? saved_loop 2 : saved_loop 3 !? saved_loop 3 : ...


does it exist on 1!? no it doesn't, save to 1 : exists on 1, so does it exist on 2 !? no it doesn't, save to 2 :
 

geposted Tue 17 Dec 24 @ 10:49 pm