Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Shift function
I'm trying to map a button to use the shift script action, but whenever I do this and press it the original shift button becomes stuck on and VirtualDJ registers that I am pushing SHIFT_[KEY] and even after I've released it the original non-shift key stays on. I've searched high and low and all I can find are people saying to set a variable called 'shift' and then add a check to buttons if that variable returns true to determine whether it performs the shift action or not. I've noticed that VirtualDJ does respond directly to the script action shift better than if I were to use a variable (e.g. pad pages). Also I think the organization of the mapping would be overall cleaner having a shift_key mapping rather than an extra "var 'shift' ? [whatever] : " on every button that I want a shift function on.

Ultimately what I want to do is use my 8 hot cue buttons on my Behringer CMD Studio 4A as pad pages and have the delete button next to them act as a shift using the actual shift action for those pads as a while_pressed function, but I can't figure this one out.
 

Posted Fri 01 Mar 24 @ 4:37 am
locoDogPRO InfinityModeratorMember since 2013
did you try
shift while_pressed
 

Posted Fri 01 Mar 24 @ 5:40 am
Hey mate. Thanks! Unfortunately I did. The issue is that as soon as shift is activated the key suddenly becomes a "shift_whatever" key and so the button that I originally pushed in is no longer that same button, but is suddenly shift_that_button and so VDJ sees that the original button is still pushed in because that was its last state before it became a shift_whatever button.

To be honest, I gave up shortly thereafter and found that there really isn't the detriment I thought there was with using a variable after I got through it a bit, but I am still curious as to the use case for the action shift as it would seem this action always breaks the button it is used on. I don't get it.
 

Posted Fri 01 Mar 24 @ 7:37 am
You're trying this on a controller ?

Some remarks:

1) Shift should work at any button if mapped simply as shift and 99999 times out of 100000 it should not get stuck. Read further down for the 1 on 100000 exception.

2) Some controller have hardware SHIFT layers and others don't.
When a controller doesn't have a hardware SHIFT layer, VirtualDJ will automatically add SHIFT_ +KEY on mappers in order to ease mapping (instead of writing shift ? this : that you now having KEY=that and SHIFT_KEY=this)
When a controller has a hardware SHIFT layer (like all Pioneer ones) then VirtualDJ does not create its own SHIFT buttons, but relies on the defined SHIFT_ buttons
For controllers with a hardware SHIFT layer, currently there's no way to "force" the SHIFTed layer to become active by any other means other than using their dedicated SHIFT button. In other words it's not possible to replace their own SHIFT button with another one via code/script and keep the SHIFTed layer functionality

3) When shift is defined as an action of a controller button, it inherits the state of the button.
So, for most buttons this means that shift will remain active while the button is pressed.
However if that button is a toggle button (1st press sends down, second press sends up) then shift will become a toggle button as well.
That's the 1 in 100000 cases where shift action can get stuck.
On most controllers I have come across, typically (but not always) toggle buttons will only be the COLOR FX SELECT buttons, and the PFL/CUE buttons.
So, those buttons cannot be used properly for a shift function.

Now regarding the Behringer CMD Studio 4A:
It's a device without its own hardware SHIFT layer.
This means 2 things:
1) You should be able to use ANY button as SHIFT.
Assuming that you want to use the HOT_CUE_DEL button as shift, it should pretty much work out of the box.
While it's true that while HOT_CUE_DEL is pressed all the buttons will get a SHIFT_ on the mapper to help with mapping, this should not prevent the button to work as intended.
2) The SHIFTed buttons should work even if shift is engaged from another controller or the keyboard
 

Posted Fri 01 Mar 24 @ 9:09 am
Well unfortunately I can assure you that this is not my experience. I can upload a video of this eventually, but I am currently in the middle of my work week and the latest I will be able to revisit this would be Tuesday when I am on my weekend again. If I remember, I will test this with another MIDI controller to see what happens.

I do experience some of the behavior you describe where VDJ adds a shift button to the available keys, but again, what it does instantaneously is at a shift_"shift" button and so the key I originally assigned as shift is no longer usable as all buttons have become shifted.
 

Posted Fri 01 Mar 24 @ 6:22 pm
VirtualDJ "knows" how to treat "SHIFT_SHIFT"
As soon as it's not a hardware SHIFT (where in hardware layers SHIFT_SHIFT doesn't even exist) the program knows to ignored "double shift" when the key action is shift.
Since the controller in question is quite old and not popular, I wonder if the HOT_CUE_DEL button is "gate" as it's defined, or "toggle" and none noticed.

