mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-15 20:48:03 +00:00
Add noise color setting
This commit is contained in:
@@ -35,10 +35,18 @@
|
|||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="seconds"
|
v-model="noiseDuration"
|
||||||
label="Seconds"
|
label="Seconds"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-select
|
||||||
|
v-model="noiseColor"
|
||||||
|
:items="noiseColorOptions"
|
||||||
|
label="Noise Color"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -47,11 +55,13 @@
|
|||||||
import { Noise, Transport } from "tone";
|
import { Noise, Transport } from "tone";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Noise',
|
name: "Noise",
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
seconds: 4
|
noiseDuration: 4,
|
||||||
|
noiseColorOptions: ["pink", "white", "brown"],
|
||||||
|
noiseColor: "pink"
|
||||||
}),
|
}),
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
@@ -59,10 +69,10 @@
|
|||||||
handleStart() {
|
handleStart() {
|
||||||
this.isDisabled = true
|
this.isDisabled = true
|
||||||
Transport.cancel()
|
Transport.cancel()
|
||||||
this.noise = new Noise({volume: -10, type: "brown"}).toDestination()
|
this.noise = new Noise({volume: -10, type: this.noiseColor}).toDestination()
|
||||||
this.noise.sync().start(0).stop(this.seconds)
|
this.noise.sync().start(0).stop(this.noiseDuration)
|
||||||
Transport.start()
|
Transport.start()
|
||||||
Transport.loopEnd = this.seconds
|
Transport.loopEnd = this.noiseDuration
|
||||||
},
|
},
|
||||||
handleStop() {
|
handleStop() {
|
||||||
Transport.stop()
|
Transport.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user