From 6fd54f6fed7bf67ec7b89413fad1cef3454ba1af Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Fri, 12 Nov 2021 22:21:51 -0800 Subject: [PATCH] Fix audio chain --- src/components/Noise.vue | 4 ++-- src/components/noise.js | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/Noise.vue b/src/components/Noise.vue index 6dfc63f..b7b83a7 100644 --- a/src/components/Noise.vue +++ b/src/components/Noise.vue @@ -277,8 +277,8 @@ thumb-label label="Rate" max="10" - min="0.1" - step="0.1" + min="0.01" + step="0.01" class="mx-3" @change="updateLFOFilterCutoffFrequency" /> diff --git a/src/components/noise.js b/src/components/noise.js index b0cb710..473d116 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -93,22 +93,20 @@ export default { } else if (this.isFilterEnabled && !this.isTremoloEnabled) { this.filter = new Filter(this.filterCutoff, this.filterType).toDestination() this.noise = new Noise({ volume: this.volume, type: this.noiseColor }).connect(this.filter) - } else if (this.isFilterEnabled && this.isLFOFilterCutoffEnabled && this.isTremoloEnabled) { + } else if (this.isFilterEnabled && this.isTremoloEnabled) { this.tremolo = new Tremolo({ frequency: this.tremoloFrequency, depth: this.tremoloDepth }).toDestination().start() this.filter = new Filter(this.filterCutoff, this.filterType).connect(this.tremolo) this.noise = new Noise({ volume: this.volume, type: this.noiseColor }).connect(this.filter) - this.lfo = new LFO({ frequency: this.lfoFilterCutoffFrequency, min: this.lfoFilterCutoffRange[0], max: this.lfoFilterCutoffRange[1] }) - this.lfo.connect(this.filter.frequency).start() } else { this.tremolo = new Tremolo({ frequency: this.tremoloFrequency, depth: this.tremoloDepth }).toDestination().start() this.filter = new Filter(this.filterCutoff, this.filterType).connect(this.tremolo) this.noise = new Noise({ volume: this.volume, type: this.noiseColor }).connect(this.filter) } - // if (this.isLFOFilterCutoffEnabled) { - // this.lfo = new LFO({ frequency: this.lfoFilterCutoffFrequency, min: this.lfoFilterCutoffRange[0], max: this.lfoFilterCutoffRange[1] }) - // this.lfo.connect(this.filter.frequency).start() - // } + if (this.isLFOFilterCutoffEnabled) { + this.lfo = new LFO({ frequency: this.lfoFilterCutoffFrequency, min: this.lfoFilterCutoffRange[0], max: this.lfoFilterCutoffRange[1] }) + this.lfo.connect(this.filter.frequency).start() + } if (this.isTimerEnabled) { this.duration = parseInt((this.hours * 3600)) + parseInt((this.minutes * 60)) + parseInt(this.seconds)