summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_midi.c')
-rw-r--r--quantum/process_keycode/process_midi.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c
index c49c31a525..ce62559849 100644
--- a/quantum/process_keycode/process_midi.c
+++ b/quantum/process_keycode/process_midi.c
@@ -52,7 +52,7 @@ inline uint8_t compute_velocity(uint8_t setting) {
}
void midi_init(void) {
- midi_config.octave = MI_OCT_2 - MIDI_OCTAVE_MIN;
+ midi_config.octave = QK_MIDI_OCTAVE_2 - MIDI_OCTAVE_MIN;
midi_config.transpose = 0;
midi_config.velocity = 127;
midi_config.channel = 0;
@@ -103,13 +103,13 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi octave %d\n", midi_config.octave);
}
return false;
- case MI_OCTD:
+ case QK_MIDI_OCTAVE_DOWN:
if (record->event.pressed && midi_config.octave > 0) {
midi_config.octave--;
dprintf("midi octave %d\n", midi_config.octave);
}
return false;
- case MI_OCTU:
+ case QK_MIDI_OCTAVE_UP:
if (record->event.pressed && midi_config.octave < (MIDI_OCTAVE_MAX - MIDI_OCTAVE_MIN)) {
midi_config.octave++;
dprintf("midi octave %d\n", midi_config.octave);
@@ -117,18 +117,18 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
return false;
case MIDI_TRANSPOSE_MIN ... MIDI_TRANSPOSE_MAX:
if (record->event.pressed) {
- midi_config.transpose = keycode - MI_TRNS_0;
+ midi_config.transpose = keycode - QK_MIDI_TRANSPOSE_0;
dprintf("midi transpose %d\n", midi_config.transpose);
}
return false;
- case MI_TRNSD:
- if (record->event.pressed && midi_config.transpose > (MIDI_TRANSPOSE_MIN - MI_TRNS_0)) {
+ case QK_MIDI_TRANSPOSE_DOWN:
+ if (record->event.pressed && midi_config.transpose > (MIDI_TRANSPOSE_MIN - QK_MIDI_TRANSPOSE_0)) {
midi_config.transpose--;
dprintf("midi transpose %d\n", midi_config.transpose);
}
return false;
- case MI_TRNSU:
- if (record->event.pressed && midi_config.transpose < (MIDI_TRANSPOSE_MAX - MI_TRNS_0)) {
+ case QK_MIDI_TRANSPOSE_UP:
+ if (record->event.pressed && midi_config.transpose < (MIDI_TRANSPOSE_MAX - QK_MIDI_TRANSPOSE_0)) {
const bool positive = midi_config.transpose > 0;
midi_config.transpose++;
if (positive && midi_config.transpose < 0) midi_config.transpose--;
@@ -141,7 +141,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi velocity %d\n", midi_config.velocity);
}
return false;
- case MI_VELD:
+ case QK_MIDI_VELOCITY_DOWN:
if (record->event.pressed && midi_config.velocity > 0) {
if (midi_config.velocity == 127) {
midi_config.velocity -= 10;
@@ -154,7 +154,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi velocity %d\n", midi_config.velocity);
}
return false;
- case MI_VELU:
+ case QK_MIDI_VELOCITY_UP:
if (record->event.pressed && midi_config.velocity < 127) {
if (midi_config.velocity < 115) {
midi_config.velocity += 13;
@@ -170,48 +170,48 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi channel %d\n", midi_config.channel);
}
return false;
- case MI_CHD:
+ case QK_MIDI_CHANNEL_DOWN:
if (record->event.pressed) {
midi_config.channel--;
dprintf("midi channel %d\n", midi_config.channel);
}
return false;
- case MI_CHU:
+ case QK_MIDI_CHANNEL_UP:
if (record->event.pressed) {
midi_config.channel++;
dprintf("midi channel %d\n", midi_config.channel);
}
return false;
- case MI_ALLOFF:
+ case QK_MIDI_ALL_NOTES_OFF:
if (record->event.pressed) {
midi_send_cc(&midi_device, midi_config.channel, 0x7B, 0);
dprintf("midi all notes off\n");
}
return false;
- case MI_SUS:
+ case QK_MIDI_SUSTAIN:
midi_send_cc(&midi_device, midi_config.channel, 0x40, record->event.pressed ? 127 : 0);
dprintf("midi sustain %d\n", record->event.pressed);
return false;
- case MI_PORT:
+ case QK_MIDI_PORTAMENTO:
midi_send_cc(&midi_device, midi_config.channel, 0x41, record->event.pressed ? 127 : 0);
dprintf("midi portamento %d\n", record->event.pressed);
return false;
- case MI_SOST:
+ case QK_MIDI_SOSTENUTO:
midi_send_cc(&midi_device, midi_config.channel, 0x42, record->event.pressed ? 127 : 0);
dprintf("midi sostenuto %d\n", record->event.pressed);
return false;
- case MI_SOFT:
+ case QK_MIDI_SOFT:
midi_send_cc(&midi_device, midi_config.channel, 0x43, record->event.pressed ? 127 : 0);
dprintf("midi soft %d\n", record->event.pressed);
return false;
- case MI_LEG:
- midi_send_cc(&midi_device, midi_config.channel, 0x43, record->event.pressed ? 127 : 0);
+ case QK_MIDI_LEGATO:
+ midi_send_cc(&midi_device, midi_config.channel, 0x44, record->event.pressed ? 127 : 0);
dprintf("midi legato %d\n", record->event.pressed);
return false;
- case MI_MOD:
+ case QK_MIDI_MODULATION:
midi_modulation_step = record->event.pressed ? 1 : -1;
return false;
- case MI_MODSD:
+ case QK_MIDI_MODULATION_SPEED_DOWN:
if (record->event.pressed) {
midi_config.modulation_interval++;
// prevent overflow
@@ -219,13 +219,13 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi modulation interval %d\n", midi_config.modulation_interval);
}
return false;
- case MI_MODSU:
+ case QK_MIDI_MODULATION_SPEED_UP:
if (record->event.pressed && midi_config.modulation_interval > 0) {
midi_config.modulation_interval--;
dprintf("midi modulation interval %d\n", midi_config.modulation_interval);
}
return false;
- case MI_BENDD:
+ case QK_MIDI_PITCH_BEND_DOWN:
if (record->event.pressed) {
midi_send_pitchbend(&midi_device, midi_config.channel, -0x2000);
dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, -0x2000);
@@ -234,7 +234,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0);
}
return false;
- case MI_BENDU:
+ case QK_MIDI_PITCH_BEND_UP:
if (record->event.pressed) {
midi_send_pitchbend(&midi_device, midi_config.channel, 0x1fff);
dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0x1fff);