Skip to content

Commit 6835ae8

Browse files
drashnajackhumbert
authored andcommitted
Add the ability to disable Music Mode completely (#2339)
* Skip process_music in NO_MUSIC_MODE is defined * Skip matrix_scan_music if NO_MUSIC_MODE is defined * Skip music_all_notes_off if NO_MUSIC_MODE is defined * Leave matrix_scan_music in, because it reduces firmware size by 150b.... * Add docs for NO_MUSIC_MODE
1 parent c5d81a8 commit 6835ae8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/feature_audio.md

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, a
8282

8383
#define PITCH_STANDARD_A 432.0f
8484

85+
You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `confid.h`:
86+
87+
#define NO_MUSIC_MODE
88+
8589
## MIDI Functionality
8690

8791
This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.

keyboards/orthodox/keymaps/drashna/config.h

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6969
#ifdef AUDIO_ENABLE
7070
#define C6_AUDIO
7171
#define STARTUP_SONG SONG(IMPERIAL_MARCH)
72+
#define NO_MUSIC_MODE
7273
#endif
7374

7475
#undef PRODUCT

quantum/quantum.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void reset_keyboard(void) {
147147
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
148148
process_midi_all_notes_off();
149149
#endif
150-
#if defined(AUDIO_ENABLE)
150+
#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
151151
music_all_notes_off();
152152
uint16_t timer_start = timer_read();
153153
PLAY_SONG(goodbye_song);
@@ -236,7 +236,7 @@ bool process_record_quantum(keyrecord_t *record) {
236236
#ifdef STENO_ENABLE
237237
process_steno(keycode, record) &&
238238
#endif
239-
#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
239+
#if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE)
240240
process_music(keycode, record) &&
241241
#endif
242242
#ifdef TAP_DANCE_ENABLE
@@ -834,7 +834,7 @@ void matrix_init_quantum() {
834834
}
835835

836836
void matrix_scan_quantum() {
837-
#ifdef AUDIO_ENABLE
837+
#if defined(AUDIO_ENABLE)
838838
matrix_scan_music();
839839
#endif
840840

0 commit comments

Comments
 (0)