VDJPedia



 VDJScript Examples Database

Last edit by leneer, Moderator on Mon 09 Oct 17 @ 9:52 am

Back to VDJScript

VirtualDJ 8 Script Example - Database from Users




Feel free to add here any VDJ Script Examples that you feel they could be useful for others too.
Please add only the ones that you have verified.


Flow



Execute different action on click and different on double-click (for controllers)
var 'double' ? set 'double' 0 & repeat_stop 'myrep' & device_side 'left' ? deck left clone_deck right : deck right clone_deck left : set 'double' 1 & repeat_start 'myrep' 400ms 1 & load & set 'double' 0

The script uses a timer and waits for 400ms to see if a second click (push) comes.
If not it loads the track on deck, if Yes, it clones the deck to the opposite side.

Script added from Djdad


Automix



Automix doesn't 0 pitch onload (custom button)
var_equal "AMpWA" 0 ? off & set "AMpWA" 1 & repeat_start_instant "AMpitcher" 33ms & load_pulse ? repeat_start_instant "pitchRem" 1000ms 1 & pitch & param_cast & set "AMpitch" : get_var "AMpitch" & param_cast & pitch : blink & set "AMpWA" 0 & repeat_stop "AMpitcher"

Explained Here
Script added from Locodog


Browsing



Button or key to change the browser view settings quickly to show just karaoke , or simple music files (for controllers or keyboard)
Show karaoke
view_options "showkaraoke" on & view_options "showmusic" off & view_options "showvideo" off

Show music
view_options "showmusic" on & view_options "showkaraoke" off & view_options "showvideo" off

Can be easily adapted for video
Script added from bigron1


Browse tracks with jogwheel/touchwheel when deck is empty
Touchwheel (Jog)
loaded ? touchwheel : browser_window 'songs' & var $shift ? touchwheel_touch ? param_multiply 100 & browser_scroll : param_multiply 50 & browser_scroll : touchwheel_touch ? param_bigger 0.02 ? param_multiply 8 & browser_scroll : param_smaller -0.02 ? param_multiply 8 & browser_scroll : param_bigger 0 ? browser_scroll +1 : browser_scroll -1 : cycle $b 5 & var_equal $b 4 ? param_bigger 0 ? browser_scroll +1 : browser_scroll -1 : nothing
This script enables you to browse your tracks with your jogwheel when there is no track loaded on the wheel's deck.
It does NOT change your wheel_mode, it will only (but also always) browse, when the deck is completely empty.
The idea with param_bigger 0 ? browser_scroll +1 : browser_scroll -1 is not from me, but i can't find the original post. However this is a much more improved version, as it makes the unusable state of the wheel with an empty deck useful with a lot of tweaking to create a good browsing performance.
It uses not only the shift variable to speed up - it also changes speeds depending on whether you have pressed your touchwheel or not.
If you want to use the shift 'feature', you need to have
set $shift 1 while_pressed
somewhere on your shift key.

To customize this script and learn about it's structure, click this link for the document (because it's too long for this post): vdjscript Document
Script added from unlimited


Auto-Deck-Load System [ADL]
You can put this script on any button.
It will automaticly load the next track in your playlist onto the other deck and delete it from the list when the currently running track has less than 30 seconds left.
It's a mix of automix and manual mixing, so you can make the transitions yourself but have the tracks loaded automaticly for you.
If you put this on a button where you can't individually control the LED (e.g. custom buttons), you should set up another LED (or custom button) with this script:
var $ADL ? on : off
to know if the ADL-System is running or not, because the on-off script returns the wrong LED information!

set $ADL_left 0 & set $ADL_right 0 & var $ADL ? repeat_stop 'AutoDeckLoad' & set $ADL 0 : repeat_start_instant 'AutoDeckLoad' 500ms & set $ADL 1 & deck left select ? & deck left songpos_remain 30000ms ? var_equal $ADL_right 0 ? deck right playlist_load_and_remove & set $ADL_right 1 & set $ADL_left 0 & deck right select : nothing : nothing : deck right select ? deck right songpos_remain 30000ms ? var_equal $ADL_left 0 ? deck left playlist_load_and_remove & deck left select & set $ADL_right 0 & set $ADL_left

