This commit is contained in:
Yotam Mann 2020-07-19 10:18:33 -07:00
parent f6d6e310dd
commit bdbc6dfccd

View file

@ -32,54 +32,53 @@
</tone-example>
<script type="text/javascript">
// the source
const player = new Tone.Player({
url: "https://tonejs.github.io/audio/berklee/femalevoice_oo_A4.mp3",
loop: true,
});
// the source
const player = new Tone.Player({
url: "https://tonejs.github.io/audio/berklee/femalevoice_oo_A4.mp3",
loop: true,
});
// make some effects
const chorus = new Tone.Chorus({
wet: 1,
}).toDestination().start();
const chorusChannel = new Tone.Channel({ volume: -60 }).connect(chorus);
chorusChannel.receive("chorus");
// make some effects
const chorus = new Tone.Chorus({
wet: 1,
}).toDestination().start();
const chorusChannel = new Tone.Channel({ volume: -60 }).connect(chorus);
chorusChannel.receive("chorus");
const cheby = new Tone.Chebyshev(50).toDestination();
const chebyChannel = new Tone.Channel({ volume: -60 }).connect(cheby);
chebyChannel.receive("cheby");
const cheby = new Tone.Chebyshev(50).toDestination();
const chebyChannel = new Tone.Channel({ volume: -60 }).connect(cheby);
chebyChannel.receive("cheby");
const reverb = new Tone.Reverb(3).toDestination();
const reverbChannel = new Tone.Channel({ volume: -60 }).connect(reverb);
reverbChannel.receive("reverb");
const reverb = new Tone.Reverb(3).toDestination();
const reverbChannel = new Tone.Channel({ volume: -60 }).connect(reverb);
reverbChannel.receive("reverb");
// send the player to all of the channels
const playerChannel = new Tone.Channel().toDestination();
playerChannel.send("chorus");
playerChannel.send("cheby");
playerChannel.send("reverb");
player.connect(playerChannel);
drawer().add({
tone: chorus,
}).add({
tone: reverb,
}).add({
tone: cheby,
});
document.querySelector("tone-play-toggle").addEventListener("start", () => player.start());
document.querySelector("tone-play-toggle").addEventListener("stop", () => player.stop());
// bind the interface
document.querySelector("[label=\"Chorus Send\"]").addEventListener("input", e => {
chorusChannel.volume.value = parseFloat(e.target.value);
});
document.querySelector("[label=\"Chebyshev Send\"]").addEventListener("input", e => {
chebyChannel.volume.value = parseFloat(e.target.value);
});
document.querySelector("[label=\"Reverb Send\"]").addEventListener("input", e => {
reverbChannel.volume.value = parseFloat(e.target.value);
});
// send the player to all of the channels
const playerChannel = new Tone.Channel().toDestination();
playerChannel.send("chorus");
playerChannel.send("cheby");
playerChannel.send("reverb");
player.connect(playerChannel);
drawer().add({
tone: chorus,
}).add({
tone: reverb,
}).add({
tone: cheby,
});
document.querySelector("tone-play-toggle").addEventListener("start", () => player.start());
document.querySelector("tone-play-toggle").addEventListener("stop", () => player.stop());
// bind the interface
document.querySelector("[label=\"Chorus Send\"]").addEventListener("input", e => {
chorusChannel.volume.value = parseFloat(e.target.value);
});
document.querySelector("[label=\"Chebyshev Send\"]").addEventListener("input", e => {
chebyChannel.volume.value = parseFloat(e.target.value);
});
document.querySelector("[label=\"Reverb Send\"]").addEventListener("input", e => {
reverbChannel.volume.value = parseFloat(e.target.value);
});
</script>
</body>
</html>