FortySevenEffects / arduino_midi_library

MIDI for Arduino
MIT License
1.56k stars 252 forks source link

Add Bank Select LSB enum (0x20) to MidiControlChangeNumber #259

Closed muxa closed 2 years ago

muxa commented 2 years ago

Is your feature request related to a problem? Please describe. I want to use MidiControlChangeNumber enum to detect controller changes, and one of the controllers I'm missing is Bank Change LSB (0x20).

Describe the solution you'd like Add BankSelectLSB = 32 to MidiControlChangeNumber enum.

Describe alternatives you've considered I am using a literal value 0x20 but it would be nice to have consistency.

Additional context MIDI controller change reference: https://www.recordingblogs.com/wiki/midi-controller-message

franky47 commented 2 years ago

That would be a great addition indeed, along with all the other missing definitions: http://www.somascape.org/midi/tech/spec.html#ctrlnums

Would you like to open a Pull Request ?

franky47 commented 2 years ago

Note: a function to send high resolution controllers would also be a great addition. It would handle:

Example API:

const unsigned int value = 8192; // half way
const byte channel = 1;
MIDI.sendHighResolutionControlChange(midi::ModulationWheel, value, channel);
muxa commented 2 years ago

I'll open a PR to adding new definitions.

I don't have a test rig to test MIDI out yet, so your other suggestion is out of scope for now 😄

franky47 commented 2 years ago

You can add a unit test here: https://github.com/FortySevenEffects/arduino_midi_library/blob/master/test/unit-tests/tests/unit-tests_MidiOutput.cpp