..
This commit is contained in:
parent
133d98ebab
commit
40ae5cfc35
1 changed files with 8 additions and 10 deletions
10
script.js
10
script.js
|
|
@ -79,13 +79,14 @@ function Sample(arg) {
|
||||||
);
|
);
|
||||||
|
|
||||||
// source -> reverb(fx)
|
// source -> reverb(fx)
|
||||||
if (arg.autostart) this.button.turnOn();
|
if (this.autostart) this.button.turnOn();
|
||||||
this.player = new Tone.Player({
|
this.player = new Tone.Player({
|
||||||
url: arg.url,
|
url: arg.url,
|
||||||
loop: arg.loop,
|
loop: this.loop,
|
||||||
autostart: arg.autostart,
|
autostart: this.autostart,
|
||||||
fadeIn: 5,
|
fadeIn: 5,
|
||||||
fadeOut: 5,
|
fadeOut: 5,
|
||||||
|
onstop: () => this.button.turnOff()
|
||||||
}).connect(this.rev);
|
}).connect(this.rev);
|
||||||
this.button.on(
|
this.button.on(
|
||||||
"change",
|
"change",
|
||||||
|
|
@ -94,9 +95,6 @@ function Sample(arg) {
|
||||||
else this.player.stop();
|
else this.player.stop();
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
if (arg.type == "oneshot") {
|
|
||||||
this.player.onstop = () => this.button.turnOff()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//script
|
//script
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue