Replies: 1 comment
-
No, this is not supported using the You would have to send the messages yourself, for example: #include <Control_Surface.h>
USBMIDI_Interface midi;
MIDIAddress addr{0x3C};
Button btn{2};
void setup() {
Control_Surface.begin();
btn.begin();
}
void loop() {
Control_Surface.loop();
if (btn.update() == Button::Falling) {
for (uint8_t delta = 0; delta < 16; ++delta) { // Loop over all 16 channels
RelativeMIDIAddress offset{0, delta}; // {address, channel}
Control_Surface.sendNoteOn(addr + offset, 127);
}
}
} To make the existing MIDI elements “omni”, have a look at the Custom-MIDI-Sender.ino example. #include <Control_Surface.h>
USBMIDI_Interface midi;
class OmniNoteSender {
public:
OmniNoteSender(uint8_t onVelocity, uint8_t offVelocity)
: onVelocity(onVelocity), offVelocity(offVelocity) {}
void sendOn(MIDIAddress address) {
for (uint8_t i = 0; i < 16; ++i)
Control_Surface.sendNoteOn(address + RelativeMIDIAddress{0, i}, onVelocity);
}
void sendOff(MIDIAddress address) {
for (uint8_t i = 16; i--> 0;)
Control_Surface.sendNoteOff(address + RelativeMIDIAddress{0, i}, offVelocity);
}
private:
uint8_t onVelocity, offVelocity;
};
struct OmniNoteButton : MIDIButton<OmniNoteSender> {
OmniNoteButton(pin_t pin, MIDIAddress address,
uint8_t onVelocity = 127, uint8_t offVelocity = 127)
: MIDIButton(pin, address, {onVelocity, offVelocity}) {}
};
using namespace MIDI_Notes;
OmniNoteButton button = {
2, // button pin
note(C, 4), // MIDI address
127, // On velocity
127, // Off velocity
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
En lieu of me missing the obvious, is there an easy way to transmit on all MIDI channels ?
Looking at Channel.hpp (superficially) would suggest there isn't, but maybe I'm just missing something.
Beta Was this translation helpful? Give feedback.
All reactions