]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
adds option for alt pitch standards
authorJack Humbert <jack.humb@gmail.com>
Mon, 24 Jul 2017 16:44:03 +0000 (12:44 -0400)
committerJack Humbert <jack.humb@gmail.com>
Mon, 24 Jul 2017 16:45:34 +0000 (12:45 -0400)
docs/modding_your_keyboard.md
quantum/process_keycode/process_audio.c

index 5613bf5253f2fb285e2b01048575836232ef7379..a58fbd52b2dd90a72c48fed83d8dad9b1e421c96 100644 (file)
@@ -79,6 +79,10 @@ By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less th
 
 Which will capture all keycodes - be careful, this will get you stuck in music mode until you restart your keyboard!
 
+The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`:
+
+    #define PITCH_STANDARD_A 432.0f
+
 ## MIDI functionalty
 
 This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
index eb74796fa7a9dd6f7daf61ab642e0b803c9d7ad4..32057ae8dc3ebf216659617a6e71695d4c8ee6b5 100644 (file)
@@ -6,10 +6,14 @@
 #endif
 float voice_change_song[][2] = VOICE_CHANGE_SONG;
 
+#ifndef PITCH_STANDARD_A
+    #define PITCH_STANDARD_A 440.0f
+#endif
+
 static float compute_freq_for_midi_note(uint8_t note)
 {
     // https://en.wikipedia.org/wiki/MIDI_tuning_standard
-    return pow(2.0, (note - 69) / 12.0) * 440.0f;
+    return pow(2.0, (note - 69) / 12.0) * PITCH_STANDARD_A;
 }
 
 bool process_audio(uint16_t keycode, keyrecord_t *record) {