summaryrefslogtreecommitdiffstats
path: root/quantum/audio/audio.c
diff options
context:
space:
mode:
authorJoshua T <joshua@sonofone.net>2017-01-07 21:01:21 +0100
committerJoshua T <joshua@sonofone.net>2017-01-07 21:01:21 +0100
commit8f8d10475956a17953f6db4db3f3b50bd795c0d8 (patch)
tree90c80474baa080e5743ee745ec98254e1a2faadd /quantum/audio/audio.c
parentb7b44dc481430438552d91b7069d5e37a5e3a649 (diff)
parente7df488a92da56cf160ac64c8cc7302ab717e145 (diff)
downloadqmk_firmware-8f8d10475956a17953f6db4db3f3b50bd795c0d8.tar.gz
qmk_firmware-8f8d10475956a17953f6db4db3f3b50bd795c0d8.tar.xz
Merged from upstream
Diffstat (limited to 'quantum/audio/audio.c')
-rw-r--r--quantum/audio/audio.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index ead5fbf3e..2a315fd16 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -77,6 +77,7 @@ static bool audio_initialized = false;
audio_config_t audio_config;
uint16_t envelope_index = 0;
+bool glissando = true;
void audio_init()
{
@@ -205,13 +206,17 @@ ISR(TIMER3_COMPA_vect)
freq = frequencies[voice_place];
#endif
} else {
- if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
- frequency = frequency * pow(2, 440/frequency/12/2);
- } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
- frequency = frequency * pow(2, -440/frequency/12/2);
+ if (glissando) {
+ if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
+ frequency = frequency * pow(2, 440/frequency/12/2);
+ } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
+ frequency = frequency * pow(2, -440/frequency/12/2);
+ } else {
+ frequency = frequencies[voices - 1];
+ }
} else {
frequency = frequencies[voices - 1];
- }
+ }
#ifdef VIBRATO_ENABLE
if (vibrato_strength > 0) {