diff options
author | Damien <Dbroqua@users.noreply.github.com> | 2016-12-17 22:28:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-17 22:28:45 +0100 |
commit | c9803f78b2409cfaf6a1be0a4b6c1a37778a3f37 (patch) | |
tree | 5d48ab69b311a5ae4eb25cc84ab9c47e98655fb4 /quantum/audio/voices.c | |
parent | 13c4080a1d77cb1dfdf48df8a42e78b9dc483912 (diff) | |
parent | 8a65c640ecdaacfd57b86b684ec80b481f5d4b3b (diff) |
Merge pull request #14 from jackhumbert/master
Merged from jackhumbert/qmk_firmware
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) { |