diff options
| -rw-r--r-- | docs/feature_audio.md | 3 | ||||
| -rw-r--r-- | layouts/community/ortho_4x12/mindsound/config.h | 5 | ||||
| -rw-r--r-- | quantum/process_keycode/process_clicky.c | 11 |
3 files changed, 13 insertions, 6 deletions
diff --git a/docs/feature_audio.md b/docs/feature_audio.md index e1dd4c5a8..7511598bc 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md | |||
| @@ -175,8 +175,9 @@ You can configure the default, min and max frequencies, the stepping and built i | |||
| 175 | | `AUDIO_CLICKY_FREQ_DEFAULT` | 440.0f | Sets the default/starting audio frequency for the clicky sounds. | | 175 | | `AUDIO_CLICKY_FREQ_DEFAULT` | 440.0f | Sets the default/starting audio frequency for the clicky sounds. | |
| 176 | | `AUDIO_CLICKY_FREQ_MIN` | 65.0f | Sets the lowest frequency (under 60f are a bit buggy). | | 176 | | `AUDIO_CLICKY_FREQ_MIN` | 65.0f | Sets the lowest frequency (under 60f are a bit buggy). | |
| 177 | | `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | Sets the the highest frequency. Too high may result in coworkers attacking you. | | 177 | | `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | Sets the the highest frequency. Too high may result in coworkers attacking you. | |
| 178 | | `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. | | 178 | | `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. This is a multiplicative factor. The default steps the frequency up/down by a musical minor third. | |
| 179 | | `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | | 179 | | `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | |
| 180 | | `AUDIO_CLICKY_DELAY_DURATION` | 1 | An integer note duration where 1 is 1/16th of the tempo, or a sixty-fourth note (see `quantum/audio/musical_notes.h` for implementation details). The main clicky effect will be delayed by this duration. Adjusting this to values around 6-12 will help compensate for loud switches. | | ||
| 180 | 181 | ||
| 181 | 182 | ||
| 182 | 183 | ||
diff --git a/layouts/community/ortho_4x12/mindsound/config.h b/layouts/community/ortho_4x12/mindsound/config.h index 76e7da204..e615fe77e 100644 --- a/layouts/community/ortho_4x12/mindsound/config.h +++ b/layouts/community/ortho_4x12/mindsound/config.h | |||
| @@ -15,9 +15,10 @@ | |||
| 15 | #define STARTUP_SONG SONG(ADVENTURE_TIME) | 15 | #define STARTUP_SONG SONG(ADVENTURE_TIME) |
| 16 | #define AUDIO_CLICKY | 16 | #define AUDIO_CLICKY |
| 17 | #define AUDIO_CLICKY_ON | 17 | #define AUDIO_CLICKY_ON |
| 18 | #define AUDIO_CLICKY_DELAY_DURATION 0 | ||
| 18 | #define AUDIO_CLICKY_FREQ_MAX 2500.0f | 19 | #define AUDIO_CLICKY_FREQ_MAX 2500.0f |
| 19 | #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.2f | 20 | #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.3f |
| 20 | #define AUDIO_CLICKY_FREQ_DEFAULT 110.0f | 21 | #define AUDIO_CLICKY_FREQ_DEFAULT 880.0f |
| 21 | #endif | 22 | #endif |
| 22 | 23 | ||
| 23 | // for some reason the LSvi rev1 disables action tapping... | 24 | // for some reason the LSvi rev1 disables action tapping... |
diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 12fef51f9..43b803afe 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef AUDIO_CLICKY | 4 | #ifdef AUDIO_CLICKY |
| 5 | 5 | ||
| 6 | #ifndef AUDIO_CLICKY_DELAY_DURATION | ||
| 7 | #define AUDIO_CLICKY_DELAY_DURATION 1 | ||
| 8 | #endif // !AUDIO_CLICKY_DELAY_DURATION | ||
| 6 | #ifndef AUDIO_CLICKY_FREQ_DEFAULT | 9 | #ifndef AUDIO_CLICKY_FREQ_DEFAULT |
| 7 | #define AUDIO_CLICKY_FREQ_DEFAULT 440.0f | 10 | #define AUDIO_CLICKY_FREQ_DEFAULT 440.0f |
| 8 | #endif // !AUDIO_CLICKY_FREQ_DEFAULT | 11 | #endif // !AUDIO_CLICKY_FREQ_DEFAULT |
| @@ -21,7 +24,9 @@ | |||
| 21 | 24 | ||
| 22 | float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; | 25 | float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; |
| 23 | float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; | 26 | float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; |
| 24 | float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations | 27 | |
| 28 | // the first "note" is an intentional delay; the 2nd and 3rd notes are the "clicky" | ||
| 29 | float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_MIN, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations | ||
| 25 | 30 | ||
| 26 | extern audio_config_t audio_config; | 31 | extern audio_config_t audio_config; |
| 27 | 32 | ||
| @@ -34,8 +39,8 @@ void clicky_play(void) { | |||
| 34 | #ifndef NO_MUSIC_MODE | 39 | #ifndef NO_MUSIC_MODE |
| 35 | if (music_activated || midi_activated || !audio_config.enable) return; | 40 | if (music_activated || midi_activated || !audio_config.enable) return; |
| 36 | #endif // !NO_MUSIC_MODE | 41 | #endif // !NO_MUSIC_MODE |
| 37 | clicky_song[0][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); | 42 | clicky_song[1][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); |
| 38 | clicky_song[1][0] = clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); | 43 | clicky_song[2][0] = clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); |
| 39 | PLAY_SONG(clicky_song); | 44 | PLAY_SONG(clicky_song); |
| 40 | } | 45 | } |
| 41 | 46 | ||
