Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Scratch bank button illuminating bug
If you have two samples from the same file in a scratch bank, when one is selected, both buttons light up.

I imagine it is returning the value of load?


load '/path/tune.mp3' & goto_cue 3


Whereas it needs to check the cue that's active too, ie:


load "/path/tune.mp3" && goto_cue 4 && param_equal "`get_cue`" 4

 

Posted Sun 04 Apr 21 @ 9:53 pm
they are same file so first part of the statement is true for both scripts (buttons)

I guess you want to check if its at cue position X or Y?
And I think goto_cue is executing too fast if you add it after load at well... (before song is loaded...)


down ? load '/path/file.mp3' : goto_cue 2 && param_equal "`song_pos`" "`cue_pos 2 & param_cast val`"

 

Posted Sun 04 Apr 21 @ 10:14 pm
Very sorry Rune I wasn't clear. The second script works fine, I'd made a pretend scratch bank before VDJ built the proper one, and that only highlights the active scratch sample button.

It is this built in VDJ scratch bank that erroneously highlights all buttons from the same file. They use the scratch_bank commands, but I'm guessing those commands are returning `load "file" & ...`, hence the bug, so I gave my code as a possible fix.
 

Posted Mon 05 Apr 21 @ 3:16 pm
I don't think we can patch it by appending the VDJScript, without hardcoding the cue number? Or can we get the cue number of the scratch bank sample?
 

Posted Mon 05 Apr 21 @ 4:17 pm
I'm not replying to bump this to the top - I've been working on my own version of scratch bank and thought I'd share it. I don't suppose we'd want this in VDJ as Serato doesn't do this and that's the model people expect. But figured I'd post to get any suggestions/comments, and to share in case anyone finds the code useful.

I don't like the Serato shift+any pad to return to the previous scratch - if you're scratching and mixing, your hands are busy, so I prefer to just hit the same button again.

Also, if I'm going to have a scratch, I'll get the next track beatmatched and cued first, then call up the scratch bank. This way if I get a bit too enthusiastic or lose track of time while scatching, I know I am all set to mix into the next track quickly. But scratch bank loses your position in the song, and if I adjust the pitch of the scratch sample, scratch bank also loses your matched pitch setting.

Finally, I'd rather have a few samples on a single button, to save switching pad pages so much. So I cycle through a few scratch samples, and then back to the prior track, on a single button.

The following cycles through a couple scratch samples then back to the prior track. It only lights the button of the cue selected rather than all samples in the file. And it restores the position and pitch of the track that was loaded before going into scratch sample. (The `pitch` call probably adds an offset to your DVS pitch, so I also added a `timecode_reset_pitch` to my load macro.)


load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" ? load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" & goto_cue 1 & timecode_active on : load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" ? get_var "%prevTrack" & load & get_var "%prevPos" & param_cast & song_pos & get_var "%prevPitch" & param_cast & pitch : set "%prevTrack" "`get_filepath`" & set "%prevPitch" "`pitch`" & set "%prevPos" "`song_pos`" & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" & goto_cue 3 & timecode_active on


