This commit is contained in:
Dooho Yi 2022-12-04 22:52:03 +09:00
parent 133d98ebab
commit 40ae5cfc35

View file

@ -79,13 +79,14 @@ function Sample(arg) {
);
// source -> reverb(fx)
if (arg.autostart) this.button.turnOn();
if (this.autostart) this.button.turnOn();
this.player = new Tone.Player({
url: arg.url,
loop: arg.loop,
autostart: arg.autostart,
loop: this.loop,
autostart: this.autostart,
fadeIn: 5,
fadeOut: 5,
onstop: () => this.button.turnOff()
}).connect(this.rev);
this.button.on(
"change",
@ -94,9 +95,6 @@ function Sample(arg) {
else this.player.stop();
}.bind(this)
);
if (arg.type == "oneshot") {
this.player.onstop = () => this.button.turnOff()
}
}
//script