diff options
| -rw-r--r-- | quantum/audio/voices.c | 12 | ||||
| -rw-r--r-- | quantum/audio/voices.h | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 92ada47f7..98631f0cb 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c | |||
| @@ -72,15 +72,19 @@ float voice_envelope(float frequency) { | |||
| 72 | polyphony_rate = 0; | 72 | polyphony_rate = 0; |
| 73 | switch (compensated_index) { | 73 | switch (compensated_index) { |
| 74 | default: | 74 | default: |
| 75 | #define SPEED 10 | 75 | #define OCS_SPEED 10 |
| 76 | #define AMP .75 | 76 | #define OCS_AMP .25 |
| 77 | // sine wave is slow | 77 | // sine wave is slow |
| 78 | // note_timbre = (sin((float)compensated_index/10000*SPEED) * AMP / 2) + .5; | 78 | // note_timbre = (sin((float)compensated_index/10000*OCS_SPEED) * OCS_AMP / 2) + .5; |
| 79 | // triangle wave is a bit faster | 79 | // triangle wave is a bit faster |
| 80 | note_timbre = (float)abs((compensated_index*SPEED % 3000) - 1500) * ( AMP / 1500 ) + (1 - AMP) / 2; | 80 | note_timbre = (float)abs((compensated_index*OCS_SPEED % 3000) - 1500) * ( OCS_AMP / 1500 ) + (1 - OCS_AMP) / 2; |
| 81 | break; | 81 | break; |
| 82 | } | 82 | } |
| 83 | break; | 83 | break; |
| 84 | case duty_octave_down: | ||
| 85 | polyphony_rate = 0; | ||
| 86 | note_timbre = (envelope_index % 2) * .125 + .375 * 2; | ||
| 87 | break; | ||
| 84 | } | 88 | } |
| 85 | 89 | ||
| 86 | return frequency; | 90 | return frequency; |
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index 44c5066b5..5aa99f4b1 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h | |||
| @@ -15,6 +15,7 @@ typedef enum { | |||
| 15 | butts_fader, | 15 | butts_fader, |
| 16 | octave_crunch, | 16 | octave_crunch, |
| 17 | duty_osc, | 17 | duty_osc, |
| 18 | duty_octave_down, | ||
| 18 | number_of_voices // important that this is last | 19 | number_of_voices // important that this is last |
| 19 | } voice_type; | 20 | } voice_type; |
| 20 | 21 | ||
