diff options
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 6d4172a06..19f7b646e 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c | |||
| @@ -18,7 +18,7 @@ void voice_iterate() { | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | void voice_deiterate() { | 20 | void voice_deiterate() { |
| 21 | voice = (voice - 1) % number_of_voices; | 21 | voice = (voice - 1 + number_of_voices) % number_of_voices; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | float voice_envelope(float frequency) { | 24 | float 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) { |
