Control-Surface icon indicating copy to clipboard operation
Control-Surface copied to clipboard

Condition for sending MIDI

Open Willame156 opened this issue 4 years ago • 5 comments
trafficstars

First of all, thanks for this great library. I ask for your help in resolving 2 issues: 1st - "button_01" send CC 2, but if more than 1 second send CC 10; 2nd - Do not read "button_01" if button_02 has pressed

#include <Control_Surface.h>    
#include <MIDI_Interfaces/BluetoothMIDI_Interface.hpp> 

BluetoothMIDI_Interface midi;  

CCButtonLatched button_01 = {15 ,  { 2, CHANNEL_1}, };  // if more than 1 second send midi CC 10
CCButton button_02 = {23 ,  { 4, CHANNEL_1}, };  //Do not read "button_01" if button_02 has pressed

                      
void setup() {
   Control_Surface.begin();
}

void loop() {
  Control_Surface.loop();
}

//I thank you for your attention

Willame156 avatar Mar 15 '21 21:03 Willame156

I think this tutorial might help you out with your issue https://www.instructables.com/Arduino-Dual-Function-Button-Long-PressShort-Press/

ACuppaJoes avatar Jul 31 '21 14:07 ACuppaJoes

Acho que este tutorial pode ajudá-lo com seu problema https://www.instructables.com/Arduino-Dual-Function-Button-Long-PressShort-Press/

Obrigado por sua resposta. Me perdoe a demora em comentar, acabei esquecendo.

Willame156 avatar Dec 23 '21 11:12 Willame156

I think this tutorial might help you out with your issue https://www.instructables.com/Arduino-Dual-Function-Button-Long-PressShort-Press/

Alternatively, you could use https://tttapa.github.io/Control-Surface-doc/Doxygen/d7/d83/classAH_1_1IncrementButton.html, it already handles long and short presses for you.

tttapa avatar Dec 23 '21 18:12 tttapa

Acho que este tutorial pode ajudá-lo com seu problema https://www.instructables.com/Arduino-Dual-Function-Button-Long-PressShort-Press/

Alternativamente, você pode usar https://tttapa.github.io/Control-Surface-doc/Doxygen/d7/d83/classAH_1_1IncrementButton.html , ele já lida com pressionamentos longos e curtos para você.

Obrigado tttapa, já consegui incluir o botão com duas funções usando a Control Surface

Willame156 avatar Dec 24 '21 02:12 Willame156