diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/process_keycode/process_audio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index eb74796fa..32057ae8d 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c | |||
| @@ -6,10 +6,14 @@ | |||
| 6 | #endif | 6 | #endif |
| 7 | float voice_change_song[][2] = VOICE_CHANGE_SONG; | 7 | float voice_change_song[][2] = VOICE_CHANGE_SONG; |
| 8 | 8 | ||
| 9 | #ifndef PITCH_STANDARD_A | ||
| 10 | #define PITCH_STANDARD_A 440.0f | ||
| 11 | #endif | ||
| 12 | |||
| 9 | static float compute_freq_for_midi_note(uint8_t note) | 13 | static float compute_freq_for_midi_note(uint8_t note) |
| 10 | { | 14 | { |
| 11 | // https://en.wikipedia.org/wiki/MIDI_tuning_standard | 15 | // https://en.wikipedia.org/wiki/MIDI_tuning_standard |
| 12 | return pow(2.0, (note - 69) / 12.0) * 440.0f; | 16 | return pow(2.0, (note - 69) / 12.0) * PITCH_STANDARD_A; |
| 13 | } | 17 | } |
| 14 | 18 | ||
| 15 | bool process_audio(uint16_t keycode, keyrecord_t *record) { | 19 | bool process_audio(uint16_t keycode, keyrecord_t *record) { |