Do me a favor: map the HOT_CUE_DEL button as
down ? set 'testvar' 1 : set 'testvar' 0
Then map a custom button on skin as get_var 'testvar' and name the button (it's important) as query
Now press the HOT_CUE_DEL button and observe the sustom button.
It should always say 0 and switch to 1 only while the button is pressed.
Does the button behaves like this ?
 

Posted Fri 01 Mar 24 @ 6:59 pm
Sure. I will do this and report back as soon as I can get to this If needed, but assuming I understand your script request, I can confirm that it functions as as a gate with it currently being mapped to a shift variable "while_pressed" functions as one would expect and is further confirmed by me defining the LED to be on if the shift variable is true, which it does turn on while it is pressed and off again when released, which behaves as expected here, too.
 

Posted Fri 01 Mar 24 @ 9:23 pm
Scripted and tested as you requested. DEL_HOT_CUE lights up blue with a 1 when pressed down and goes gray and displays a 0 when released.

Yet when I add shift to the DEL_HOT_CUE button script and I press and release the button it registers HOT_CUE_DEL as still being on and SHIFT_HOT_CUE_DEL as off (see the attached image).



Note: I just added shift to my existing script because I was being lazy when I tested this again. :-D
 

Posted Tue 05 Mar 24 @ 9:16 am
AdionPRO InfinityCTOMember since 2006
Some things to confirm:
-Make sure that SHIFT_HOT_CUE_DEL is not assigned to anything
-Note that SHIFT_HOT_CUE_DEL showing up on release of the button in the controller config is only a visual issue. It should not interfere with the actual functioning of the release of the shift button (as long as nothing is assigned to SHIFT_HOT_CUE_DEL)
-Can you confirm that this also causes some problems with the functioning (so other buttons that you press also show SHIFT_button, even when you released HOT_CUE_DEL)
 

Posted Tue 05 Mar 24 @ 11:07 am
Ha! Okay, perhaps it was an oversight this whole time on my part. Maybe I was just thrown off by the observed behavior in the map activity list because you are correct Adion, it does function normally. Perhaps what threw me off was while I was attempting to map the LED to respond to if shift was active or not and seeing the LED get stuck since the software knows to ignore shift_shift, but the light doesn't turn off as I am guessing the logic doesn't necessarily know this. Out of curiosity then, would one map the LED to respond to if shift_shift (the button that immediately becomes shift_button) is pressed or not to get away from needing a variable to check?
 

Posted Wed 06 Mar 24 @ 12:14 am
AdionPRO InfinityCTOMember since 2006
I think the led should work fine just mapped as shift.
Perhaps there's already some custom mapping for the led in LED_HOT_CUE_DEL ?
 

Posted Wed 06 Mar 24 @ 6:29 am
I appreciate the continued responses, but I'm fine with what I have for now. Thanks to all for your support!
 

Posted Thu 07 Mar 24 @ 3:31 am
Hello everyone! I created my own mapper for an American Audio DP-2 controller years ago with Virtual DJ version 7 and it worked flawlessly. But since I updated to newer versions including the latest one, every time I press the "Shift" button in the controller everything gets messed up and not only doesn't it perform the "while_pressed" functions, but the whole mapped actions on the controller strangely change. I suppose there is new script I am missing here for the "Shift" functions. I would really appreciate any help or suggestions dear friends.

Here's my mapping:

below.
<mapper device="ADJDP2" author="Atomix Productions" description="American Audio DP2" version="704" date="11/08/2011">
<map value="SAVE2" action="page "record" ? page "browser" : page "record""/>
<map value="SAMPLER" action="page "sampler" ? page "browser" : page "sampler""/>
<map value="BPM" action="edit_bpm"/>
<map value="TAP" action="file_info"/>
<map value="SAMPLE1" action="action_deck 1 ? sampler 1 play_stop : sampler 5 play_stop"/>
<map value="SAMPLE2" action="action_deck 1 ? sampler 2 play_stop : sampler 6 play_stop"/>
<map value="SAMPLE3" action="action_deck 1 ? sampler 3 play_stop : sampler 7 play_stop"/>
<map value="SAMPLE4" action="action_deck 1 ? sampler 4 play_stop : sampler 8 play_stop"/>
<map value="HOTCUE1" action="holding 1000ms ? delete_cue 1 : hot_cue 1"/>
<map value="HOTCUE2" action="holding 1000ms ? delete_cue 2 : hot_cue 2"/>
<map value="HOTCUE3" action="holding 1000ms ? delete_cue 3 : hot_cue 3"/>
<map value="HOTCUE4" action="holding 1000ms ? delete_cue 4 : hot_cue 4"/>
<map value="LOOP_L" action="loop_half"/>
<map value="LOOP_R" action="loop_double"/>
<map value="LOOP_IN" action="loop"/>
<map value="LOOP_OUT" action="loop_out"/>
<map value="RELOOP" action="reloop"/>
<map value="CUE" action="play ? cue_stop : hot_cue ? cue_stop ? cue_stop : pause_stop : cue_stop"/>
<map value="PLAY" action="holding 1000ms ? automix : play_pause"/>
<map value="X_PARAM_PUSH" action="effect "echo" active"/>
<map value="Y_PARAM_PUSH" action="effect "flanger" active"/>
<map value="SELECT_PUSH" action="effect active"/>
<map value="EFFECT" action="page "effects" ? page "browser" : page "effects""/>
<map value="SCRATCH" action="effect "brakestart" active"/>
<map value="CUE_PFL" action="select ? device_side "left" ? deck 1 leftdeck ? on & deck 3 leftdeck & deck 3 select : on & deck 1 leftdeck & deck 1 select : deck 2 rightdeck ? on & deck 4 rightdeck & deck 4 select : on & deck 2 rightdeck & deck 2 select : select"/>
<map value="JOG_SEEK" action="effect "dump" active"/>
<map value="SHIFT" action="set "shift" 1 while_pressed & set "shift" 1 while_pressed"/>
<map value="SYNC" action="holding 500 ms ? sync : effect "dump" active"/>
<map value="PITCH_LOCK" action="pitchlock"/>
<map value="PITCH_ON" action="pitch_range"/>
<map value="PITCH-" action="pitch_bend -4%"/>
<map value="PITCH+" action="pitch_bend +4%"/>
<map value="LOAD_TO" action="load"/>
<map value="JOG" action="jog_wheel"/>
<map value="X_PARAM" action="param_multiply 1% & effect slider 1"/>
<map value="Y_PARAM" action="param_multiply 1% & effect slider 2"/>
<map value="SELECT" action="effect select"/>
<map value="PITCH" action="pitch_slider"/>
<map value="MIC_VOLUME" action="mic_volume"/>
<map value="MASTER_VOLUME" action="master_volume"/>
<map value="HIGH" action="eq_mid"/>
<map value="LOW" action="eq_low"/>
<map value="VOL" action="volume_slider"/>
<map value="TRACK_PUSH" action="search"/>
<map value="TRACK" action="browser_scroll"/>
<map value="CUE_MIX" action="headphone_mix"/>
<map value="CUE_VOL" action="headphone_volume"/>
<map value="WAVE_ZOOM" action="master_balance"/>
<map value="CROSSFADER" action="crossfader_slider"/>
<map value="SHIFT_SAVE2" action="record"/>
<map value="SHIFT_SAMPLER" action="sampler default rec"/>
<map value="SHIFT_BPM" action="match_bpm"/>
<map value="SHIFT_TAP" action="beat_tap"/>
<map value="SHIFT_SAMPLE1" action="action_deck 1 ? sampler 1 play_stutter : sampler 5 play_stutter"/>
<map value="SHIFT_SAMPLE2" action="action_deck 1 ? sampler 2 play_stutter : sampler 6 play_stutter"/>
<map value="SHIFT_SAMPLE3" action="action_deck 1 ? sampler 3 play_stutter : sampler 7 play_stutter"/>
<map value="SHIFT_SAMPLE4" action="action_deck 1 ? sampler 4 play_stutter : sampler 8 play_stutter"/>
<map value="SHIFT_HOTCUE1" action="holding 1000ms ? delete_cue 5 : hot_cue 5"/>
<map value="SHIFT_HOTCUE2" action="holding 1000ms ? delete_cue 6 : hot_cue 6"/>
<map value="SHIFT_HOTCUE3" action="holding 1000ms ? delete_cue 7 : hot_cue 7"/>
<map value="SHIFT_HOTCUE4" action="holding 1000ms ? delete_cue 8 : hot_cue 8"/>
<map value="SHIFT_LOOP_L" action="adjust_cbg -0.01"/>
<map value="SHIFT_LOOP_R" action="adjust_cbg +0.01"/>
<map value="SHIFT_LOOP_IN" action="loop_in"/>
<map value="SHIFT_LOOP_OUT" action="loop_out"/>
<map value="SHIFT_RELOOP" action="reloop_exit"/>
<map value="SHIFT_CUE" action="set_cue"/>
<map value="SHIFT_PLAY" action="play_stutter"/>
<map value="SHIFT_X_PARAM_PUSH" action="skin_pannel "71" on"/>
<map value="SHIFT_Y_PARAM_PUSH" action="skin_pannel "72" on"/>
<map value="SHIFT_SELECT_PUSH" action="skin_pannel "73" on"/>
<map value="SHIFT_EFFECT" action="video_fx"/>
<map value="SHIFT_SCRATCH" action="vinyl_mode"/>
<map value="SHIFT_CUE_PFL" action="pfl"/>
<map value="SHIFT_JOG_SEEK" action="wheel_mode "search,jog""/>
<map value="SHIFT_SHIFT" action="set "shift" 1 while_pressed & set "shift" 1 while_pressed"/>
<map value="SHIFT_SYNC" action="smart_play"/>
<map value="SHIFT_PITCH_LOCK" action="key_lock"/>
<map value="SHIFT_PITCH_ON" action="pitch_reset"/>
<map value="SHIFT_PITCH-" action="seek -4"/>
<map value="SHIFT_PITCH+" action="seek +4"/>
<map value="SHIFT_LOAD_TO" action="unload"/>
<map value="SHIFT_JOG" action="jog_wheel"/>
<map value="SHIFT_X_PARAM" action="param_invert & eq_crossfader_low"/>
<map value="SHIFT_Y_PARAM" action="param_invert & eq_crossfader_mid"/>
<map value="SHIFT_SELECT" action="param_invert & eq_crossfader_high"/>
<map value="SHIFT_PITCH" action="key_smooth"/>
<map value="SHIFT_MIC_VOLUME" action="sampler 1 volume & sampler 2 volume & sampler 3 volume & sampler 4 volume & sampler 5 volume & sampler 6 volume & sampler 7 volume & sampler 8 volume & sampler 9 volume & sampler 10 volume & sampler 11 volume & sampler 12 volume"/>
<map value="SHIFT_MASTER_VOLUME" action="booth_volume"/>
<map value="SHIFT_HIGH" action="eq_high"/>
<map value="SHIFT_LOW" action="filter"/>
<map value="SHIFT_VOL" action="gain_slider"/>
<map value="SHIFT_TRACK" action="browser_scroll"/>
<map value="LED_SAVE2" action="page "record" ? blink : loaded ? on : blink 4000ms"/>
<map value="LED_SAMPLER" action="page "sampler" ? blink : loaded ? on : blink 4000ms"/>
<map value="LED_BPM" action="loaded ? on : blink 4000ms"/>
<map value="LED_TAP" action="loaded ? on : blink 4000ms"/>
<map value="LED_SAMPLE1_A" action="sampler 1 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 1 : on"/>
<map value="LED_SAMPLE1_B" action="sampler 5 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 1 : on"/>
<map value="LED_SAMPLE2_A" action="sampler 2 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 2 : on"/>
<map value="LED_SAMPLE2_B" action="sampler 6 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 2 : on"/>
<map value="LED_SAMPLE3_A" action="sampler 3 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 3 : on"/>
<map value="LED_SAMPLE3_B" action="sampler 7 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 3 : on"/>
<map value="LED_SAMPLE4_A" action="sampler 4 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 4 : on"/>
<map value="LED_SAMPLE4_B" action="sampler 8 play ? on : loaded ? pause ? blink : loaded ? play ? get beat_num 4 : on"/>
<map value="LED_HOTCUE1" action="loaded ? pause ? hot_cue 1 ? blink : off : loaded ? play ? hot_cue 1 ? on : off"/>
<map value="LED_HOTCUE2" action="loaded ? pause ? hot_cue 2 ? blink : off : loaded ? play ? hot_cue 2 ? on : off"/>
<map value="LED_HOTCUE3" action="loaded ? pause ? hot_cue 3 ? blink : off : loaded ? play ? hot_cue 3 ? on : off"/>
<map value="LED_HOTCUE4" action="loaded ? pause ? hot_cue 4 ? blink : off : loaded ? play ? hot_cue 4 ? on : off"/>
<map value="LED_LOOP_L" action="loaded ? pause ? loop ? blink : on : loaded ? play ? loop ? get beat_bar -2 : on"/>
<map value="LED_LOOP_R" action="loaded ? pause ? loop ? blink : on : loaded ? play ? loop ? get beat_bar -2 : on"/>
<map value="LED_LOOP1" action="loaded ? loop_select 0.5 ? on : loop_select 0.25 ? blink 400ms : loop_select 0.125 ? blink 200ms : off"/>
<map value="LED_LOOP2" action="loaded ? loop_select 1"/>
<map value="LED_LOOP3" action="loaded ? loop_select 2"/>
<map value="LED_LOOP4" action="loaded ? loop_select 4"/>
<map value="LED_LOOP5" action="loaded ? loop_select 8"/>
<map value="LED_LOOP6" action="loaded ? loop_select 16"/>
<map value="LED_LOOP7" action="loaded ? loop_select 32 ? on : loop_select 64 ? blink : off"/>
<map value="BAR_LOOPS" action="BAR_LOOPS"/>
<map value="BAR_LOOPS_REV" action="BAR_LOOPS_REV"/>
<map value="LED_LOOP_IN" action="loaded ? pause ? loop ? blink : on : loaded ? play ? loop ? get beat_bar -2 : on"/>
<map value="LED_LOOP_OUT" action="loaded ? pause ? loop ? blink : on : loaded ? play ? loop ? get beat_bar 2 : on"/>
<map value="LED_RELOOP" action="loaded ? pause ? loop ? blink : on : loaded ? play ? loop ? get beat_bar -4 : on"/>
<map value="LED_CUE" action="loaded ? pause ? on : get beat_bar 4 : blink 4000ms"/>
<map value="LED_PLAY" action="loaded ? play ? automix ? get beat_bar -2 : on : blink : blink 4000ms"/>
<map value="LED_EFFECT1" action="off"/>
<map value="LED_EFFECT2" action="off"/>
<map value="LED_EFFECT3" action="off"/>
<map value="LED_EFFECT4" action="off"/>
<map value="LED_EFFECT5" action="off"/>
<map value="LED_EFFECT6" action="off"/>
<map value="LED_EFFECT7" action="off"/>
<map value="LED_EFFECT8" action="off"/>
<map value="BAR_EFFECT" action="get level"/>
<map value="BAR_EFFECT_REVERSE" action="off"/>
<map value="LED_EFFECT" action="page "effects" ? blink : loaded ? pause ? effect active ? blink : on : loaded ? play ? effect active ? get beat_bar -2 : on"/>
<map value="LED_SCRATCH" action="loaded ? pause ? vinyl_mode ? blink : on : loaded ? play ? vinyl_mode ? get beat_bar -2 : on"/>
<map value="LED_CUE_PFL" action="pfl ? on : loaded ? play ? get beat_bar -4 : blink"/>
<map value="LED_JOG_SEEK" action="loaded ? pause ? wheel_mode ? blink : on : loaded ? play ? wheel_mode ? get beat_bar -2 : on"/>
<map value="LED_SHIFT" action="loaded ? on : blink 4000ms"/>
<map value="LED_SYNC" action="loaded ? pause ? effect "dump" active ? blink : on : loaded ? play ? effect "dump" active ? get beat_bar -4 : get beat_bar -2"/>
<map value="LED_PITCH_LOCK" action="pitchlock ? get beat_bar -4 : on"/>
<map value="LED_PITCH_ON" action="get pitch_zero 0.1 ? on : get beat_bar -4"/>
<map value="LED_PITCH-" action="LED_PITCH-"/>
<map value="LED_PITCH+" action="LED_PITCH+"/>
<map value="LED_LOAD_TO" action="loaded ? on : blink 4000ms"/>
<map value="ONEXIT" action="ONEXIT"/>
<map value="ONINIT" action="ONINIT"/>
</mapper>
 

Posted 5 days ago @ 5:20 am
AdionPRO InfinityCTOMember since 2006
The shift key should be mapped to simply shift
 

Posted 5 days ago @ 6:41 am
Thanks for your reply Adion. If I just map it as "Shift", would I not lose the "while_pressed" functionality?
 

Posted 4 days ago @ 7:32 pm