diff options
author | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-25 19:25:33 -0800 |
---|---|---|
committer | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-25 19:25:33 -0800 |
commit | 1000799d1ef594bf9f48076986ec300ef9e536db (patch) | |
tree | e561400e2a5f2e0c27238b1e2602164140039918 /quantum/process_keycode/process_midi.c | |
parent | 525be99ee938aa6e48448d7dd6ea6e6fe50bb36d (diff) |
Factor basic note processing into respective processors
Diffstat (limited to 'quantum/process_keycode/process_midi.c')
-rw-r--r-- | quantum/process_keycode/process_midi.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 161f04a245..214bba9020 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -1,6 +1,28 @@ #include "process_midi.h" -#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) +#ifdef MIDI_ENABLE +#include "midi.h" + +#ifdef MIDI_BASIC + +void process_midi_basic_noteon(uint8_t note) +{ + midi_send_noteon(&midi_device, 0, note, 128); +} + +void process_midi_basic_noteoff(uint8_t note) +{ + midi_send_noteoff(&midi_device, 0, note, 0); +} + +void process_midi_basic_stop_all_notes(void) +{ + midi_send_cc(&midi_device, 0, 0x7B, 0); +} + +#endif // MIDI_BASIC + +#ifdef MIDI_ADVANCED #include "timer.h" @@ -165,7 +187,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) case MI_ALLOFF: if (record->event.pressed) { midi_send_cc(&midi_device, midi_config.channel, 0x7B, 0); - dprintf("midi off\n"); + dprintf("midi all notes off\n"); } return false; case MI_SUS: @@ -212,3 +234,5 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) } #endif // MIDI_ADVANCED + +#endif // MIDI_ENABLE |