I am experimenting with a 'phrasal scratch' button for simulating ultra-pitch scratch vinyl. This is where a scratch sample - typically a vocal phrase - is pressed to vinyl at 16RPM instead of the usual 33/45. This way a sample takes up less physical rotations on the record, so you can more quickly navigate to the different parts of it, bec ause you need to move the record less distance, (demonstrated here https://www.youtube.com/watch?v=K45qWcNuTrU ). This is working but no doubt has bugs..


load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" ? load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" & goto_cue 1 & timecode_active on : load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" ? get_var "%prevTrack" & load & get_var "%prevPos" & param_cast & song_pos & get_var "%prevPitch" & param_cast "percentage" & pitch & pitch_range 8% : set "%prevTrack" "`get_filepath`" & set "%prevPitch" "`get_pitch_value`" & set "%prevPos" "`song_pos`" & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" & goto_cue 3 & timecode_active on & & pitch_range 50% & pitch 200%
 

Posted Wed 07 Apr 21 @ 11:56 am
EDIT: Sorry ignore this, I can pause, then play.

OLD: I need to disable loadSecurity, as if a track is still playing (and play seems to be necessary for timecode), the warning button messes with the loading and state changes. I am trying `setting "loadSecurity" off` but it doesn't seem to work? Can load security be toggled in VDJScript?
 

Posted Wed 07 Apr 21 @ 12:46 pm
techtitch wrote :
I am trying `setting "loadSecurity" off` but it doesn't seem to work? Can load security be toggled in VDJScript?


Put off in quotation marks ... setting 'loadSecurity' "off" (or just setting 'loadSecurity' 0)
Alternatively just setting 'loadSecurity' to toggle between the 3 modes


 

Posted Wed 07 Apr 21 @ 12:50 pm
@Rune thanks so much and apologies, you're too quick - that was four minutes! Useful info though thanks, works perfectly, and better than pausing (as you want to play on timecode but not if not).
 

Posted Wed 07 Apr 21 @ 12:56 pm
This is the final code without ultra-pitch:


var "%scratch_sample" 1 ? blink & set "%scratch_sample" 2 & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" & goto_cue 1 & timecode_active on : var "%scratch_sample" 2 ? blink 500ms & set "%scratch_sample" 0 & get_var "%prevTrack" & load & get_var "%prevPos" & param_cast & song_pos & pitch_range 8% & get_var "%prevPitch" & param_cast & pitch & setting "loadSecurity" 1 : true & set "%scratch_sample" 1 & set "%prevTrack" "`get_filepath`" & set "%prevPitch" "`pitch`" & set "%prevPos" "`song_pos`" & setting "loadSecurity" 0 & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" & goto_cue 3 & timecode_active on


This one adds a +50% offset to the turntable pitch, so that you must set the pitch on the turntable itself to -34% for it to play at a normal pitch. This makes vocal phrase scratching (eg, DJ Rob Smith) much easier:


var "%ultra_scratch_sample" 1 ? blink 500ms & set "%ultra_scratch_sample" 2 & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/Peabird__Battle Scratches_Original Mix.mp3" & goto_cue 1 & timecode_active on : var "%ultra_scratch_sample" 2 ? blink 250ms & set "%ultra_scratch_sample" 0 & get_var "%prevTrack" & load & get_var "%prevPos" & param_cast & song_pos & pitch_range 8% & get_var "%prevPitch" & param_cast & pitch & setting "loadSecurity" 1 : true & set "%ultra_scratch_sample" 1 & set "%prevTrack" "`get_filepath`" & set "%prevPitch" "`pitch`" & set "%prevPos" "`song_pos`" & setting "loadSecurity" 0 & load "/Users/technicaltitch/Music/DJ/Scratch Matter/Scratch Pieces/6965738_Skip_Proof_Scratches_Original_Mix.mp3" & goto_cue 3 & timecode_active on & pitch_range 50% & pitch 200%


Obviously you'll have to add your own tunes and cues!

So with this code you can cycle through some scratch samples then hit the button again to return to your originally loaded track. It differs from scratchbank (Serato or VDJ) in that it also recovers pitch and position, and just requires repeatedly hitting the same single button (and the second obviously enables ultra-pitch). If anyone does like this, and wants to add more than two samples, just add another `var "%scratch_sample" 1 ?` clause - happy to help.

The buttons blink slowly on the first sample and quicker on the second. The ultra-pitch button blinks at double speed as a reminder to set the turntable pitch at -34% or get chipmunks!
 

Posted Wed 07 Apr 21 @ 1:38 pm
PS. Just realized VDJ scratchbank does seem to restore your position when reloading the prior loaded track. I got carried away..
 

Posted Wed 07 Apr 21 @ 9:31 pm