Peter Tinsley
2019-03-01 19:59:22
Is there a way to get an LED to light when a button is first pressed, and then extinguished when the same button is pressed for a second time please? (an LED toggle)
Thank you.
Peter Tinsley
2019-03-01 19:59:22
Is there a way to get an LED to light when a button is first pressed, and then extinguished when the same button is pressed for a second time please? (an LED toggle)
Thank you.
Steve-Bome Forum Moderator
2019-03-01 20:30:11
Hi, it really depends on the LED of the controller you have. Usually the velocity value indicates whether it is on (127) or off (0). Other controllers have different velocity values for different colors.
First of all if you want to control the LED state by Bome, I usually add a new preset and define the input (from controller) and output (to controller) to override the project defaults (which could be other intputs and outputs from other controllers or attached DAW’s).
Then under the preset you add a translator as the example below, The below is for a momentary button (push = note on and release = note off)
Incoming Action: Note-On MIDI CH1 Note 64 any velocity
Rules:
// This will toggle the state of the global variable ga 0 to 1 and visa versa – Note you will need
// a different global variable for each LED you are controlling
ga=ga^1
// Note off value
qq=0
// Note on value
if ga==1 then qq=127
Outgoing – Note On MIDI CH1 Note 64 and velocity qq
g60force
2019-03-01 20:31:57
comment
yes it’s actually simple… Steve would use variables and coding hehe, but i make 2 Presets (for example) ‘Xon’ and ‘Xoff’ by default chose which you want enabled when starting the project (lets say Off is default) then in the Xon preset make a new translator disable preset XOff, by activation of this preset Xon… the add another translator when Midi input of the button U want has an output Preset Activate By Name Xoff a third translator is needed simply with a input that is active when the preset is switched, with ofcrs the output of the Light (for example) 90 XX 7F = On / 90 XX 00 = Off, then do the oposite for the Xoff preset that enables by default a light state and on button press Activate the preset Xon
if this all doesnt make sense
check the solution i recently uploaded
for the guy that wanted a switch/turnknob toggle (there i practically did the same thing)
g60force
2019-03-01 22:29:51
comment
😂 steve we where typing the message probably at the same time, here goed with saying i’m glad u posted yours i’m gonna study it… hope to learn from it again!
Steve-Bome Forum Moderator
2019-03-01 22:44:40
comment
Yep there are multiple ways to accomplish the same objective within MT Pro. Learning from others is a good idea. Your method is good if you don’t like to write rules or are running out of global variables.
petergtinsley
2019-03-02 22:02:07
Thank you both 🙂 I’ll be able to learn from both solutions. Really enjoying the versatility of the software and great community support and spirit. Thank you both!
petergtinsley
2019-03-02 22:41:03
comment
Not sure what I’m doing wrong but it lights up when pressed and extinguishes when released. Is that the expected behavior with the rules you scripted – or should it toggle on and off only with each down-press? Thank you.
Steve-Bome Forum Moderator
2019-03-03 01:17:18
comment
petergtinsley
2019-03-03 15:28:58
comment
Steve-Bome Forum Moderator
2019-03-04 20:53:14
comment
My guess is that your button is already sending toggle message (is not momentary). If you can use MT Pros logging feature to capture your input, I would know for sure. What is the controller you are using?
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz
petergtinsley
2019-03-05 15:18:41
Thanks 🙂 It’s a DJ Mix-101. When I push the button (top-left blue one, pictured) it sends a note on signal, when I release it, it sends a note off signal. Same signals each time I press it.
Steve-Bome Forum Moderator
2019-03-05 15:28:52
comment
OK so you probably have another translator using the global variable ga and toggling it as well. Please post your project file an I will have a look.
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz
petergtinsley
2019-03-06 08:32:07
comment
Ah,fair point. I’ll try to upload the project file for you to check; thanks so much for taking the time to help. Really appreciate it.
Steve-Bome Forum Moderator
2019-03-06 16:01:33
comment
You can also disable all translators but the target one and make sure it is working OK, then enable the others one by one until the problem comes back.
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz
Steve-Bome Forum Moderator
2019-03-06 17:34:57
comment
I just looked at your file you send via email. The issue is you had MIDI Thru path set which means incoming note-off messages will alway pass through since you didn’t have a translator to suppress note-off. I added a translator to suppress note off message for that button.
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz
petergtinsley
2019-03-07 08:05:07
comment
AH, I see. So BomeMTP was turning the LED on but then the MIDI device itself was turning the LED off again. Thanks for taking the time to look at the file to find and explain my error – really appreciate it. 🙂