Quick Sign In:  

Forum: VirtualDJ Skins

Topic: [VDJScript] For anyone using Rane 12 (Rane Twelve) single-deck controllers...
(...this may also apply to other single-deck controllers that physically rotate.)

The Problems:

1) By default, the software option keepPlayingPastEnd is set to "No". Because the Rane 12 is a
physically rotating object (and therefore subject to laws of physics), this creates a scenario where a track gets to the end, then it immediately returns to the beginning and stops. But -- the Rane 12 takes a moment to physically ramp down. If the music in the track you're playing happens to start within the first 0.5 seconds or so of the file, the first split second of the track, ramping down, will audibly replay right after the track ends.

2) Because of the aforementioned "Physical Object Ramp-Up/Down Time" issue: if you load a track in which the music happens to start within the first 0.5 seconds or so, you'll hear a very subtle pitch ramp-up when you start the track.

3) If keepPlayingPastEnd is set to "Yes" (in an attempt to address Problem 1), then the Rane 12 will keep spinning "forever" once the track is completed. After a certain amount of post-completion playback time (I'm not exactly sure of the amount, but it seems to be around 10 minutes), the Rane 12 "forgets" which deck it's assigned to and to keep using it, you have to reassign it using the "Deck Assign" buttons. Not a showstopper (all you have to do to fix it is select the Deck Assign button and hold it for a few seconds) but it definitely is a point of failure that detracts from a seamless performance.

***

The Solutions:

1) Set the option keepPlayingPastEnd to "Yes". (This solves one problem for us, but it does introduce Problem 3 mentioned above.)

2) Upon loading a track, employ a script that sets the start time to -0.5 seconds (half a second before the beginning of the file.) Script below. (Note: I am aware of the options motorWheelInstantPlay and motorWheelInstantStop and I am aware that keeping them set to "On" will solve this problem in another way. But, in doing so you lose a significant portion of the tactile feel, which is much of the point of using a full-sized motorized deck controller in the first place!)

3) Set the option keepPlayingPastEnd to "Yes", and employ a script that Pauses a track if it's more than 5 seconds past the end. Script Below.

***

The following script works when placed in "Mapping -> Keyboard (Custom Mapping) -> ONINIT":
repeat_start_instant 'CheckDeckStates' 190ms &
deck 1 param_equal `load_pulse` 0 ? deck 1 goto -500ms : nothing &
deck 1 songpos_remain -5000ms ? pause : nothing &
deck 2 param_equal `load_pulse` 0 ? deck 2 goto -500ms : nothing &
deck 2 songpos_remain -5000ms ? pause : nothing &
deck 3 param_equal `load_pulse` 0 ? deck 3 goto -500ms : nothing &
deck 3 songpos_remain -5000ms ? pause : nothing


What This Code is Doing:

1) The first line (the line with "repeat_start_instant" in it) is continuously running a script "CheckDeckStates" that executes every 190ms. If we place this code in the Keyboard's ONINIT event, this script will run continuously for as long as VirtualDJ is running.

2) The remaining lines are all near-identical but are repeated (3x) times, once for each deck. (To make this work for four decks, you could simply make a copy of the lines starting with "deck 3" and change them to read "deck 4".)

3) The first line of each set (the lines with "param_equal" in them) are continuously checking, every 190ms, for the "load_pulse" flag. Immediately when a new track gets loaded to a deck, "load_pulse" has a value of False for a duration of 200ms (and that's why we specified a repeat rate of 190ms in our first line.) When a "load_pulse" is detected for a given deck, we rewind the track from the beginning, to half a second before the beginning. This solves the "ramp up sound at beginning of track" issue.

4) The second line of each set (the lines with "songpos_remain" in them) are continuously checking, every 190ms, for a state in which the song is 5 seconds (or greater) past the end of the track (and this is why NEGATIVE -5000ms, as opposed to POSITIVE 5000ms, is specified). When this state is detected, the deck is paused.
 

geposted Tue 27 Dec 22 @ 1:12 am
Really useful info thanks. Rane 12 is one of my upgrade options.
 

geposted Thu 26 Jan 23 @ 12:57 am