Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Calling a variable for relative song_pos adjustment...

This topic is old and might contain outdated or incorrect information.

It's been a while since I've scripted and i can't remember the syntax to plug a variable directly into a verb. I want to plug '$4thnoteadj' into a relative son_pos action. So song_pos +{the variable} Thanks, and I hope everyone is safe and healthy
 

Posted Mon 06 Apr 20 @ 7:21 pm
locodogPRO InfinityModeratorMember since 2013
get_var '$4thnoteadj' & param_cast 'relative' & song_pos
 

Posted Mon 06 Apr 20 @ 7:28 pm
Ahh, I tried casting the param, and only got absolute position, didnt remember the relative modifier. Thank you good sir.
 

Posted Mon 06 Apr 20 @ 7:40 pm
deck left select ? deck right get_bpm & param_multiply 1.667 & set '$4thnoteadj' & goto_cue & get_var '$4thnoteadj' & param_cast 'relative' & deck left song_pos
edit:
deck left select ? deck right get_bpm & param_multiply 1.667 & param_cast 'ms' & set '$4thnoteadj' & deck left goto_cue & get_var '$4thnoteadj' & param_cast 'relative' & deck left song_pos


it's still going to the absolute position... Do I need to specify that the parameter is a 'ms' call as well as relative? if so how do I specify both in the same cast?
 

Posted Mon 06 Apr 20 @ 8:07 pm
locodogPRO InfinityModeratorMember since 2013
song_pos is a percent 0.0 - 1.0, maybe you want
goto
 

Posted Mon 06 Apr 20 @ 8:41 pm
I'm basically trying to activate a hotcue, and then apply a time offset in milliseconds based on the quarter note value of the opposing deck's bpm immediately after. So when the button is pressed it will immediately jump the track to X amount of milliseconds past the selected hotcue position. If goto will accept relative value in MS then that's what I need.
 

Posted Mon 06 Apr 20 @ 8:46 pm
locodogPRO InfinityModeratorMember since 2013
it does, cast 'ms' then cast 'relative' to goto
 

Posted Mon 06 Apr 20 @ 8:50 pm
Got it, casting to a cast was what I was missing.

deck left select ? deck right get_bpm & param_multiply 1.667 & param_cast & set '$4thnoteadj' & deck left goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck left goto : deck left get_bpm & param_multiply 1.667 & param_cast & set '$4thnoteadj' & deck right goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck right goto

Works perfectly, Thanks Loco! Now to plug it into the whole thing and see if it all works...
 

Posted Fri 10 Apr 20 @ 2:09 am
locodogPRO InfinityModeratorMember since 2013
I think you could cut it to this

deck left select ? deck right set '$4thnoteadj' `get_bpm & param_multiply 1.667` & deck left goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck left goto : deck left set '$4thnoteadj' `get_bpm & param_multiply 1.667` & deck right goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck right goto

not much of a cut, but still a cut
 

Posted Fri 10 Apr 20 @ 2:16 am
NicotuxHome userMember since 2014
a short alternative deck related (pad like) applies to the deck the button belongs to

goto_cue & get_text `leftdeck ? deck right get_bpm : deck left get_bpm` & param_cast 'ms' & param_multiply 1.667 & param_cast 'relative' & goto

activates a hotcue, and then apply a time offset in milliseconds based on the quarter note value of the opposite deck's bpm immediately after
 

Posted Fri 10 Apr 20 @ 8:29 am
locodog wrote :
I think you could cut it to this

deck left select ? deck right set '$4thnoteadj' `get_bpm & param_multiply 1.667` & deck left goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck left goto : deck left set '$4thnoteadj' `get_bpm & param_multiply 1.667` & deck right goto_cue & get_var '$4thnoteadj' & param_cast 'ms' & param_cast 'relative' & deck right goto

not much of a cut, but still a cut


I like it, it's cleaner, and as quickly and consistently as this has to respond to make it work every verb that can be eliminated helps. TY again Loco.
 

Posted Fri 10 Apr 20 @ 6:31 pm
Nicotux wrote :
a short alternative deck related (pad like) applies to the deck the button belongs to

goto_cue & get_text `leftdeck ? deck right get_bpm : deck left get_bpm` & param_cast 'ms' & param_multiply 1.667 & param_cast 'relative' & goto

activates a hotcue, and then apply a time offset in milliseconds based on the quarter note value of the opposite deck's bpm immediately after


Does the get_text `leftdeck query only return true if the left deck is the action deck?
 

Posted Fri 10 Apr 20 @ 6:33 pm
NicotuxHome userMember since 2014
the get_text `leftdeck ..` query returns the calculated bpm of the opposite deck ,
so you are right, leftdeck query returns true when left deck is action_deck
 

Posted Fri 10 Apr 20 @ 7:12 pm
Nic', You taught me something, TY. That's got all sorts of useful applications, nice shortcut!
 

Posted Tue 28 Apr 20 @ 12:49 am
locodogPRO InfinityModeratorMember since 2013
Nicotux wrote :
.....
get_text `leftdeck ? deck right get_bpm : deck left get_bpm` & param_cast 'ms' & ...


Tidy technique there, +1 :)
 

Posted Tue 28 Apr 20 @ 10:44 am


(Old topics and forums are automatically closed)