Accesso rapido:  

Forum: General Discussion

Topic: Help with "record" verb in scripting?

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

Hi everyone,

I'm writing my first ever script which plays the first {20} seconds of {15} songs and displays the {artist} and {title} in a videoskin {10} seconds after each song starts... typically a "guess the intro" or "music quiz" generated at random and on-the-fly by Virtual DJ.

I'd like to be able to record a quiz to an mp4 so that the games can be played when I visit friends who aren't DJs or who don't have Virtual DJ. I have tried using the verb 'record', but I'm not sure of its syntax. Does it toggle recording on/off (stop recording if already recording/start recording if not recording)?

The webpage "Verbs of VDJScript in VirtualDJ 8" says "record : start recording the session" but doesn't seem to mention stopping the recording :-(

Many thanks for reading this far,

Domino
 

Inviato Sun 08 Dec 19 @ 9:46 am
locodogPRO InfinityModeratorMember since 2013
record

will both start and stop recording
 

Inviato Sun 08 Dec 19 @ 9:56 am
Many thanks locodog, I'm getting unexpected results so I'll experiment a bit and if I have no further success, I'll be back :-)

(I already know you'll say "post your code" but it's such a shambles I'm embarrassed ;-) )

Domino
 

Inviato Sun 08 Dec 19 @ 10:29 am
record -> Toggles recording on/off
record on -> Forces to start the recording (if it's recording already it won't stop recording)
record off -> Forces to stop recording (if it's not recording it will not start a new recording)
 

Inviato Mon 09 Dec 19 @ 9:00 am
Hi guys,

Thanks for the help :-) Sadly I'm not much further forward. I have distilled my problem ares into this short snippet:


record on &
set 'r_flag' 0 &
deck 1 & automix on &
repeat_start 'r_test' 5000ms 1 &
repeat_stop 'r_test' &
record off &
set 'r_flag' 5000 &
automix off &
deck 1 & play_pause

'r_test' is the handle to the delay which defines the length of the recording; 'r_flag' is just a variable that I can use in 'var_list' to see which part of the script is processing if necessary. When run from a pad, it generates a tiny 2k mp4 file in the folder specified in VDJ options, but it cannot be played. The pad button illuminates very briefly.

I have set another pad with just 'record', so I can manually toggle start/stop recording while something is playing, and that records an appropriate mp4 in the expected folder.

I suspect I'm doing something very newbie :-(

Domino
 

Inviato Mon 09 Dec 19 @ 1:33 pm
Try:
deck 1 record on & deck 1 automix on & deck 1 repeat_start 'Rec5s' 5000ms 1 & deck 1 record off & deck 1 automix off & deck 1 pause

Notes:
1) Since you define how many executions you want on your repeat_start action, you don't need to stop it. It will stop automatically after execution
2) If your call the action from a pad on your controller you can remove all "deck 1" instances except the ones in front of automix.
3) On complex actions like this, the LED of the pad can't always follow what you want, and needs it's own action to function properly. In this particular example I would use "deck 1 record" for the LED
 

Inviato Mon 09 Dec 19 @ 1:47 pm
locodogPRO InfinityModeratorMember since 2013
I stripped it right back and there seems something wrong with record and rs's
record & deck 1 play & repeat_start 'r_test' 5000ms 1 & record

like perhaps the delay is ignored. and record is acted on instantly [x64]
 

Inviato Mon 09 Dec 19 @ 2:17 pm
locodogPRO InfinityModeratorMember since 2013
deck 1 automix on & deck 1 repeat_start_instant 'Rec5s' 5250ms 2 & cycle '$flipFlop' 2 & var '$flipFlop' 1 ? deck 1 record on : deck 1 record off & deck 1 automix off & deck 1 pause

Try that
 

Inviato Thu 12 Dec 19 @ 10:23 am
Thanks, your script starts playing, starts the recording, plays for 5250ms, stops playing _but_ continues recording :-(
 

Inviato Sat 14 Dec 19 @ 1:59 pm
Grok32Home userMember since 2019
I'm definitely in over my head but try this. On my system the recorded clip is sometimes corrupted but that may be something related to my hardware. Although the clip will play on other players it crashes VDJ.

down ? deck 1 record on & automix on : repeat_start 'Rec5s' 5000ms 1 & deck 1 record off & automix off & deck 1 pause
 

Inviato Sat 14 Dec 19 @ 3:11 pm
Hi Grok,

Your script works as I want, although I'm unsure why. Perhaps I shouldn't ask too many questions! The recorded clips all worked OK for me to the parameters chosen in Settings->Options->record* , so I don't think any corruption is due to your script.

Hopefully the experts will have more insight on how and why this works :-) In the meantime Grok you've given me a solution with which I can move forward :-)

Many thanks for everybody's input ;-)

Domino
 

Inviato Sat 14 Dec 19 @ 9:02 pm
Grok32Home userMember since 2019
Thanks for the feedback Domino. The corruption seemed to be from my system sound quality setting (192khz 24 bit). I lowered it to 96khz 16 bit and the problem seems to be fixed.
 

Inviato Sun 15 Dec 19 @ 1:01 am
Epilogue:

Atomix in their great kindness have released what I believe to be a fix for a fault with 'repeat_start' verbs in Virtual DJ 8 BUILD 5478 (2019-12-19):

"-Fix repeat_start executing key release immediately instead of after specified time"

I put my original, unaltered script back into that build and it worked as I wanted despite the crappy coding :-)

Thank you Atomix (and fellow forum-dwellers), I thought it a polite idea to finish this thread with an official solution for future searchers :-)

Domino
 

Inviato Mon 23 Dec 19 @ 12:02 pm


(Vecchi argomenti e forum sono automaticamente chiusi)