aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_music.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c
index 217dca280..c01740a7f 100644
--- a/quantum/process_keycode/process_music.c
+++ b/quantum/process_keycode/process_music.c
@@ -39,6 +39,15 @@ static uint8_t music_sequence_position = 0;
39static uint16_t music_sequence_timer = 0; 39static uint16_t music_sequence_timer = 0;
40static uint16_t music_sequence_interval = 100; 40static uint16_t music_sequence_interval = 100;
41 41
42#ifndef MUSIC_ON_SONG
43 #define MUSIC_ON_SONG SONG(MUSIC_ON_SOUND)
44#endif
45#ifndef MUSIC_OFF_SONG
46 #define MUSIC_OFF_SONG SONG(MUSIC_OFF_SOUND)
47#endif
48float music_on_song[][2] = MUSIC_ON_SONG;
49float music_off_song[][2] = MUSIC_OFF_SONG;
50
42static void music_noteon(uint8_t note) { 51static void music_noteon(uint8_t note) {
43 #ifdef AUDIO_ENABLE 52 #ifdef AUDIO_ENABLE
44 process_audio_noteon(note); 53 process_audio_noteon(note);
@@ -79,12 +88,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
79 } 88 }
80 89
81 if (keycode == MU_TOG && record->event.pressed) { 90 if (keycode == MU_TOG && record->event.pressed) {
82 if (music_activated) 91 if (music_activated) {
83 {
84 music_off(); 92 music_off();
85 } 93 } else {
86 else
87 {
88 music_on(); 94 music_on();
89 } 95 }
90 return false; 96 return false;
@@ -175,12 +181,14 @@ void music_toggle(void) {
175 181
176void music_on(void) { 182void music_on(void) {
177 music_activated = 1; 183 music_activated = 1;
184 PLAY_SONG(music_on_song);
178 music_on_user(); 185 music_on_user();
179} 186}
180 187
181void music_off(void) { 188void music_off(void) {
182 music_activated = 0;
183 music_all_notes_off(); 189 music_all_notes_off();
190 music_activated = 0;
191 PLAY_SONG(music_off_song);
184} 192}
185 193
186void matrix_scan_music(void) { 194void matrix_scan_music(void) {