Accesso rapido:  

Forum: VirtualDJ Technical Support

Topic: blinking LED's

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

CeesKPRO InfinityMember since 2011
Hey guys
I'm trying to map my mixer (D&R Airence) for the most common functions in VDJ, and with a lot of reading, this forum and your help i've reached a lot already!

The Airence has a control-section with 26 butttons, and I am using them to control the samplers in VDJ, where I have situated all my jingles.
Works great and fast!

The buttons are LED's with 3 colors, green, red and yellow. I want to use this LED's for the state of the sampler, e.g. green when they are loaded, red when they are playing, something like that.

I found out that commands must be in the 'page out' section of de device XML, and found this in WIKI:

<led bit="0x42" name="LED_PLAY" default="PLAY" deck="1" />

and this:

<color byte="0x00" nbbits="24" bitspercolor="7" name="LED_PAD1" default="PAD1" deck="1" />
<color byte="0x03" values="0x01=red,0x02=#112233" name="LED_MODE" default="MODE" deck="1" />

What exactly is the result of this and how do I have to use it?
Does this also need a <constant> value?

Any help is welcome, and thanks in advance!
 

Inviato Wed 16 Nov 16 @ 12:00 am
djdadPRO InfinityDevelopment ManagerMember since 2005
Does the unit communicate with the MIDI or the HID Protocol ?
Do you have a link or can share the Communication Protocol documentation ?

Since the LED supports more than 1 colors, then it can be defined as <color> and then in the mapping, you need to map it using the color 'colorname' or color '#htmlcolor' action.
e.g.
sampler_loaded x ? sampler_play x ? color 'red' : color 'green' : off
 

Inviato Wed 16 Nov 16 @ 1:07 am
CeesKPRO InfinityMember since 2011
 

Inviato Wed 16 Nov 16 @ 4:31 pm
djdadPRO InfinityDevelopment ManagerMember since 2005
Seems that the unit accepts both "packets" (individual commands to light up one Led each time) but also a full HID out page.
Manual page 8, use the "AIRENCE_LED_ALL_WRITE "
Tr to add this to the definition..


<page type="out">
<constant byte="0x00" value="0x08" />
<constant byte="0x01" value="0x04"/>
<led name="LED_1_RED" bit="0x10" />
<led name="LED_1_GREEN" bit="0x11" />
<led name="LED_2_RED" bit="0x12" />
<led name="LED_2_GREEN" bit="0x13" />

...
<led name="LED_24_RED" bit="0x3E" />
<led name="LED_24_GREEN" bit="0x3F" />
</page>


24 LEDs as far as i see, each LED has 2 bits, so 24 pairs of RED and GREEN. Lets say you want red when empty, yellow when loaded and green when playing...
Mapping should look like..
LED_X_RED = sampler_loaded x ? sampler_play x ? off : on : on
LED_X_GREEN = sampler_loaded x ? sampler_play x ? on : on : off


Also try this ..
Instead of having 2 Keys per LED, this could work (not sure)..

<color bit="0x10" nbbits="2" values="0x00=black, 0x01=red,0x02=green,0x03=yellow" name="LED_1" />
<color bit="0x12" nbbits="2" values="0x00=black, 0x01=red,0x02=green,0x03=yellow" name="LED_2" />

...
<color bit="0x3E" nbbits="2" values="0x00=black, 0x01=red,0x02=green,0x03=yellow" name="LED_24" />

In that case the mapping now would have just one Key per LED and mapped like..
LED_1 = sampler_loaded x ? sampler_play x ? color 'green' : color 'yellow' : color 'red'


Also if none of the above works, you may need to add
reportsize="64" outreportsize="64"

 

Inviato Thu 17 Nov 16 @ 1:23 am
CeesKPRO InfinityMember since 2011
Ahhh thank you soooo much!!

Do I have to map this:

LED_X_RED = sampler_loaded x ? sampler_play x ? off : on : on
LED_X_GREEN = sampler_loaded x ? sampler_play x ? on : on : off

Like this:
<map action="sampler_loaded" value ="LED_1_GREEN"/>
<map action="sampler_play" value ="LED_1_RED"/>
 

Inviato Fri 18 Nov 16 @ 8:25 am
CeesKPRO InfinityMember since 2011

Oke, forget my previous post, mapping is of course like you said: LED_X_RED = sampler_loaded x ? sampler_play x ? off : on : on

What I don't understand is the value's of the bits you give them: bit="0x10" , bit="0x11" .......untill bit="0x3F"

I use this value's to start the samplers, for example button 1 on the controller is bit="0x17" (found out with HID Tracer), so I can imagine that <led name="LED_1_RED" bit="0x17" /> gives button 1 a red color, but for green you use <led name="LED_1_GREEN" bit="0x18" />, and that's another button......

I've tried both scripts, the first one gives light to the buttons but pressing them doesn't work properly, the places without a sampler have a yellow light too.

The second script doesn't work at all. No problem, the first one is working, but I need to understand the value's of the bits.....hope you can help me further
 

Inviato Mon 21 Nov 16 @ 9:55 am
djdadPRO InfinityDevelopment ManagerMember since 2005
The Page out can be different from the Page in of course. And in this case, it makes sense to be, since each button only requires one single bit to report its status (0 when up and 1 when down) while the LEDs require 2 bits (one for the RED status and a second one for the GREEN status - YELLOW when both are 1).
So each LED is consisted of 2 bits, which are defined and mapped individually, but you always need to send the correct value to each one of them depending on the color you need to get.

so just try one by one each LED to map it as ..
LED_X_RED --> on
LED_X_GREEN-> off
(this combination should light up the X LED red.

LED_X_RED --> off
LED_X_GREEN-> on
(this combination should light up the X LED green.

LED_X_RED --> on
LED_X_GREEN-> on
(this combination should light up the X LED yellow.

LED_X_RED --> off
LED_X_GREEN-> off
(this combination should turn off the LED

If that works, then probably something else is wrong and you get yellow for the non-loaded samples.


Can you post here the full definition and the mapping you have done so far ?



A bit of explanation about the page out of this unit.
As you can see in the manual the first 2 bytes of the page out , need to have a constant value, thats what these are doing..
<constant byte="0x00" value="0x08" />
<constant byte="0x01" value="0x04"/>
1st byte (0x00 for VDJ) .. 0 0 0 0 1 0 0 0
2nd byte (0x01) . 0 0 0 0 0 1 0 0

The first bit that controls a LED is the first bit of the 3rd byte, so bit Nr. 16 (in hex x10), considering that counting starts from 0 and not 1.
<led name="LED_1_RED" bit="0x10" />
3rd byte (bits 16 to 23 (counting starts from 0) --> in hex 0x10 to 0x0F for VDJ) G4 R4 G3 R3 G2 R2 G1 R1 controls 4 LEDs (bits start counting from the left side, the LSB)
so sending 0 0 0 0 0 0 0 1 the 1st LED turns red
and sending 0 0 1 0 0 0 0 0 the 3rd LED turns green
 

Inviato Mon 21 Nov 16 @ 11:40 am


(Vecchi argomenti e forum sono automaticamente chiusi)