How to toggle LEDs on/off please.

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.

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

 

2 Likes

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)

😂 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!

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.

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!

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.

Are you having problem with the script I sent you or did you duplicate that translator to handle another button.
The script expects momentary input press=on release=off. The script turns it into toggle press ones on, press again off.
You need to make sure the output of the translator goes back to your controller and for an additional buttons, you need different global variables. I used ga for the fisrt button. You can use gb, gc … gz. g0-g9 then ha, hb … hz h0-h9 all the way to xa-xz x0-x9. Every button in this model needs a DIFFERENT global variable. If you are still having troublr, send me our script and I will have a look.
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Thanks, just trying to set up the one button before I try duplicating it for any others. When I press the button for the first time, it lights up. when I release the button it extinguishes. When I press the button a second time it stays unlit and when I release it, it also stays extinguished. When I press a third time it light’s up and then extinguishes upon release. I think the problem may be that the button is also be passing a command upon release which may be confusing the script. I should be able to work around it somehow.

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

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.

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

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.

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

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

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. 🙂

Really thanks Steve!!!
I tried some software before, but yesterday after trying the trial I decided to buy your software, and I was right to buy this masterpiece, it is worth every penny, it is the holy grail of midi translators and your support is wonderful, friendly and professional.
I wish you the best, thanks again for making this software, it’s saving me a lot of wasted hours and I can do anything with my mixer … literally anything.

Thanks for the kind words! I actually did not write the software. I am a customer like you and found myself doing amazing things with it and Florian Bomers (the owner), hired me to provide support. I also bought a BomeBox shortly after it was released. I agree it is really amazing software.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz