aboutsummaryrefslogtreecommitdiff
path: root/quantum/audio
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-12-12 15:39:07 -0500
committerJack Humbert <jack.humb@gmail.com>2016-12-12 15:39:07 -0500
commit0edfe55bfe4afd037918ff73e49552a28f39a5ca (patch)
treedb0af9337db80830bbf2103ef39c0a6ca9a29451 /quantum/audio
parent0213acbdbee91e6d06ed928af4d93d79389c5106 (diff)
downloadqmk_firmware-0edfe55bfe4afd037918ff73e49552a28f39a5ca.tar.gz
qmk_firmware-0edfe55bfe4afd037918ff73e49552a28f39a5ca.zip
re-enable audio and extrakeys
Diffstat (limited to 'quantum/audio')
-rw-r--r--quantum/audio/voices.c23
-rw-r--r--quantum/audio/voices.h1
2 files changed, 23 insertions, 1 deletions
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c
index 6d4172a06..19f7b646e 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -18,7 +18,7 @@ void voice_iterate() {
18} 18}
19 19
20void voice_deiterate() { 20void voice_deiterate() {
21 voice = (voice - 1) % number_of_voices; 21 voice = (voice - 1 + number_of_voices) % number_of_voices;
22} 22}
23 23
24float voice_envelope(float frequency) { 24float voice_envelope(float frequency) {
@@ -31,6 +31,27 @@ float voice_envelope(float frequency) {
31 polyphony_rate = 0; 31 polyphony_rate = 0;
32 break; 32 break;
33 33
34 case something:
35 polyphony_rate = 0;
36 switch (compensated_index) {
37 case 0 ... 9:
38 note_timbre = TIMBRE_12;
39 break;
40
41 case 10 ... 19:
42 note_timbre = TIMBRE_25;
43 break;
44
45 case 20 ... 200:
46 note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125;
47 break;
48
49 default:
50 note_timbre = .25;
51 break;
52 }
53 break;
54
34 case butts_fader: 55 case butts_fader:
35 polyphony_rate = 0; 56 polyphony_rate = 0;
36 switch (compensated_index) { 57 switch (compensated_index) {
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h
index b2495b23b..b43def3d7 100644
--- a/quantum/audio/voices.h
+++ b/quantum/audio/voices.h
@@ -11,6 +11,7 @@ float voice_envelope(float frequency);
11 11
12typedef enum { 12typedef enum {
13 default_voice, 13 default_voice,
14 something,
14 butts_fader, 15 butts_fader,
15 octave_crunch, 16 octave_crunch,
16 duty_osc, 17 duty_osc,