Fix audio chain

This commit is contained in:
Kevin Thomas
2021-11-12 22:21:51 -08:00
parent eb3c00d6c1
commit 6fd54f6fed
2 changed files with 7 additions and 9 deletions

View File

@@ -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"
/>

View File

@@ -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)