Sign In:     


Forum: VirtualDJ Technical Support

Topic: LED Mapping for controller button
Hi,

Apologies if this is a repeated question, I've searched and can't find my specific requirement.

I need an controller button led to turn on when the button is pressed and for it to stay on however many times I press it. Straight forward enough. I then need to be able to turn it off when pressed whilst holding shift.

Thanks
 

Posted 8 hours ago
So to think about the button, not the LED pressing it turns something on until shift+button turns it off.
LEDs just query something, so what script do you have on the button as a press action and then we can work out the rest
 

ok this is what I have

controllervar '$d2browser' ? browser_window 'songs' ? browser_sort 'artist' : sideview_sort 'artist' & nothing : toggle "$Button1"


Currently that organises the tracks when in browser view by artist and toggles the button when not in browser view
 

and the shift+button script please.

I'm guessing here map your LED to
controllervar '$d2browser'
 

Probably a bit more context of what this is for might help.

The button currently sorts the browser screen, when not on browser screen I have it firing through my midiloop device to ableton to start a clip over there, which works well. I need led confirmation to say it's been pressed and then switch off when shift pressed to show that clip has stopped.

This is the button code
controllervar '$d2browser' ? browser_window 'songs' ? browser_sort 'artist' : sideview_sort 'artist' & nothing : toggle '$Button1'


$Button1 being the var sent through Midiloop to start the clip in ableton and that restarts the clip on every press.

This is the shift button code
toggle "$Button1S"


$Button1S being the var sent through Midiloop to stop the clip in ableton

This is the led code if needed
controllervar '$d2browser' ? browser_window 'songs' ? browser_sort '-artist' ? on : browser_sort '+artist' ? on : off : sideview_sort '-artist' ? on : sideview_sort '+artist' ? on : off : off


I thought tweaking the end of the led code would get the desired result but maybe i'm coming at it from the wrong angle!
 

I see a bit more complicated than first thought but simple to deal with

BUTTON
controllervar '$d2browser' ? browser_window 'songs' ? browser_sort 'artist' : sideview_sort 'artist' & nothing : toggle '$Button1' & controllervar '$myLED' 1

SHIFT+BUTTON
toggle "$Button1S" & controllervar '$myLED' 0

LED
controllervar '$myLED'
 

That's excellent, thanks mate, works great.
Now I see the code I see it is simple, I was trying to do it all on the led, which obviously wasn't the way.
 

@Locodog is a genius!