Entra:     


Forum: VirtualDJ Technical Support

Topic: Number of bars and beats to the next cue point from loop_in_sec and cue_countdown - Page: 1
Hi Everyone,

I am interested in doing a script to know where it is good for me to release my loop knowing that it will match (or bars difference) to the next cue point (drop or break) set on my other track playing.
Is this something already been done ? Can't find script like this ? A plugin ?

Thanks for your help
 

Inviato Sat 27 Jun 26 @ 2:05 pm
Is it mandatory to "stop the time" with variables for loop_in_sec and cue_countdown calculation or am i missing something ? In that case it will be needed to set that up on all loop functions... I can't see no loop_in_sec to next cue_pos. Does "next" cue_point is possible or does it needs a number ?
thx
 

I got it, in case someone interested :
if a loop is activated, get the start point of that loop and calculate how far it is from the next cue point, so that can be matched on the next cue point of another deck (with that same code and skin placed on another deck with deckn="2").

Make/set a button with that code that will set the beginning of the loop as a reference, (will need to be implemented on the loop functions if ok) :

(loop &) param_add `cue_countdown` `get_beatpos` & param_cast 'float' & set '$cue_pos_beats' &
get_loop_in_time 1.0 & param_cast 'float' & set '$loop_in_sec' &
get_bpm & param_cast 'float' & set '$bpm_at_capture'

Make a second button, or add to oninit :

deck all repeat_start 'phr' 200ms -1 & deck all loop ?
param_multiply `get_var 'loop_in_sec'` `get_var 'bpm_at_capture'` &
param_multiply 0.0166666 &
param_cast 'float' &
set '_step1' &
get_var '_step1' & param_multiply -1 & param_cast 'float' & set '_step2' &
param_add `get_var 'cue_pos_beats'` `get_var '_step2'` & param_cast 'integer' & set 'bt_total' &
get_var 'bt_total' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'phr' &
get_var 'bt_total' & param_mod 16 & set 'bt_in_phr' :
cue_countdown & param_cast 'integer' & set 'bt_total' &
get_var 'bt_total' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'phr' &
get_var 'bt_total' & param_mod 16 & set 'bt_in_phr'

And make it appear on screens skin.xml

<define class="beatscue" placeholders="deckn">
<off color="black" shape="square" border="bordercolor" border_size="2" />
<deck deck="[DECKN]">
<textzone>
<pos x="+20" y="25"/>
<size width="60" height="20"/>
<text fontsize="14" color="red" align="left" action="get_var 'phr'"/>
</textzone>
<textzone>
<pos x="+20+40" y="25"/>
<size width="60" height="20"/>
<text fontsize="14" color="red" align="left" action="get_var 'bt_in_phr'"/>
</textzone>
<textzone>
<pos x="+20+40+40" y="25"/>
<size width="60" height="20"/>
<text fontsize="14" color="red" align="left" action="get_var 'bt_total'"/>
</textzone>
</deck>

</define>

and

<panel class="beatscue" visibility="loaded" deckn="1" x=+XX" y="+XX"/>

Hope you'll enjoy !
I'll be looking to be able to cue sync POI1 deck1 to POI3 (for example) of deck2 while playing if possible
 

Again, no need for persistent variable here.
 

Just an issue when setting a loop on an already set cue. Any suggestions ?
Goto+1 then wait and -1 or set an offset ?
Thx
 

Issue with version of the code above :
Here is the good one :
Loop or Button 1
loop & param_add `cue_countdown` `get_beatpos` & param_cast 'float' & set 'myVarcue_pos_beats' &
get_loop_in_time 1.0 & param_cast 'float' & set 'myVarloop_in_sec' &
get_bpm & param_cast 'float' & set 'myVarbpm_at_capture'

