Accesso rapido:  

Forum: General Discussion

Topic: Script chaining issue?
I'm currently trying to write a script that checks if the playing song has ended, and if so it stops playback and loads the next song in its place, then makes the other deck the active master deck.

So far I've managed to get the first part working successfully with this custom button:

repeat_start_instant 'AutoLoadNextOnEnd' 33ms & songpos_remain 33ms ? stop & playlist_load_and_remove

and I've also managed to get the second part working with this custom button to toggle the active master deck:

deck 1 masterdeck ? deck 2 masterdeck : deck 1 masterdeck

I need the master deck toggle to happen as part of the command chain in the first piece of code, but can't seem to get it working. I've tried:

repeat_start_instant 'AutoLoadNextOnEnd' 33ms & songpos_remain 33ms ? stop & playlist_load_and_remove & deck 1 masterdeck ? deck 2 masterdeck : deck 1 masterdeck

but that seems to ignore everything after checking if deck 1 is the master deck.

I'm sure I'm missing something really obvious, but I've spent hours trying things and searching these forums and I'm stuck. Can anyone help please?
 

Inviato Wed 13 Dec 23 @ 2:07 pm
locoDogPRO InfinityModeratorMember since 2013
33ms rsi with a 33ms window is cutting it too fine. rsi time is a little fuzzy depending on how 'busy' vdj is moment to moment, try a remain more like 100ms.
Plus unloading and loading might make the other deck become the masterdeck, so your toggle might switch back

repeat_start_instant 'AutoLoadNextOnEnd' 33ms & songpos_remain 100ms ? stop & playlist_load_and_remove & wait 50ms & deck 1 load_pulse ? deck 1 masterdeck : deck 2 masterdeck
 

Inviato Wed 13 Dec 23 @ 3:25 pm
Thanks, I hadn't considered the wait times might be an issue.

I just tried that, and (after actually clicking the button to make it active...) it works! Thank you so much.
 

Inviato Thu 14 Dec 23 @ 8:30 am