diff options
author | xyverz <xyverz@gmail.com> | 2016-12-13 18:06:49 -0800 |
---|---|---|
committer | xyverz <xyverz@gmail.com> | 2016-12-13 18:06:49 -0800 |
commit | 0523657923d2bc8e9515fcb8125d8ceb7a70d862 (patch) | |
tree | c52a29838a67eb6c032b1950839ac889a1a6330c /quantum/audio/voices.c | |
parent | 592b90dd221d3847d359b9a4dbd258b9ceb2b3ce (diff) | |
parent | 20892bf706219f19a5f9cd34abd4f772ab4ee570 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/audio/voices.c')
-rw-r--r-- | quantum/audio/voices.c | 23 |
1 files changed, 22 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) { |