]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/process_keycode/process_midi.h
expose midi_config
[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 #include "midi.h"
6
7 typedef union {
8   uint32_t raw;
9   struct {
10     uint8_t octave              :4;
11     int8_t transpose            :4;
12     uint8_t velocity            :4;
13     uint8_t channel             :4;
14     uint8_t modulation_interval :4;
15   };
16 } midi_config_t;
17
18 midi_config_t midi_config;
19
20 void midi_init(void);
21 void midi_task(void);
22 bool process_midi(uint16_t keycode, keyrecord_t *record);
23
24 #define MIDI_INVALID_NOTE 0xFF
25 #define MIDI_TONE_COUNT (MIDI_TONE_MAX - MIDI_TONE_MIN + 1)
26
27 uint8_t midi_compute_note(uint16_t keycode);
28
29 #endif