Incoming Note To Outgoing Toggle On/Off A Button

Hi, looked everywhere and there is no similar questions that are this basic.

I just need to get a basic on/off button linked up. (And then duplicate this translator many times after).
FL Studio gives the ability to link this button to a controller, but an output CC signal off 127 isn’t working.
This formula that I am trying to toggle on/off isn’t working either.

Formula Bigger

I have input any velocity, use variable for velocity=qq
Output use variable for value=qq

So there is a note command coming into MTP, and the output I just need it to turn on the button when it’s off and turn it off when it’s on. It’s a plugin enable button.
I’m sure it’s an easy fix but I gave up trying things.

Hi, change your outgoing message from a CC to a note and it should work if your controller supports it.

Each note toggle will require its own global variable.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

It’s a daw so I can’t use a note. It will trigger whatever plugin is selected to play the note. I’m trying to avoid notes as much as possible.

Does MIDI have a ‘press button’ command among its various message types?
A cc change does turn the button on. But pressing it again doesn’t turn it off.
Is there a formula for sending a 0 with next press, or something?
The FLS link function does have its own formula table too. I wonder if I should try and do this in there.

Is this the toggle formula?

Toggle Formula

If so, do I need to do a rule ga=0 or something in the init translator?
Even though I have a whole page of global variables there to initialize MIDI Buddy with my monitor. ?

Typically a outgoing value of 127 is for on and 0 is for off. The current translator should be alternating between these two values if you have set it up correctly. Not all controllers (or DAW) are consistent with this methodology.

ga=ga^1 (alternates between 0 and 1)
if ga>0 then qq=127 (changes 1 to 127)
if ga==0 then qq=0

Oh and set your incoming trigger for value of either 127 or 0. Not “Any value qq”

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

This set of rules is much more complicated than the way I wrote it.

For global variables they will always be zero when you open a project.

I set them in a translator for 2 purposes
1- To document what I’m using so I don’t reuse
2- To set initial value if other than zero (in many cases I just set to 0 for reasons in item 1 above.

1 Like

Ok awesome, I’ll try it out after work.
If all else fails, maybe I can use a note message for buttons, and bind the controller to an instrument channel that has no instrument in it, so it will absorb the MIDI note messages and there is no sound as a result. FLS does have this feature now.

This means alternate? ga=ga^1
You said my incoming trigger value must be 127; you meant velocity?
Are you sure this formula works?
It’s still not working. It’s still outputting a 127 every time, or nothing, if I have the output variable at qq. Any other output variable just sends out gibberish numbers.


It equals qq to 127, qq is the output variable, but it doesn’t output any MIDI.
I have the MIDI out enabled on the logger. Nothing appears.

No Output 2

Restart your project and it should work (unless you are using ga for something else in the project that is. In that case please use an unused global variable instead of ga.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

Ah, excellent.
I had the MIDI Buddy init all the way up to gn. So I’m using go now.
Also qq was being used, so I’m using vv.
But FLS isn’t detecting it still because it’s not outputting any MIDI message for some reason. The alternating is working, but then it just stops without an output from MTP. It just calculates the formula and stops.

No those are local variables global variables start with g and go to n and then y and z so try something like ya.

Please look at the help menu or F1 to open the document and find the section on local vs global variables. Local variables are not persistent.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

Clarification. It is OK to use vv for outgoing but the variable for toggling needs to be an unused global variable. I don’t remember if you are using go anywhere else in the project file. Check the “Init global variables” translator. Hopefully you did not use go any where else in your project and forget to document it.

Also to ensure reliability you can add another rule

// add this rule. again make sure you are not using ga for anything else
// this essentially clears all other bits of the global variable
// end of added rule
if ga>0 then qq=127

So the formula wasn’t working because MTP wasn’t outputting any MIDI again, without my knowledge. The outputs changed on me. Dunno. It’s working now.

It’s working with go and vv. And input velocity 127.
It can’t see the state of the FLS button, so when it’s out of sync, I just have to press the button twice. First wrong input is just ignored. That’s acceptable.

Things are going good. I’m about 120 translators richer than I was yesterday.
Thanks for all the help. I’ll probably bother you about the lighting because NI got back to me with some info. Will make a new thread.

Formula working
So here it is without the add on.

It already contains the first line. go=go^1 Do I put it twice?
Should the result look like this:
Modified Formula
With go instead of ga? (ga is being used).