diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-07-22 00:14:26 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-07-23 14:59:29 -0400 |
| commit | 415d38ba9ee20424ce354ed5f8e590fae58b863f (patch) | |
| tree | 663b609ace954533aff4a964b4c7cb3300bd73cd /quantum/process_keycode/process_audio.c | |
| parent | 9abbbe70890ee0a0c619411c76a2c7b82b1b49d5 (diff) | |
| download | qmk_firmware-415d38ba9ee20424ce354ed5f8e590fae58b863f.tar.gz qmk_firmware-415d38ba9ee20424ce354ed5f8e590fae58b863f.zip | |
adds music mode, music mode songs, music mask
Diffstat (limited to 'quantum/process_keycode/process_audio.c')
| -rw-r--r-- | quantum/process_keycode/process_audio.c | 16 |
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 | ||
| 7 | float voice_change_song[][2] = VOICE_CHANGE_SONG; | ||
| 8 | |||
| 4 | static float compute_freq_for_midi_note(uint8_t note) | 9 | static 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 | ||
