Replies: 1 comment 3 replies
-
Why create a wrapper class MIDI_CREATE_INSTANCE(SoftwareSerial, softSerial1, MIDIA); // device A
MIDI_CREATE_INSTANCE(SoftwareSerial, softSerial2, MIDIB); // device B
MIDI_CREATE_INSTANCE(SoftwareSerial, softSerial3, MIDIC); // device C
MIDI_CREATE_INSTANCE(SoftwareSerial, softSerial4, MIDID); // device D
void setup() {
...
MIDIA.begin(MIDI_CHANNEL_OMNI); // read from all channels
MIDIB.begin(1); // read from channel 1
MIDIC.begin(2); // read from channel 2
MIDID.begin(3); // read from channel 3
...
}
void loop() {
...
MIDIA.read()
MIDIB.read()
MIDIC.read()
MIDID.read()
MIDIA.sendNoteOff(42, 0, 1);
}
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a class for hardware devices and I would like to be able to assign
a specific Midi interface for each. Before setup in the main sketch I create 4 instances of the Midi library
to be used with 4 different device objects.
In my class document I don't know the correct syntax to use in order to create a constructor than allows me to assign
one of the MIDI instances to the device object.
I did see a similar question in this issue thread, but the use case was
different enough to lead me off course. If anyone could point me in the right direction again,
I would appreciate it.
Beta Was this translation helpful? Give feedback.
All reactions