Basic question: CC to trig from MIDI input?


#1

Programmed some buttons to send CC value 127 when pressed, otherwise zero. It works as intended when connected and shows 0 - 127 to disp/chart (shown below), but it doesn't send the trig along with it. logic/change doesn't do it either. I've also left the portion of code which sends the MIDI value from my microcontroller, if relevant. Thanks!

  for (int v = 0; v < 7; v++) {
lastButtonPress[v] = buttonPress[v];
buttonPress[v] = digitalRead(buttonNames[v]);
if (buttonPress[v] != lastButtonPress[v]) {
if (buttonPress[v] == LOW) {
    MIDI.sendControlChange(v + 42, 127, MIDISendChannel);
    delay(5);
  }else{
    MIDI.sendControlChange(v + 42, 0, MIDISendChannel);
  }
}

}

edit: It's in a loop because I'm sending from 7 buttons. All of the buttons send the values properly to their respective CC number.


#2

Hi, are you sure the change doesn't work? The pulse would be too fast to see on the display, try putting a pulselength object between the change object and the display, just so you can see it.

As for the trig outlet, you'd need you put something in the code to tell it to put out a trigger when the midi output sends.


#3

If you want to use a trigger to set toggle/bool values, you can use the object called logic/toggle.

It takes a trigger input, but outputs a held toggle/bool value.


#4

You were both correct. It was happening imperceptibly fast so the logic toggle works like a note on/off since the toggle relies on the state change. Very cool, thanks!