Script added from unlimited


Load or Clone
(One Button per deck)
action_deck 1 ? param_equal '`deck 2 get_filepath`' '`get_browsed_filepath`' ? deck 2 clone_deck 1 : deck 1 load : param_equal '`deck 1 get_filepath`' '`get_browsed_filepath`' ? deck 1 clone_deck 2 : deck 1 load

(One Button for all decks, follows master)
deck 1 masterdeck ? param_equal '`deck 1 get_filepath`' '`get_browsed_filepath`' ? deck 1 clone_deck 2 : deck 2 load : param_equal '`deck 2 get_filepath`' '`get_browsed_filepath`' ? deck 2 clone_deck 1 : deck 1 load

Script added from Locodog


Skipping through browser windows back and forth
(for controller and keyboard)
For changing browser windows by using two buttons/keys (Right/Left). This makes it possible to change directions in any browser window:
Right:
browser_window 'folders' ? browser_window 'songs' : browser_window 'songs' ? browser_window 'sidelist' : browser_window 'sidelist' ? browser_window 'sideview' : browser_window 'folders'

Left:
browser_window 'folders' ? browser_window 'sidelist' : browser_window 'sideview' ? browser_window 'sideview' : browser_window 'sidelist' ? browser_window 'songs' : browser_window 'folders'

Script added from zehkah


Crossfader



Change crossfader curve between smooth and scratch with single button or key
crossfader_curve smooth ? crossfader_curve scratch : crossfader_curve smooth

This was requested by a user on the facebook page.
It checks to see if the current mode of crossfader_curve is smooth.
If true, it sets crossfader_curve to scratch, otherwise it sets it to smooth.
Script added from a1kryten


FX



Switch between pre and post fx (Custom Button)
setting "fxProcessing" "Post-fader" ? on & setting "fxProcessing" : off & setting "fxProcessing"

Script added from Locodog


Drop gain & turn flanger On, Reset gain & turn flanger OFF (Button)
effect_active 'flanger' ? effect_active 'flanger' & get_var "resetGain" & param_cast & gain : set "resetGain" '`gain' & effect_active 'flanger' & gain -15%

This script keeps the output level at a similar level when using a FX that can increase the level.
This bit saves the current gain as a variable.
set "resetGain" '`gain'

This bit gets the variable and uses it to set the gain.
get_var "resetGain" & param_cast & gain

Script added from Locodog


Halve the pitch, double the pitch (Button)
toggle "1/2pitch" & var "1/2pitch" ? pitch & param_multiply 50% & pitch : pitch & param_multiply 200% & pitch

Script added from Locodog


Combined dial with different scales, with correct centring dial
user wanted to have 1 dial control both eq_low & eq_mid at once but also wanted mid to be 1/2 as sensitive and also wanted the eqs centred when the dial was centred
deck 1 eq_low & deck 1 eq_mid & param_multiply 0.5 & param_add 0.25 & deck 1 eq_high

multiplies the calling slider by 0.5, but then to have eq high centred when the dial is centred add 0.25
maths for other scales to be centred

(constant 1 - scaling factor ) / 2 = correction
multiply by your scale, and add the correction
.Script added from Locodog


Echo Out (Button)
effect_button "loop out" 1 1 & effect_button "loop out" 2 1 & effect_slider "loop out" 1 50% & effect_slider "loop out" 2 24% & effect_slider "echo" 1 50% & effect_slider "echo" 2 50% & effect_active "loop out" 1 & effect_active "echo" 1 & repeat_start_instant "rsiLoopOutOff" 33ms & effect_active "loop out" ? nothing : repeat_stop "rsiLoopOutOff" & repeat_start "rsEchoOff" 2000ms 1 effect_active "echo" 0

