Ingresar:     


Forum: VirtualDJ Plugins

Tópico: Calling a variable for relative song_pos adjustment...

Este tópico es antiguo y puede contener información incorrecta para la nueva versión.

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
 

Mensajes Mon 06 Apr 20 @ 7:21 pm
get_var '$4thnoteadj' & param_cast 'relative' & song_pos
 

Ahh, I tried casting the param, and only got absolute position, didnt remember the relative modifier. Thank you good sir.
 

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?
 

song_pos is a percent 0.0 - 1.0, maybe you want
goto
 

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.
 

it does, cast 'ms' then cast 'relative' to goto
 

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...
 

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
 

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
 

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.
 

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?
 

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
 

Nic', You taught me something, TY. That's got all sorts of useful applications, nice shortcut!
 

Nicotux wrote :
.....
get_text `leftdeck ? deck right get_bpm : deck left get_bpm` & param_cast 'ms' & ...


Tidy technique there, +1 :)
 



(Los tópicos y foros antiguos son automáticamente cerrados)