diff options
author | xyverz <xyverz@gmail.com> | 2017-01-08 21:47:08 -0800 |
---|---|---|
committer | xyverz <xyverz@gmail.com> | 2017-01-08 21:47:08 -0800 |
commit | 99521a448296902d15c597f4d2e170766c4afadb (patch) | |
tree | 8daa16747393c2cef6b897fbb88e74ef427df76e /quantum/audio/audio.c | |
parent | 79343f1c6cde28c454eac0a577d0d7dbf3aa2f17 (diff) | |
parent | 176b93d08eb5cc0c65a6d571fc2c1fec5f575854 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/audio/audio.c')
-rw-r--r-- | quantum/audio/audio.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index ead5fbf3e9..2a315fd168 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) { |