aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_audio.c')
-rw-r--r--quantum/process_keycode/process_audio.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c
index 0b6380ed3..eb74796fa 100644
--- a/quantum/process_keycode/process_audio.c
+++ b/quantum/process_keycode/process_audio.c
@@ -1,6 +1,11 @@
1#include "audio.h" 1#include "audio.h"
2#include "process_audio.h" 2#include "process_audio.h"
3 3
4#ifndef VOICE_CHANGE_SONG
5 #define VOICE_CHANGE_SONG SONG(VOICE_CHANGE_SOUND)
6#endif
7float voice_change_song[][2] = VOICE_CHANGE_SONG;
8
4static float compute_freq_for_midi_note(uint8_t note) 9static float compute_freq_for_midi_note(uint8_t note)
5{ 10{
6 // https://en.wikipedia.org/wiki/MIDI_tuning_standard 11 // https://en.wikipedia.org/wiki/MIDI_tuning_standard
@@ -20,12 +25,9 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) {
20 } 25 }
21 26
22 if (keycode == AU_TOG && record->event.pressed) { 27 if (keycode == AU_TOG && record->event.pressed) {
23 if (is_audio_on()) 28 if (is_audio_on()) {
24 {
25 audio_off(); 29 audio_off();
26 } 30 } else {
27 else
28 {
29 audio_on(); 31 audio_on();
30 } 32 }
31 return false; 33 return false;
@@ -33,13 +35,13 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) {
33 35
34 if (keycode == MUV_IN && record->event.pressed) { 36 if (keycode == MUV_IN && record->event.pressed) {
35 voice_iterate(); 37 voice_iterate();
36 music_scale_user(); 38 PLAY_SONG(voice_change_song);
37 return false; 39 return false;
38 } 40 }
39 41
40 if (keycode == MUV_DE && record->event.pressed) { 42 if (keycode == MUV_DE && record->event.pressed) {
41 voice_deiterate(); 43 voice_deiterate();
42 music_scale_user(); 44 PLAY_SONG(voice_change_song);
43 return false; 45 return false;
44 } 46 }
45 47