]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/process_keycode/process_midi.h
fix 'stop_all_notes' naming to be more consistent
[qmk_firmware.git] / quantum / process_keycode / process_midi.h
1 #ifndef PROCESS_MIDI_H
2 #define PROCESS_MIDI_H
3
4 #include "quantum.h"
5
6 #ifdef MIDI_ENABLE
7
8 #ifdef MIDI_BASIC
9 void process_midi_basic_noteon(uint8_t note);
10 void process_midi_basic_noteoff(uint8_t note);
11 void process_midi_all_notes_off(void);
12 #endif
13
14 #ifdef MIDI_ADVANCED
15 typedef union {
16   uint32_t raw;
17   struct {
18     uint8_t octave              :4;
19     int8_t transpose            :4;
20     uint8_t velocity            :4;
21     uint8_t channel             :4;
22     uint8_t modulation_interval :4;
23   };
24 } midi_config_t;
25
26 midi_config_t midi_config;
27
28 void midi_init(void);
29 void midi_task(void);
30 bool process_midi(uint16_t keycode, keyrecord_t *record);
31
32 #define MIDI_INVALID_NOTE 0xFF
33 #define MIDI_TONE_COUNT (MIDI_TONE_MAX - MIDI_TONE_MIN + 1)
34
35 uint8_t midi_compute_note(uint16_t keycode);
36 #endif // MIDI_ADVANCED
37
38 #endif // MIDI_ENABLE
39
40 #endif