Button 2
repeat_start 'phr' 200ms -1 & deck all loop ?
param_multiply `get_var 'myVarloop_in_sec'` `get_var 'myVarbpm_at_capture'` &
param_multiply 0.0166666 &
param_cast 'float' &
set 'myVar_step1' &
get_var 'myVar_step1' & param_multiply -1 & param_cast 'float' & set 'myVar_step2' &
param_add `get_var 'myVarcue_pos_beats'` `get_var 'myVar_step2'` & param_cast 'integer' & set 'myVarbt_total' &
get_var 'myVarbt_total' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'myVarphr' &
get_var 'myVarbt_total' & param_mod 16 & set 'myVarbt_in_phr' :
cue_countdown & param_cast 'integer' & set 'myVarbt_total' &
get_var 'myVarbt_total' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'myVarphr' &
get_var 'myVarbt_total' & param_mod 16 & set 'myVarbt_in_phr'
 

still no need for persistent variable here.
leave @ name variables for long term important stuff not trivial throw away data.
 

It’s built into vdj. Go to your cue points and have the buttons display beats, seconds etc it shows how many beats or seconds to that specific cue point
 

Thank you Dave, prefer not using computer screen.
 

Where are you going to see the information then? Earlier you posted some code that displays information on the skin - but you don't want to use the screen?
 

Thank you for asking Grooveinabox. Can be adapted on any controller screen if it is relevant.
 

What i want to accomplish next is having the difference in beats from the deck A (playing) distance to POI 2 and show in deck B the amount of beats where i should start the track so POI 2 A and POI 2 B will be synced.
Like :
Deck A
Current position : get_beatpos(A) (ex. 60 beats)
POI 2 position : cue_pos 2 beats(A) (ex. 96 beats)
Distance to POI 2 : X_A = 96 - 60 = 36 beats remaining
Deck B
POI 2 position : cue_pos 2 beats(B) (ex. 32 beats)
Distance from start track to POI 2 : X_B = 32 beats

And show on deck 2 Wait: XX beats or X phr Y bt

Like :
Wait = X_A - X_B
= (cue_pos_2_A - get_beatpos_A) - (cue_pos_2_B - 0)
= cue_pos_2_A - get_beatpos_A - cue_pos_2_B

Almost same thing that Automix is doing under the hood
 

 

Hi Guys,
Is it possible to get something else than 0 when on a cue and using cue_countdown ? +1, next, forward not working
Really need to do : goto +1 beats & param_add `cue_countdown` `get_beatpos` & param_cast 'float' & set 'myVarcue_pos_beats' & goto -1 beats ?
thx
 

cue_countdown 0 ? cue_select +1 & cue_countup seems to work best, any advice ?
 

Here is my shot with some enhancement to do regarding shorter length of POI distance on slave deck for the rest seems working. Only for 2 decks.
Variable changed names with the previous code so you need to adjust Skin.
Make info_sync_btTotal (not mandatory) & $info_sync_attBeats appear for each deck.
info_sync_btTotal : almost cue_countdown with mod for loop & $info_sync_attBeats : when it's at 0 play the slave, both decks will have their next POI synced, at minus wait next cue on master.
Only one button for this one.
Don't hesitate to test and feedback.

Stop button : repeat_stop 'main'

