Connexion rapide:  

Forum: Old versions

Sujet launchpad mini LED

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

I have the basic LED map to work however im trying to add a code so when i click a the button it blinks
 

Posté Wed 30 Apr 14 @ 10:50 pm
What's the code and I'm sure we can give you the solution.
 

Posté Wed 30 Apr 14 @ 11:00 pm
all i have is [buttonLEDname] = on
 

Posté Wed 30 Apr 14 @ 11:09 pm
But what action to you want it to blink on?
 

Posté Wed 30 Apr 14 @ 11:30 pm
deck # effect "cut" active
 

Posté Wed 30 Apr 14 @ 11:56 pm
deck # effect "cut" active ? blink : off

When cut is active the led will flash. If not activate the led will be off. You can change this to "on" if you wish.
 

Posté Thu 01 May 14 @ 12:08 am
Doesnt work.

There is a Key for the actual button and the LED
so its
Key: B_4-3: deck 1 effect "Cut" active
Key: LED_R_4-3: on
 

Posté Thu 01 May 14 @ 12:15 am
Maybe one of the controller experts can point you in the right direction.
 

Posté Thu 01 May 14 @ 12:24 am
you should change the definition file so all the colors are accessible on a single led mapping and change the color with "get_constant #". As it is now you will need to account for all the RGY states eg.

Key: B_4-3: deck 1 effect "Cut" active
Key: LED_R_4-3: deck 1 effect "Cut" active on ? on : off
Key: LED_G_4-3: deck 1 effect "Cut" active on ? off : off
Key: LED_Y_4-3: deck 1 effect "Cut" active on ? off : off

if you change the definition you could do it all on the button eg.

Key: B_4-3: deck 1 effect "Cut" active & deck 1 effect 'Cut' active on ? get_constant 0.2 : get_constant 0

or you could still use the leds if you want to separate functionality from the leds eg.

Key: B_4-3: deck 1 effect "Cut" active
Key: LED_B_4-3: deck 1 effect 'Cut' active on ? get_constant 0.2 : get_constant 0

the values after get_constant probably aren't correct but you should get the idea.. 0 is usually off, then use a floating point "decimal" number to set the color. if you want to get the values that change the led state. Essentially all get constant is doing is changing the vailue by a percentage, so to work out the equivalent you would find the integer value you want to set the led to eg. 60

127 / 100 * 60 = 76.2

because you are working with decimals you need to divide by 100 and you will get 0.762 so you would use get_constant 0.762 to set the integer value of 60.

the change that needs to occur in the definition file is delete two of the led nodes and instead of setting the value attribute, delete it and replace with min="0" max="127" eg.

from something like:
<led note="1" value="1" name="LED_R_4-3" />
<led note="1" value="68" name="LED_G_4-3" />
<led note="1" value="127" name="LED_Y_4-3" />

to something like:
<led note="1" min="0" max="127" name="LED_4-3" />

all the led values are in the programmer reference guide from novation, but a quick way to find the value after you have changed the definition is to map a led to "deck 1 volume" and you should see the led color change.

if you use a good text editor like sublime text, notepad++ or brackets you can use a regular expression in find and replace and can use the following to automagically change your definition in two steps... btw all of those text editors are free:

find1: (.*LED_(G|Y).*)
replace1: "nothing in the replace box"

find2: (value=\"[^\"])
replace2: min="0" max="127"
 

Posté Thu 01 May 14 @ 1:41 am
sorry I made a small mistake in the calculation, it should be out of 128 not 127 eg.

128 / 100 * 60 = 76.8

or to save a few key presses on the calculator you could use

1.28 * 60 = 76.8
 

Posté Thu 01 May 14 @ 4:31 am


(Les anciens sujets et forums sont automatiquement fermés)