This script replicates the V7 "echo out" effect by using 2 V8 effects in a chain.
Script added from Locodog


Slipped Backspin with gain correction (Button)
set 'rsGainBS' '`gain' & gain -20% & slip on & effect_active 'backspin' & repeat_start_instant 'rsiBackSpin' 10ms & effect_active 'backspin' 1 ? nothing : repeat_stop 'rsiBackSpin' & play & slip off & get_var 'rsGainBS' & param_cast & gain

This script is a single button press, the current gain is saved, the gain is dropped, backspin FX is initiated, a repeat_start script continually checks the FX, when the FX is finished the gain is put back to normal and the track continues from the point where it would have been if the backspin never happened.
Script added from Locodog


Slipped Brake (Button)
slip on & effect_active 'brakeStart' & repeat_start_instant 'rsibrakeStart' 10ms & effect_active 'brakeStart' 1 ? nothing : repeat_stop 'rsibrakeStart' & play & slip off

Similar to the slipped backspin script but there's no need for gain correction. Single press.
Script added from Locodog


Trap style, slipped pitched loop (button)
[Pro users can dl the keyLoop audio fx]
slip on & loop 0.5 & repeat 235ms & down ? key 0 ? key -1 : key -1 ? key -2 : key -2 ? key -3 : key -4 : loop 0 & key 0 & slip off

Press and hold to activate, the repeat time is optimised for 128 bpm @ 1/2 loop, for other bpms, (60,000 * loop length) / Bpm =ms
Script added from Locodog

Load 5 effects on each deck (Button)
deck 1 level 75% & deck 1 effect_select 1 'EQ 10 Bands' & deck 1 effect_active 1 'EQ 10 Bands' on & deck 1 effect_button 'EQ 10 Bands' 1 & deck 1 effect_slider 'echo' 1 0 & deck 1 effect_select 5 'flanger' & deck 1 filter 0.5 & deck 1 effect_select 2 'Djos Special Flanger' & deck 1 effect_select 3 'Echo' & deck 1 effect_active 3 'Echo' on & deck 1 effect_select 4 'Loop Roll' & deck 1 effect_show_gui 1 on & deck 1 effect_show_gui 2 on & deck 1 effect_show_gui 3 on & deck 1 effect_show_gui 4 on & deck 1 effect_show_gui 5 on & deck 2 level 75% & deck 2 effect_select 1 'EQ 10 Bands' & deck 2 effect_active 1 'EQ 10 Bands' on & deck 2 effect_button 'EQ 10 Bands' 1 & deck 2 effect_slider 'echo' 1 0 & deck 2 effect_select 5 'flanger' & deck 2 filter 0.5 & deck 2 effect_select 2 'Djos Special Flanger' & deck 2 effect_select 3 'Echo' & deck 2 effect_active 3 'Echo' on & deck 2 effect_select 4 'Loop Roll' & deck 2 effect_show_gui 1 on & deck 2 effect_show_gui 2 on & deck 2 effect_show_gui 3 on & deck 2 effect_show_gui 4 on & deck 2 effect_show_gui 5 on & deck 3 level 0% & deck 4 level 0% &

Script added from DJDAD & JimmyL-DJ

Key



Key change (dial)
param_add -0.5 & param_multiply 2 & key_move

param_add -0.5 & param_multiply 2 & key_smooth

