momentary->toggle, and translating midi out to change LED

beatniks3

2009-06-14 21:19:56

hi everyone, i hope i'm just missing something easy.

so i'm taking the info from this thread: http://www.bome.com/forums/viewtopic.ph ... ght=toggle

and using it to turn momentary buttons on the bcd2000 into toggle, as well as send a midi out message to the bcd2000 to tell it to turn the LED on and off.

The LEDs recieve mid control change data (on/off) If the controller value is between 0 and 63, this value corresponds to the switched off status (LED off). IF the controller value transmitted is 64 or higher (max 127) the LED illumates. from the manual, the button LED i want to light up recieves the control change data from BO 19 xx, xx>64 on, xx<63 off.

The button i want to use is 90 1C 7F on.

i got the toggle part working right but can't figure out how to get the light to stay on while the button is on, and off while the button is off. right now it just lights up when i press the button down.

thanks alot in advance

beatniks3

2009-06-14 22:12:12

solved, bentosan helped me. that guy is a wealth of information

beatniks3

2009-06-15 01:10:30

so here is the code he whipped up for me:

Bent0: Translator 1
incoming:
90 1C 7F

rules:
if ga==0 then Goto "ToggleOn"
if ga==1 then Goto "ToggleOff"
Label "ToggleOn"
ga=1
pp=127
exit rules, execute Outgoing Action
Label "ToggleOff"
ga=0
pp=0
outgoing:
90 1C pp


translator 2
incoming:
90 1C 7F
Rules:
if ga=1 then pp=127
if ga=0 then pp=0
outgoing:
B0 19 pp
----------------------
this works and i'm so grateful that bentosan is so helpful and will to share his experience.

so i'd like to do the following. the above toggle button is going to toggle between decks a and decks b in my setup. when button is on (light on) will mean that deck A control is active. when button is off (light off) that will mean that deck B control is active. that much i can do.

in addition to that button, we'll call it the A/B button, I would like to have another way of selecting deck A or deck B control; I would like for the deck A volume fader to select deck A control when it reaches zero, and i would like deck b volume fader to select deck B control when it reaches zero.

I would like to have the A/B button "see" the actions of these smart faders so that if i pull the deck A vol fader down to zero, I would like to the A/B light to go on if it is off and stay on if it is on, as well as change the next toggle to go to if needed. (If fader cause button to change, then the next time you pushed the button it would do the correct toggleon or toggleoff.

I hope this makes sense. thanks in advance to any advice.

beatniks3

2009-06-15 16:18:07

hey, so i saw in another thread a new post
Take a global variable for each LED state you want to save. So if you sent out a LED state, save this value in a global variable. On reactivating this preset , send out all LED Midi messages out to the unit.

B0 g0
B0 g1
B0 g2
i'm guess i'm going to be doing something like this for mine project. could it be as simple as adding a translator to each deck vol fader that says when the fader reaches zero also send out the same midi message as my A/B button does? would i even need to store the LED state as global variable?

thanks, really appreciate it.

beatniks3

2009-06-15 20:41:05

so bento's helping me over chat, and i was wrong in thinking that the midi can be feed in and out like that. his advice was to use a global variable.

trying to figure it out...

beatniks3

2009-06-16 03:37:42

GOT IT WORKING (just shouting in excitement)

on the advice of bentosan i looked into presets more and got what i wanted using presets. It really opens up the program for me, making presets and switching between them is easier for me conceptually then making a ton of variables between different translators.

thanks everyone. thanks bento if you read this!!!