diff options
| -rw-r--r-- | quantum/process_keycode/process_midi.c | 20 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 9728076df..a67f73628 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c | |||
| @@ -222,6 +222,26 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) | |||
| 222 | dprintf("midi modulation interval %d\n", midi_config.modulation_interval); | 222 | dprintf("midi modulation interval %d\n", midi_config.modulation_interval); |
| 223 | } | 223 | } |
| 224 | return false; | 224 | return false; |
| 225 | case MI_BENDD: | ||
| 226 | if (record->event.pressed) { | ||
| 227 | midi_send_pitchbend(&midi_device, midi_config.channel, -0x2000); | ||
| 228 | dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, -0x2000); | ||
| 229 | } | ||
| 230 | else { | ||
| 231 | midi_send_pitchbend(&midi_device, midi_config.channel, 0); | ||
| 232 | dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0); | ||
| 233 | } | ||
| 234 | return false; | ||
| 235 | case MI_BENDU: | ||
| 236 | if (record->event.pressed) { | ||
| 237 | midi_send_pitchbend(&midi_device, midi_config.channel, 0x1fff); | ||
| 238 | dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0x1fff); | ||
| 239 | } | ||
| 240 | else { | ||
| 241 | midi_send_pitchbend(&midi_device, midi_config.channel, 0); | ||
| 242 | dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0); | ||
| 243 | } | ||
| 244 | return false; | ||
| 225 | }; | 245 | }; |
| 226 | 246 | ||
| 227 | return true; | 247 | return true; |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 8122bfe73..d545440c9 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
| @@ -383,6 +383,9 @@ enum quantum_keycodes { | |||
| 383 | MI_MOD, // modulation | 383 | MI_MOD, // modulation |
| 384 | MI_MODSD, // decrease modulation speed | 384 | MI_MODSD, // decrease modulation speed |
| 385 | MI_MODSU, // increase modulation speed | 385 | MI_MODSU, // increase modulation speed |
| 386 | |||
| 387 | MI_BENDD, // Bend down | ||
| 388 | MI_BENDU, // Bend up | ||
| 386 | #endif // MIDI_ADVANCED | 389 | #endif // MIDI_ADVANCED |
| 387 | 390 | ||
| 388 | // Backlight functionality | 391 | // Backlight functionality |
