diff --git a/examples/CustomBaudRate/CustomBaudRate.ino b/examples/CustomBaudRate/CustomBaudRate.ino index 912eabbf..d554871d 100644 --- a/examples/CustomBaudRate/CustomBaudRate.ino +++ b/examples/CustomBaudRate/CustomBaudRate.ino @@ -2,16 +2,17 @@ // Override the default MIDI baudrate to // a decoding program such as Hairless MIDI (set baudrate to 115200) - -struct CustomBaudRate : public MIDI_NAMESPACE::DefaultSettings { +struct CustomBaudRateSettings : public MIDI_NAMESPACE::DefaultSerialSettings { static const long BaudRate = 115200; }; #if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__) // Leonardo, Due and other USB boards use Serial1 by default. - MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, CustomBaudRate); + MIDI_NAMESPACE::SerialMIDI serialMIDI(Serial1); + MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); #else - MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, CustomBaudRate); + MIDI_NAMESPACE::SerialMIDI serialMIDI(Serial); + MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); #endif void setup() { @@ -28,4 +29,4 @@ void loop() { MIDI.sendNoteOff(42, 0, 1); // Stop the note digitalWrite(LED_BUILTIN, LOW); } -} \ No newline at end of file +}