aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Young <gabeplaysdrums@live.com>2017-02-25 20:41:13 -0800
committerGabriel Young <gabeplaysdrums@live.com>2017-02-25 20:41:13 -0800
commita64ae1066250d3aafb6e9670bf617237ec4338e7 (patch)
tree9d91360888e2f14c7d7fe84d0a821c629a7340d3
parentea14ed122fb5c1b3be5f5d6edda9b39b151692e5 (diff)
downloadqmk_firmware-a64ae1066250d3aafb6e9670bf617237ec4338e7.tar.gz
qmk_firmware-a64ae1066250d3aafb6e9670bf617237ec4338e7.zip
Update existing keymaps
Update existing keymaps to enable MIDI_BASIC functionality. Also added an option MIDI_ENABLE_STRICT to be strict about keycode use (which also reduces memory footprint at runtime)
-rw-r--r--keyboards/planck/keymaps/dbroqua/config.h29
-rw-r--r--keyboards/planck/keymaps/default/config.h29
-rw-r--r--keyboards/planck/keymaps/experimental/config.h23
-rw-r--r--keyboards/planck/keymaps/impossible/config.h29
-rw-r--r--keyboards/planck/keymaps/jeebak/config.h29
-rw-r--r--keyboards/planck/keymaps/jhenahan/config.h23
-rw-r--r--keyboards/planck/keymaps/premek/config.h29
-rw-r--r--keyboards/planck/keymaps/sgoodwin/config.h29
-rw-r--r--keyboards/planck/keymaps/smt/config.h29
-rw-r--r--keyboards/planck/keymaps/thermal_printer/config.h23
-rw-r--r--keyboards/planck/keymaps/unicode/config.h29
-rw-r--r--keyboards/planck/keymaps/xyverz/config.h29
-rw-r--r--keyboards/preonic/keymaps/CMD-Preonic/config.h29
-rw-r--r--keyboards/preonic/keymaps/default/config.h29
-rw-r--r--keyboards/preonic/keymaps/smt/config.h29
-rw-r--r--keyboards/satan/keymaps/midi/config.h3
-rw-r--r--keyboards/subatomic/keymaps/default/config.h29
-rw-r--r--quantum/process_keycode/process_audio.c4
-rw-r--r--quantum/process_keycode/process_music.c2
-rw-r--r--quantum/process_keycode/process_music.h1
-rw-r--r--quantum/quantum.c4
-rw-r--r--quantum/quantum_keycodes.h28
-rw-r--r--quantum/template/config.h3
23 files changed, 472 insertions, 19 deletions
diff --git a/keyboards/planck/keymaps/dbroqua/config.h b/keyboards/planck/keymaps/dbroqua/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/dbroqua/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/default/config.h b/keyboards/planck/keymaps/default/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/default/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h
index cc093bee4..492490ca1 100644
--- a/keyboards/planck/keymaps/experimental/config.h
+++ b/keyboards/planck/keymaps/experimental/config.h
@@ -14,4 +14,27 @@
14#define RGBLIGHT_HUE_STEP 10 14#define RGBLIGHT_HUE_STEP 10
15#define RGBLIGHT_SAT_STEP 17 15#define RGBLIGHT_SAT_STEP 17
16 16
17/*
18 * MIDI options
19 */
20
21/* Prevent use of disabled MIDI features in the keymap */
22//#define MIDI_ENABLE_STRICT 1
23
24/* enable basic MIDI features:
25 - MIDI notes can be sent when in Music mode is on
26*/
27#define MIDI_BASIC
28
29/* enable advanced MIDI features:
30 - MIDI notes can be added to the keymap
31 - Octave shift and transpose
32 - Virtual sustain, portamento, and modulation wheel
33 - etc.
34*/
35//#define MIDI_ADVANCED
36
37/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
38//#define MIDI_TONE_KEYCODE_OCTAVES 2
39
17#endif 40#endif
diff --git a/keyboards/planck/keymaps/impossible/config.h b/keyboards/planck/keymaps/impossible/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/impossible/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/jeebak/config.h b/keyboards/planck/keymaps/jeebak/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/jeebak/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/jhenahan/config.h b/keyboards/planck/keymaps/jhenahan/config.h
index cd3adc41c..1e42b92b9 100644
--- a/keyboards/planck/keymaps/jhenahan/config.h
+++ b/keyboards/planck/keymaps/jhenahan/config.h
@@ -6,4 +6,27 @@
6#define FORCE_NKRO 6#define FORCE_NKRO
7#define WORKMAN_SOUND COLEMAK_SOUND 7#define WORKMAN_SOUND COLEMAK_SOUND
8 8
9/*
10 * MIDI options
11 */
12
13/* Prevent use of disabled MIDI features in the keymap */
14//#define MIDI_ENABLE_STRICT 1
15
16/* enable basic MIDI features:
17 - MIDI notes can be sent when in Music mode is on
18*/
19#define MIDI_BASIC
20
21/* enable advanced MIDI features:
22 - MIDI notes can be added to the keymap
23 - Octave shift and transpose
24 - Virtual sustain, portamento, and modulation wheel
25 - etc.
26*/
27//#define MIDI_ADVANCED
28
29/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
30//#define MIDI_TONE_KEYCODE_OCTAVES 2
31
9#endif 32#endif
diff --git a/keyboards/planck/keymaps/premek/config.h b/keyboards/planck/keymaps/premek/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/premek/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/sgoodwin/config.h b/keyboards/planck/keymaps/sgoodwin/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/sgoodwin/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/smt/config.h b/keyboards/planck/keymaps/smt/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/smt/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h
index 430b6493c..bcd098930 100644
--- a/keyboards/planck/keymaps/thermal_printer/config.h
+++ b/keyboards/planck/keymaps/thermal_printer/config.h
@@ -20,4 +20,27 @@
20 sei(); \ 20 sei(); \
21 } while(0) 21 } while(0)
22 22
23/*
24 * MIDI options
25 */
26
27/* Prevent use of disabled MIDI features in the keymap */
28//#define MIDI_ENABLE_STRICT 1
29
30/* enable basic MIDI features:
31 - MIDI notes can be sent when in Music mode is on
32*/
33#define MIDI_BASIC
34
35/* enable advanced MIDI features:
36 - MIDI notes can be added to the keymap
37 - Octave shift and transpose
38 - Virtual sustain, portamento, and modulation wheel
39 - etc.
40*/
41//#define MIDI_ADVANCED
42
43/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
44//#define MIDI_TONE_KEYCODE_OCTAVES 2
45
23 #endif \ No newline at end of file 46 #endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/unicode/config.h b/keyboards/planck/keymaps/unicode/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/unicode/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/xyverz/config.h b/keyboards/planck/keymaps/xyverz/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/planck/keymaps/xyverz/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/CMD-Preonic/config.h b/keyboards/preonic/keymaps/CMD-Preonic/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/CMD-Preonic/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/default/config.h b/keyboards/preonic/keymaps/default/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/default/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/smt/config.h b/keyboards/preonic/keymaps/smt/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/smt/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/satan/keymaps/midi/config.h b/keyboards/satan/keymaps/midi/config.h
index 59250b49e..8e10b04ec 100644
--- a/keyboards/satan/keymaps/midi/config.h
+++ b/keyboards/satan/keymaps/midi/config.h
@@ -7,6 +7,9 @@
7 * MIDI options 7 * MIDI options
8 */ 8 */
9 9
10/* Prevent use of disabled MIDI features in the keymap */
11#define MIDI_ENABLE_STRICT 1
12
10/* enable basic MIDI features: 13/* enable basic MIDI features:
11 - MIDI notes can be sent when in Music mode is on 14 - MIDI notes can be sent when in Music mode is on
12*/ 15*/
diff --git a/keyboards/subatomic/keymaps/default/config.h b/keyboards/subatomic/keymaps/default/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/subatomic/keymaps/default/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c
index d45242c9e..71c0297ee 100644
--- a/quantum/process_keycode/process_audio.c
+++ b/quantum/process_keycode/process_audio.c
@@ -1,5 +1,5 @@
1#include "process_audio.h"
2#include "audio.h" 1#include "audio.h"
2#include "process_audio.h"
3 3
4static float compute_freq_for_midi_note(uint8_t note) 4static float compute_freq_for_midi_note(uint8_t note)
5{ 5{
@@ -43,7 +43,7 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) {
43 return false; 43 return false;
44 } 44 }
45 45
46 return true 46 return true;
47} 47}
48 48
49void process_audio_noteon(uint8_t note) { 49void process_audio_noteon(uint8_t note) {
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c
index 43bcf973e..4b86b91f0 100644
--- a/quantum/process_keycode/process_music.c
+++ b/quantum/process_keycode/process_music.c
@@ -42,7 +42,7 @@ static void music_noteoff(uint8_t note) {
42 #endif 42 #endif
43} 43}
44 44
45static void music_all_notes_off(void) { 45void music_all_notes_off(void) {
46 #ifdef AUDIO_ENABLE 46 #ifdef AUDIO_ENABLE
47 process_audio_stop_all_notes(); 47 process_audio_stop_all_notes();
48 #endif 48 #endif
diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h
index 69913b276..a36514a44 100644
--- a/quantum/process_keycode/process_music.h
+++ b/quantum/process_keycode/process_music.h
@@ -14,6 +14,7 @@ void music_off(void);
14 14
15void music_on_user(void); 15void music_on_user(void);
16void music_scale_user(void); 16void music_scale_user(void);
17void music_all_notes_off(void);
17 18
18void matrix_scan_music(void); 19void matrix_scan_music(void);
19 20
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 7a27a568a..a4a12061b 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -95,8 +95,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
95 95
96void reset_keyboard(void) { 96void reset_keyboard(void) {
97 clear_keyboard(); 97 clear_keyboard();
98#ifdef AUDIO_ENABLE 98#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_ENABLE_BASIC))
99 stop_all_notes(); 99 music_all_notes_off();
100 shutdown_user(); 100 shutdown_user();
101#endif 101#endif
102 wait_ms(250); 102 wait_ms(250);
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 3b82b7208..56228f276 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -1,8 +1,11 @@
1
2#ifndef QUANTUM_KEYCODES_H 1#ifndef QUANTUM_KEYCODES_H
3#define QUANTUM_KEYCODES_H 2#define QUANTUM_KEYCODES_H
4 3
5#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) 4#ifndef MIDI_ENABLE_STRICT
5#define MIDI_ENABLE_STRICT 0
6#endif
7
8#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
6#ifndef MIDI_TONE_KEYCODE_OCTAVES 9#ifndef MIDI_TONE_KEYCODE_OCTAVES
7#define MIDI_TONE_KEYCODE_OCTAVES 3 10#define MIDI_TONE_KEYCODE_OCTAVES 3
8#endif 11#endif
@@ -113,18 +116,16 @@ enum quantum_keycodes {
113 MUV_IN, 116 MUV_IN,
114 MUV_DE, 117 MUV_DE,
115 118
116#ifdef MIDI_ENABLE
117 // Midi 119 // Midi
118 120#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
119#ifdef MIDI_BASIC
120 MI_ON, // send midi notes when music mode is enabled 121 MI_ON, // send midi notes when music mode is enabled
121 MI_OFF, // don't send midi notes when music mode is enabled 122 MI_OFF, // don't send midi notes when music mode is enabled
122#endif 123#endif
123 124
124#ifdef MIDI_ADVANCED 125#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
125 MIDI_TONE_MIN, 126 MIDI_TONE_MIN,
126 127
127#if MIDI_TONE_KEYCODE_OCTAVES > 0 128#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 0
128 MI_C = MIDI_TONE_MIN, 129 MI_C = MIDI_TONE_MIN,
129 MI_Cs, 130 MI_Cs,
130 MI_Db = MI_Cs, 131 MI_Db = MI_Cs,
@@ -144,7 +145,7 @@ enum quantum_keycodes {
144 MI_B, 145 MI_B,
145#endif 146#endif
146 147
147#if MIDI_TONE_KEYCODE_OCTAVES > 1 148#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 1
148 MI_C_1, 149 MI_C_1,
149 MI_Cs_1, 150 MI_Cs_1,
150 MI_Db_1 = MI_Cs_1, 151 MI_Db_1 = MI_Cs_1,
@@ -164,7 +165,7 @@ enum quantum_keycodes {
164 MI_B_1, 165 MI_B_1,
165#endif 166#endif
166 167
167#if MIDI_TONE_KEYCODE_OCTAVES > 2 168#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 2
168 MI_C_2, 169 MI_C_2,
169 MI_Cs_2, 170 MI_Cs_2,
170 MI_Db_2 = MI_Cs_2, 171 MI_Db_2 = MI_Cs_2,
@@ -184,7 +185,7 @@ enum quantum_keycodes {
184 MI_B_2, 185 MI_B_2,
185#endif 186#endif
186 187
187#if MIDI_TONE_KEYCODE_OCTAVES > 3 188#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 3
188 MI_C_3, 189 MI_C_3,
189 MI_Cs_3, 190 MI_Cs_3,
190 MI_Db_3 = MI_Cs_3, 191 MI_Db_3 = MI_Cs_3,
@@ -204,7 +205,7 @@ enum quantum_keycodes {
204 MI_B_3, 205 MI_B_3,
205#endif 206#endif
206 207
207#if MIDI_TONE_KEYCODE_OCTAVES > 4 208#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 4
208 MI_C_4, 209 MI_C_4,
209 MI_Cs_4, 210 MI_Cs_4,
210 MI_Db_4 = MI_Cs_4, 211 MI_Db_4 = MI_Cs_4,
@@ -224,7 +225,7 @@ enum quantum_keycodes {
224 MI_B_4, 225 MI_B_4,
225#endif 226#endif
226 227
227#if MIDI_TONE_KEYCODE_OCTAVES > 5 228#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
228 MI_C_5, 229 MI_C_5,
229 MI_Cs_5, 230 MI_Cs_5,
230 MI_Db_5 = MI_Cs_5, 231 MI_Db_5 = MI_Cs_5,
@@ -244,7 +245,7 @@ enum quantum_keycodes {
244 MI_B_5, 245 MI_B_5,
245#endif 246#endif
246 247
247#if MIDI_TONE_KEYCODE_OCTAVES > 5 248#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
248 MIDI_TONE_MAX = MI_B_5, 249 MIDI_TONE_MAX = MI_B_5,
249#elif MIDI_TONE_KEYCODE_OCTAVES > 4 250#elif MIDI_TONE_KEYCODE_OCTAVES > 4
250 MIDI_TONE_MAX = MI_B_4, 251 MIDI_TONE_MAX = MI_B_4,
@@ -339,7 +340,6 @@ enum quantum_keycodes {
339 MI_MODSD, // decrease modulation speed 340 MI_MODSD, // decrease modulation speed
340 MI_MODSU, // increase modulation speed 341 MI_MODSU, // increase modulation speed
341#endif // MIDI_ADVANCED 342#endif // MIDI_ADVANCED
342#endif // MIDI_ENABLE
343 343
344 // Backlight functionality 344 // Backlight functionality
345 BL_0, 345 BL_0,
diff --git a/quantum/template/config.h b/quantum/template/config.h
index 54db4f242..7393097e1 100644
--- a/quantum/template/config.h
+++ b/quantum/template/config.h
@@ -163,6 +163,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
163 * MIDI options 163 * MIDI options
164 */ 164 */
165 165
166/* Prevent use of disabled MIDI features in the keymap */
167//#define MIDI_ENABLE_STRICT 1
168
166/* enable basic MIDI features: 169/* enable basic MIDI features:
167 - MIDI notes can be sent when in Music mode is on 170 - MIDI notes can be sent when in Music mode is on
168*/ 171*/