diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | keyboards/lets_split/config.h | 4 | ||||
-rw-r--r-- | keyboards/planck/keymaps/default/Makefile | 2 | ||||
-rw-r--r-- | quantum/keymap_common.c | 2 | ||||
-rw-r--r-- | quantum/process_keycode/process_midi.c | 24 |
5 files changed, 17 insertions, 17 deletions
@@ -181,7 +181,7 @@ endif | |||
181 | 181 | ||
182 | ifeq ($(strip $(MIDI_ENABLE)), yes) | 182 | ifeq ($(strip $(MIDI_ENABLE)), yes) |
183 | OPT_DEFS += -DMIDI_ENABLE | 183 | OPT_DEFS += -DMIDI_ENABLE |
184 | SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c | 184 | SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c |
185 | endif | 185 | endif |
186 | 186 | ||
187 | ifeq ($(strip $(AUDIO_ENABLE)), yes) | 187 | ifeq ($(strip $(AUDIO_ENABLE)), yes) |
diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index 833818ce6..ec99514aa 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h | |||
@@ -69,9 +69,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
69 | ) | 69 | ) |
70 | 70 | ||
71 | /* ws2812 RGB LED */ | 71 | /* ws2812 RGB LED */ |
72 | #define RGB_DI_PIN D2 | 72 | #define RGB_DI_PIN D4 |
73 | #define RGBLIGHT_TIMER | 73 | #define RGBLIGHT_TIMER |
74 | #define RGBLED_NUM 28 // Number of LEDs | 74 | #define RGBLED_NUM 8 // Number of LEDs |
75 | #define RGBLIGHT_HUE_STEP 10 | 75 | #define RGBLIGHT_HUE_STEP 10 |
76 | #define RGBLIGHT_SAT_STEP 17 | 76 | #define RGBLIGHT_SAT_STEP 17 |
77 | #define RGBLIGHT_VAL_STEP 17 | 77 | #define RGBLIGHT_VAL_STEP 17 |
diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile index 581e08cd0..38a504a27 100644 --- a/keyboards/planck/keymaps/default/Makefile +++ b/keyboards/planck/keymaps/default/Makefile | |||
@@ -11,7 +11,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) | |||
11 | COMMAND_ENABLE = yes # Commands for debug and configuration | 11 | COMMAND_ENABLE = yes # Commands for debug and configuration |
12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
13 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 13 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality |
14 | MIDI_ENABLE = no # MIDI controls | 14 | MIDI_ENABLE = yes # MIDI controls |
15 | AUDIO_ENABLE = yes # Audio output on port C6 | 15 | AUDIO_ENABLE = yes # Audio output on port C6 |
16 | UNICODE_ENABLE = no # Unicode | 16 | UNICODE_ENABLE = no # Unicode |
17 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 17 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index d0a8312c1..833e5a8f8 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c | |||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
30 | #include "quantum.h" | 30 | #include "quantum.h" |
31 | 31 | ||
32 | #ifdef MIDI_ENABLE | 32 | #ifdef MIDI_ENABLE |
33 | #include "keymap_midi.h" | 33 | #include "process_midi.h" |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | extern keymap_config_t keymap_config; | 36 | extern keymap_config_t keymap_config; |
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index d6ab9c626..8784e64f3 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c | |||
@@ -1,8 +1,8 @@ | |||
1 | #include "process_midi.h" | 1 | #include "process_midi.h" |
2 | 2 | ||
3 | bool midi_activated = false; | 3 | bool midi_activated = false; |
4 | uint8_t starting_note = 0x0C; | 4 | uint8_t midi_starting_note = 0x0C; |
5 | int offset = 7; | 5 | int midi_offset = 7; |
6 | 6 | ||
7 | bool process_midi(uint16_t keycode, keyrecord_t *record) { | 7 | bool process_midi(uint16_t keycode, keyrecord_t *record) { |
8 | if (keycode == MI_ON && record->event.pressed) { | 8 | if (keycode == MI_ON && record->event.pressed) { |
@@ -20,42 +20,42 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { | |||
20 | if (midi_activated) { | 20 | if (midi_activated) { |
21 | if (record->event.key.col == (MATRIX_COLS - 1) && record->event.key.row == (MATRIX_ROWS - 1)) { | 21 | if (record->event.key.col == (MATRIX_COLS - 1) && record->event.key.row == (MATRIX_ROWS - 1)) { |
22 | if (record->event.pressed) { | 22 | if (record->event.pressed) { |
23 | starting_note++; // Change key | 23 | midi_starting_note++; // Change key |
24 | midi_send_cc(&midi_device, 0, 0x7B, 0); | 24 | midi_send_cc(&midi_device, 0, 0x7B, 0); |
25 | } | 25 | } |
26 | return false; | 26 | return false; |
27 | } | 27 | } |
28 | if (record->event.key.col == (MATRIX_COLS - 2) && record->event.key.row == (MATRIX_ROWS - 1)) { | 28 | if (record->event.key.col == (MATRIX_COLS - 2) && record->event.key.row == (MATRIX_ROWS - 1)) { |
29 | if (record->event.pressed) { | 29 | if (record->event.pressed) { |
30 | starting_note--; // Change key | 30 | midi_starting_note--; // Change key |
31 | midi_send_cc(&midi_device, 0, 0x7B, 0); | 31 | midi_send_cc(&midi_device, 0, 0x7B, 0); |
32 | } | 32 | } |
33 | return false; | 33 | return false; |
34 | } | 34 | } |
35 | if (record->event.key.col == (MATRIX_COLS - 3) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { | 35 | if (record->event.key.col == (MATRIX_COLS - 3) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { |
36 | offset++; // Change scale | 36 | midi_offset++; // Change scale |
37 | midi_send_cc(&midi_device, 0, 0x7B, 0); | 37 | midi_send_cc(&midi_device, 0, 0x7B, 0); |
38 | return false; | 38 | return false; |
39 | } | 39 | } |
40 | if (record->event.key.col == (MATRIX_COLS - 4) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { | 40 | if (record->event.key.col == (MATRIX_COLS - 4) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { |
41 | offset--; // Change scale | 41 | midi_offset--; // Change scale |
42 | midi_send_cc(&midi_device, 0, 0x7B, 0); | 42 | midi_send_cc(&midi_device, 0, 0x7B, 0); |
43 | return false; | 43 | return false; |
44 | } | 44 | } |
45 | // basic | 45 | // basic |
46 | // uint8_t note = (starting_note + SCALE[record->event.key.col + offset])+12*(MATRIX_ROWS - record->event.key.row); | 46 | // uint8_t note = (midi_starting_note + SCALE[record->event.key.col + midi_offset])+12*(MATRIX_ROWS - record->event.key.row); |
47 | // advanced | 47 | // advanced |
48 | // uint8_t note = (starting_note + record->event.key.col + offset)+12*(MATRIX_ROWS - record->event.key.row); | 48 | // uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+12*(MATRIX_ROWS - record->event.key.row); |
49 | // guitar | 49 | // guitar |
50 | uint8_t note = (starting_note + record->event.key.col + offset)+5*(MATRIX_ROWS - record->event.key.row); | 50 | uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+5*(MATRIX_ROWS - record->event.key.row); |
51 | // violin | 51 | // violin |
52 | // uint8_t note = (starting_note + record->event.key.col + offset)+7*(MATRIX_ROWS - record->event.key.row); | 52 | // uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+7*(MATRIX_ROWS - record->event.key.row); |
53 | 53 | ||
54 | if (record->event.pressed) { | 54 | if (record->event.pressed) { |
55 | // midi_send_noteon(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127); | 55 | // midi_send_noteon(&midi_device, record->event.key.row, midi_starting_note + SCALE[record->event.key.col], 127); |
56 | midi_send_noteon(&midi_device, 0, note, 127); | 56 | midi_send_noteon(&midi_device, 0, note, 127); |
57 | } else { | 57 | } else { |
58 | // midi_send_noteoff(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127); | 58 | // midi_send_noteoff(&midi_device, record->event.key.row, midi_starting_note + SCALE[record->event.key.col], 127); |
59 | midi_send_noteoff(&midi_device, 0, note, 127); | 59 | midi_send_noteoff(&midi_device, 0, note, 127); |
60 | } | 60 | } |
61 | 61 | ||