Make buttons perform different functions depending on what mode is selected

Last edit by jrnandre, Professional edition user on Sat 19 Oct 13 @ 9:00 pm

First map a button to cycle through the modes, e.g: For 4 different modes Normal, Effects, Video and Sampler:

cycle 'mode' 4 & var_equal 'mode' 1 ? show_text "Effects|Mode" : var_equal 'mode' 2 ? show_text "Video|Mode" : var_equal 'mode' 3 ? show_text "Sampler|Mode" : show_text "Normal|Mode"

If your controller does not have text displays, then map the button to:

cycle 'mode' 4

And map the LED of the button (BUTTONNAME_LED) to indicate the mode:

var_equal 'mode' 1 ? on : var_equal 'mode' 2 ? on blink : var_equal 'mode' 3 ? on blinkfast : off

The variable 'mode' now holds the mode number, which you can then use in the mapping for each button that will act differently depending on the mode, e.g: You could map a button as follows:

var_equal 'mode' 1 ? effect 'Flanger' active : var_equal 'mode' 2 ? video_fx_select 'Negative' & video_fx : var_equal 'mode' 3 ? sampler 1 play_stop : hot_cue 1

The button will act as follows:

Normal: Hot cue #1
Effects: Turns flanger on/off
Video: Turns the video effect 'Negative' on/off
Sampler: Plays sample #1

Return to VDJscript examples...