Sign In:     


Forum: VirtualDJ Technical Support

Topic: Changing button behavior based on Slicer Step
Is it possible to detect what step length is in use?

deck 1 slicer step '1 bt' ? action2 : deck 1 slicer step '2 bt' ? action1

Displaying `deck 1 slicer step` as a button name works fine, but I can't figure out how to read it with script mapped to buttons.

-edit, solved...of course - you need the step in quotes!
deck 1 slicer 'step' 1 ? play_pause

 

Posted Thu 02 Jan 25 @ 6:20 pm
it doesn't need quotes if comparing as an int
deck 1 slicer step 0.5 ? on : off

but you could always compare as a string with param_equal [which needs quotes round the string]
param_equal `slicer step` "1 bt" ? on : off
 

Ty sir
I suppose while I'm at it...Is there any way to use the step count as a multiplier?
deck 1 get_beat_num 2 8 ? deck 1 goto ( -1 * deck 1 slicer step)

this would be mad easier than trying to write conditionals for every step.
long story short, im hacking the slicer to work more like a step sequencer on a grid controller.
 

no such luck, you've got to go the long way.
If you have a custom button going spare you could have it turn[query all combos] a string into a saved float variable.
 

Alrighty, still trying to sort this! We've got an unused button setup right now to capture the step and store it
deck 1 slicer step 0.03125 ? set $d1step 0.03125 : deck 1 slicer step 0.0625 ? set $d1step 0.0625 : deck 1 slicer step 0.125 ? set $d1step 0.125 : deck 1 slicer step 0.25 ? set $d1step 0.25 : deck 1 slicer step 0.5 ? set $d1step 0.5 : deck 1 slicer step 1.0 ? set $d1step 1.0 : deck 1 slicer step 2.0 ? set $d1step 2.0

trying to use it to vary the size of a beatjump
param_multiply -4.0 "get_var '$d1step'" & param_cast & deck 1 goto

assuming for instance a step of 1, instead of beatjumping -4 beats relative to the current location, it jumps to a single fixed location
 

param_cast relative

you could bracket the set part to do it in one button
( deck 1 slicer step 0.03125 ? set $d1step 0.03125 : deck 1 slicer step 0.0625 ? set $d1step 0.0625 : deck 1 slicer step 0.125 ? set $d1step 0.125 : deck 1 slicer step 0.25 ? set $d1step 0.25 : deck 1 slicer step 0.5 ? set $d1step 0.5 : deck 1 slicer step 1.0 ? set $d1step 1.0 : deck 1 slicer step 2.0 ? set $d1step 2.0 ) & param_multiply -4.0 "get_var $d1step" & param_cast relative & deck 1 goto
 

I got that working even before posting; and turned back without realizing I'd run into a different sort of issue. I changed my gotos to set $tests to check the numeric values, and when using relative param_cast the numbers started going out of bounds after changing the step. So I turned back, not realizing my issue stemmed from how I'm using the beat counter.

I get that I could stuff the lengthy $d1step variable assignment at the beginning - trying to get this other bit sorted before then!

I've got an 8x8 grid, I've mapped slicer 1-8 to the top row. Slicer doesn't quite work how I'd like, I'd like the song to jump to the slice pressed.

So here is button 1 of the top row
deck 1 get_beat_num 2 8 ? param_multiply -1.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 3 8 ? param_multiply -2.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 4 8 ? param_multiply -3.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 5 8 ? param_multiply -4.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 6 8 ? param_multiply -5.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 7 8 ? param_multiply -6.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 get_beat_num 8 8 ? param_multiply -7.0 "get_var '$d1step'" & param_cast relative & deck 1 goto : deck 1 slicer 1

It detects which beat/slice we're on, and jumps backward accordingly.

So this configuration is working perfectly for a step of 1; because I'm using 'geat_beat_num n 8' the slicer stays perfectly in sequence with the beat counter.

However, after changing the step from 1 to 2, or smaller than 1, I'm still picking up button presses as if it was two 4beat measures, instead of the smaller or larger step change. Any idea how I can go about catching/tracking the beat counter in such a way that it can handle the other step counts?

Preemptive apologies and thanks =D. I was trying to keep my questions to more short, orderly, and code-oriented snippets, but I couldn't abstract what a solution to this would look like.

--- edit
Umm. Sheesh. Didn't know / think to just query the slice itself. Just had the thought to try and it works. This may do the trick.
deck 1 slicer 2 ? play_pause 

Sorry for all the bother then! I'll be back if I have any further questions.