summaryrefslogtreecommitdiffstats
path: root/quantum
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
parent0213acbdbee91e6d06ed928af4d93d79389c5106 (diff)
re-enable audio and extrakeys
Diffstat (limited to 'quantum')
-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 6d4172a06c..19f7b646ef 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -18,7 +18,7 @@ void voice_iterate() {
}
void voice_deiterate() {
- voice = (voice - 1) % number_of_voices;
+ voice = (voice - 1 + number_of_voices) % number_of_voices;
}
float voice_envelope(float frequency) {
@@ -31,6 +31,27 @@ float voice_envelope(float frequency) {
polyphony_rate = 0;
break;
+ case something:
+ polyphony_rate = 0;
+ switch (compensated_index) {
+ case 0 ... 9:
+ note_timbre = TIMBRE_12;
+ break;
+
+ case 10 ... 19:
+ note_timbre = TIMBRE_25;
+ break;
+
+ case 20 ... 200:
+ note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125;
+ break;
+
+ default:
+ note_timbre = .25;
+ break;
+ }
+ break;
+
case butts_fader:
polyphony_rate = 0;
switch (compensated_index) {
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h
index b2495b23b5..b43def3d7d 100644
--- a/quantum/audio/voices.h
+++ b/quantum/audio/voices.h
@@ -11,6 +11,7 @@ float voice_envelope(float frequency);
typedef enum {
default_voice,
+ something,
butts_fader,
octave_crunch,
duty_osc,