DISCLAIMER I noticed this issue has already been fixed in #154 , but since the commit is quite old and there has not been a release for years, I’m posting this bug report anyway as a note for other users of the latest release (5.0.1); it can be closed once a release containing the fix is available.
Context
- What board are you using?
- ESP32 NodeMCU-32S
- Hardware MIDI via Serial2
- What version of the Arduino IDE are you using?
- PlatformIO with Arduino framework
- How are you using MIDI?
- Is your problem related to:
- How comfortable are you with code?
Describe your project and what you expect to happen
I am using the Arduino MIDI Library with custom settings for a HardwareSerial MIDI input.
I expect MIDI_CREATE_CUSTOM_INSTANCE(...) to apply my custom settings to the MIDI parser as well as the serial transport, or to clearly support separate settings for both.
Describe your problem (what does not work)
MIDI_CREATE_CUSTOM_INSTANCE(...) only forwards the custom settings to SerialMIDI, but not to MidiInterface.
As a result, parser settings like Use1ByteParsing = false are ignored unless I modify midi_Settings.h directly.
This makes the custom settings API incomplete and inconsistent.
Steps to reproduce
- Define a custom settings class derived from
midi::DefaultSettings
- Set
Use1ByteParsing = false
- Create the instance with
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial2, MIDI, MyMIDISettings)
- Call
read()
- Observe that the parser still behaves as if
DefaultSettings were used
Expected behavior
Custom settings passed to the macro should also be used by MidiInterface, or the macro should support two explicit settings classes: one for MidiInterface and one for SerialMIDI.
Context
Describe your project and what you expect to happen
I am using the Arduino MIDI Library with custom settings for a HardwareSerial MIDI input.
I expect
MIDI_CREATE_CUSTOM_INSTANCE(...)to apply my custom settings to the MIDI parser as well as the serial transport, or to clearly support separate settings for both.Describe your problem (what does not work)
MIDI_CREATE_CUSTOM_INSTANCE(...)only forwards the custom settings toSerialMIDI, but not toMidiInterface.As a result, parser settings like
Use1ByteParsing = falseare ignored unless I modifymidi_Settings.hdirectly.This makes the custom settings API incomplete and inconsistent.
Steps to reproduce
midi::DefaultSettingsUse1ByteParsing = falseMIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial2, MIDI, MyMIDISettings)read()DefaultSettingswere usedExpected behavior
Custom settings passed to the macro should also be used by
MidiInterface, or the macro should support two explicit settings classes: one forMidiInterfaceand one forSerialMIDI.