MIDI_controller icon indicating copy to clipboard operation
MIDI_controller copied to clipboard

Use Momentary as Toggle

Open fristaildg opened this issue 4 years ago • 2 comments

Hi! I'm super new at this and I'm sure this is a very simple task to achieve. I need to send CC messages to control Bias FX pedals and have done this so far: `#include <Control_Surface.h>

HairlessMIDI_Interface midi;

CCButton buttons[] = { {2, {MIDI_CC::Foot_Controller, CHANNEL_1}} };

void setup() { // put your setup code here, to run once: Control_Surface.begin(); }

void loop() { // put your main code here, to run repeatedly: Control_Surface.loop(); }`

But every time I press the button it sends on (127) when I press and off (0) when I release the button. How can I change my code to make the button behave as a toggler?

Huge thanks in advance!!

fristaildg avatar Jan 30 '20 00:01 fristaildg

You can use CCButtonLatched.
Have a look at the MIDI Output Elements module for a complete overview.

tttapa avatar Jan 30 '20 09:01 tttapa

Yes I found it right after I asked you the question and it worked flawlessly. Huge thanks for this library, it has made the life of a complete noob like me super easy!

luisFernandezDevSpark avatar Jan 30 '20 12:01 luisFernandezDevSpark