Two scripts for key change on a dial,
"move" changes the key by multiples of 1 semitone [whole notes][-12, -3, +5 etc]
"smooth" changes the key by partial semitones [part notes[-11.06, -3.9, +5.2 etc]
Script added from Locodog


Key Smooth (from -1 to +1) (dial)
param_multiply 0.16 & param_add 0.44 & key_smooth

Script added from Locodog


Loop



Auto Half Loop (button)
loop 2 & down ? blink 300ms & repeat_start "rsAHL" 33ms & loop 2 ? loop_position & param_bigger 90% ? set "top" 1 : var "top" 1 ? loop 1 & set "top" 0 : nothing : loop 1 ? loop_position & param_bigger 90% ? set "top" 1 : var "top" 1 ? loop 0.5 & set "top" 0 : nothing : nothing : loop 0 & repeat_stop "rsAHL"

Hold button, once it has completed a 2 beat loop it will halve to a 1 beat loop, once that completes it will halve to a 1/2 beat loop and stay like that till the button is released
Script added from Locodog


Microphone



2 Dial Mic Ducking (2 Dials 1 Button)
Dial 1 sets the ducked level (1%-99%) Dial 2 sets the rate which it ducks (100% between (<0.5s - 7.5s)
Pretty lengthy, here's a Link to the original page.
Script added from Locodog


Sampler



Control the master volume of the sampler using a knob (for controllers)
sampler_volume_master

Note: You can control the volume using two button, or keys, one for up, the other for down.
Script added from bigron1


Stop all the samples playing (for controllers or keyboard)
sampler all stop

Script added from bigron1


Use a button to play a specific named sample (for controllers)
Button
sampler_bank X & sampler_play_stop Y

Button LED
sampler_play Y on

where X= the bank number or name.
and Y=the sample number or name.
Note: If you're on a different sample page the normal slot volume control won't work, and hence you need to provide a master sampler volume control. Two buttons (one up, the other down), or one knob will do the trick.
Script added from bigron1


Toggle between the master, and headphone sampler outputs (for controllers)
It also lights a LED when the headphone output is selected
Button
deck master sampler_output ? sampler output "headphones" : deck master sampler_output

Button LED
sampler output "headphones" on

Script added from bigron1


Assign a button to mute the sampler output, and light its LED (for controllers)
Button
sampler_volume_master 100% ? sampler_volume_master 0% : sampler_volume_master 100%

Button LED
sampler_volume_master 0% on

Script added from bigron1


Sweeping Actions

FADE Script
I want to put this script here that locodog helped me for FADER use.
The Fade plugin from v7 no longer works on V8 and V8 does not have one, this is a script that you can assign to a button to do just that.
repeat_start_instant 'levelSweep' 10ms 101 & level & param_smaller 1% ? stop & level 100% & repeat_stop 'levelSweep' : level -1%

Here is a modified version of the script (if you getting a bump/hump/click noise etc..) use this change/modified version.

repeat_start_instant 'levelSweep' 10ms 101 & level & param_smaller 1% ? stop & repeat_stop 'levelSweep' & stop & repeat_start "WaitTimer" 100ms 1 & level 100% : level -1% : nothing

script added by The.Magic.DJ


Auto XF more like V7 (Button)
ONINT (add to the very end of your ONINT)
crossfader 0% & set "$XFside" 1 & repeat_start "rsXFcheck" 2000ms & crossfader 0% ? set "$XFside" 1 : crossfader 100% ? set "$XFside" 2 : nothing

Button
cycle "$AutoXF" 2 & var_equal "$AutoXF" 1 ? var_equal "$XFside" 1 ? deck master repeat_start_instant "rsiXF" 10ms 101 & crossfader +1% & crossfader 100% ? deck master repeat_stop "rsiXF" & set "$XFside" 2 & set "$AutoXF" 0 : nothing : var_equal "$XFside" 2 ? deck master repeat_start_instant "rsiXF" 10ms 101 & crossfader -1% & crossfader 0% ? deck master repeat_stop "rsiXF" & set "$XFside" 1 & set "$AutoXF" 0 : nothing : nothing : deck master repeat_stop "rsiXF"

This script is a 2 parter, ONINT monitors the XF position every 2 seconds, if the XF was last @ 0% the button press will send the XF from left to right, if the XF was last @ 100% the button press will send the XF right to left.
Pressing the button during action will stop the action.
Script added from Locodog


Video



Set the LEFT and RIGHT video on DDJ-SZ per channel FX Selectors
with this script you can change the 1 and 2 buttons that are located on the top of each channel to act as a video selector.
This is useful when you have more than 2 videos playing, or want to HIDE the video without change the video level or change the volume levels.

to start, put this code in the ONINT (at the beginning): (optional)
deck 1 leftvideo & set '$lv' 1 & deck 2 rightvideo & set '$rv' 2 &

this will make the buttons light on and set the channels 1 and 2 as the default channels for left and right videos

Now, put the following code on the FX1_ASSIGN key into the mapper:
action_deck 1 ? var_equal '$lv' 1 ? on & leftvideo auto & set '$lv' 0 : off & deck 1 leftvideo & set '$lv' 1 : action_deck 2 ? var_equal '$lv' 2 ? on & leftvideo auto & set '$lv' 0 : off & deck 2 leftvideo & set '$lv' 2 : action_deck 3 ? var_equal '$lv' 3 ? on & leftvideo auto & set '$lv' 0 : off & deck 3 leftvideo & set '$lv' 3 : action_deck 4 ? var_equal '$lv' 4 ? on & leftvideo auto & set '$lv' 0 : off & deck 4 leftvideo & set '$lv' 4 : on & set '$lv' 0

This will make all the buttons marked with the number 1 as the LEFT VIDEO selectors. so if you wanna set the deck 3 as the LEFT VIDEO, you press the button on channel 3 marked with number 1 (at the top of the channel)

Now, put the following code on the FX2_ASSIGN Key into the mapper
action_deck 1 ? var_equal '$rv' 1 ? on & rightvideo auto & set '$rv' 0 : off & deck 1 rightvideo & set '$rv' 1 : action_deck 2 ? var_equal '$rv' 2 ? on & rightvideo auto & set '$rv' 0 : off & deck 2 rightvideo & set '$rv' 2 : action_deck 3 ? var_equal '$rv' 3 ? on & rightvideo auto & set '$rv' 0 : off & deck 3 rightvideo & set '$rv' 3 : action_deck 4 ? var_equal '$rv' 4 ? on & rightvideo auto & set '$rv' 0 : off & deck 4 rightvideo & set '$rv' 4 : on & set '$rv' 0

This will make all the buttons marked with the number 2 as the RIGHT VIDEO selectors. so if you wanna set the deck 1 as the RIGHT VIDEO, you press the button on channel 1 marked with number 2 (at the top of the channel)
Script added from Brunoliv


Wave



Switch between the default wave & scratch wave (Button)
skin_panel "horizontal_scratch_active" ? skin_panel "defaultwave" : skin_panel "horizontal_scratch_active"

Script added from Locodog


Zoom in or out of the wave (Button)
zoom "default" ? zoom 75% & zoom_scratch 75% : zoom "default" & zoom_scratch "default"

Zoom in or out with one button.
Script added from Locodog


Key and Loop control

I use this with my Hercules MK4

Use the Shift Button (hold down) to add extra functions to buttons.

VDJ7 (SHIFT)
VDJ8 (HWSHIFT)
set 'shift' 1 while_pressed


Change the Key with the Pitch Knob while Shift is pressed

VDJ7/8 (PITCH)
var_equal 'shift' 1 ? param_multiply 1 & key_move : param_multiply 0.25% & pitch


Move the Loop 1 beat +/- with with the TRACK buttons while Shift is pressed

VDJ7/8 (TRACK- / TRACK +)

var_equal 'shift' 1 ? loop_move -1 : seek -4
var_equal 'shift' 1 ? loop_move +1 : seek +4


Only if you want:
Let the SOURCE button LED blink when SHIFT ist held down
VDJ7/8 (LED_SOURCE)
var_equl 'shift' 1 ? blink 500ms : off

Script added from megaalf


Navigation :

Back to VDJScript FAQ Wiki HOME