From 51f6165412be0148df64dacc2de91987396145d6 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Sun, 18 Jul 2021 00:50:32 -0700 Subject: [PATCH] Add noise color setting --- src/components/Noise.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/components/Noise.vue b/src/components/Noise.vue index 9bd94a9..db7ada3 100644 --- a/src/components/Noise.vue +++ b/src/components/Noise.vue @@ -35,10 +35,18 @@ + + + + @@ -47,11 +55,13 @@ import { Noise, Transport } from "tone"; export default { - name: 'Noise', + name: "Noise", data: () => ({ isDisabled: false, - seconds: 4 + noiseDuration: 4, + noiseColorOptions: ["pink", "white", "brown"], + noiseColor: "pink" }), created() { }, @@ -59,10 +69,10 @@ handleStart() { this.isDisabled = true Transport.cancel() - this.noise = new Noise({volume: -10, type: "brown"}).toDestination() - this.noise.sync().start(0).stop(this.seconds) + this.noise = new Noise({volume: -10, type: this.noiseColor}).toDestination() + this.noise.sync().start(0).stop(this.noiseDuration) Transport.start() - Transport.loopEnd = this.seconds + Transport.loopEnd = this.noiseDuration }, handleStop() { Transport.stop()