Main button :
deck all repeat_start 'main' 200ms -1 & ( deck all loop ? ( get_loop_in_time & param_cast 'integer' & set 'info_sync_loopInCur' & var_equal 'info_sync_loopInCur' 'info_sync_loopInPrev' ? ( param_multiply `get_var 'info_sync_loopInSec'` `get_var 'info_sync_bpm'` & param_multiply 0.0166666 & param_cast 'float' & set 'info_sync_step1' & get_var 'info_sync_step1' & param_multiply -1 & param_cast 'float' & set 'info_sync_step2' & param_add `get_var 'info_sync_cuePos'` `get_var 'info_sync_step2'` & param_cast 'integer' & set 'info_sync_btTotal' & get_var 'info_sync_btTotal' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'info_sync_phr' & get_var 'info_sync_btTotal' & param_mod 16 & set 'info_sync_btInPhr' ) : ( cue_countdown & param_equal 0 ? ( cue_select +1 & cue_countup & param_cast 'float' & set 'info_sync_btTotal' & cue_select -1 & get_var 'info_sync_loopInCur' & set 'info_sync_loopInPrev' & get_var 'info_sync_btTotal' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'info_sync_phr' & get_var 'info_sync_btTotal' & param_mod 16 & set 'info_sync_btInPhr' ) : ( param_add `cue_countdown` `get_beatpos` & param_cast 'float' & set 'info_sync_cuePos' & get_loop_in_time 1.0 & param_cast 'float' & set 'info_sync_loopInSec' & get_bpm & param_cast 'float' & set 'info_sync_bpm' & get_var 'info_sync_loopInCur' & set 'info_sync_loopInPrev' & param_multiply `get_var 'info_sync_loopInSec'` `get_var 'info_sync_bpm'` & param_multiply 0.0166666 & param_cast 'float' & set 'info_sync_step1' & get_var 'info_sync_step1' & param_multiply -1 & param_cast 'float' & set 'info_sync_step2' & param_add `get_var 'info_sync_cuePos'` `get_var 'info_sync_step2'` & param_cast 'integer' & set 'info_sync_btTotal' & get_var 'info_sync_btTotal' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'info_sync_phr' & get_var 'info_sync_btTotal' & param_mod 16 & set 'info_sync_btInPhr' ) ) ) : ( set 'info_sync_loopInPrev' 0 & cue_countdown & param_cast 'integer' & set 'info_sync_btTotal' & get_var 'info_sync_btTotal' & param_multiply 0.0625 & param_cast 'int_trunc' & set 'info_sync_phr' & get_var 'info_sync_btTotal' & param_mod 16 & set 'info_sync_btInPhr' ) ) & get_activedeck & param_cast 'integer' & set '$info_sync_masterDeck' & var_equal '$info_sync_masterDeck' 1 ? ( deck 1 get_var 'info_sync_btTotal' & param_cast 'float' & set '$info_sync_masterBt' & deck 2 get_var 'info_sync_btTotal' & param_multiply -1 & param_cast 'float' & set '$info_sync_negSlave' & param_add `get_var '$info_sync_masterBt'` `get_var '$info_sync_negSlave'` & param_cast 'integer' & set '$info_sync_attBeats' & get_var '$info_sync_attBeats' & param_multiply 0.0625 & param_cast 'int_trunc' & set '$info_sync_attPhr' & get_var '$info_sync_attBeats' & param_mod 16 & set '$info_sync_attBt' ) : ( deck 2 get_var 'info_sync_btTotal' & param_cast 'float' & set '$info_sync_masterBt' & deck 1 get_var 'info_sync_btTotal' & param_multiply -1 & param_cast 'float' & set '$info_sync_negSlave' & param_add `get_var '$info_sync_masterBt'` `get_var '$info_sync_negSlave'` & param_cast 'integer' & set '$info_sync_attBeats' & get_var '$info_sync_attBeats' & param_multiply 0.0625 & param_cast 'int_trunc' & set '$info_sync_attPhr' & get_var '$info_sync_attBeats' & param_mod 16 & set '$info_sync_attBt' )

 

For info :
Prerequisites:
autosortcues
at least 1Cue placed on each deck (master=first played and playing and volume level greater than slave (when playing))
If master = deck 3 ou 4 fallback to deck 2 (for now)
 

cue_countdown & param_equal 0 ? cue_select +1 & cue_countup & param_cast 'float' & debug

Is not a thing beacause cue_countup is refering to playhead so if a (not playing) loop or playhead is on a cue, numbers won't be correct. They will be as the playhead moves

Any help to get the amount of beats from a cue point to the next one (if playhead is on it and without numbering the next cue) ?

thx
 

Where do you want this info to appear? As you said you don’t want to look at the screen, is it in your controller? Or tablet with vdj remote, as I promise you the pad button display is the answer, just apply it to the visual aid you are using. It shows you where the play head is on each cues relation on how many beats seconds etc. you can pretty much chaos and change script to make what you want shown.
 

Also use auto mix to line up, so it’s already where you want and will play so the parts are synced. It’s the best way, you can pretty much leave fader in center as both tracks have same agenda. If that’s what you want, so the breaks not just the phase are linedup
 

91%