renaming synth var

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

View file

@ -55,7 +55,7 @@
</tone-example> </tone-example>
<script type="text/javascript"> <script type="text/javascript">
const piano = new Tone.Synth({ const synth = new Tone.Synth({
oscillator: { oscillator: {
type: "fmsine4", type: "fmsine4",
modulationType: "square" modulationType: "square"
@ -63,7 +63,7 @@
}).toDestination(); }).toDestination();
const loop = new Tone.Pattern(((time, note) => { const loop = new Tone.Pattern(((time, note) => {
piano.triggerAttackRelease(note, "16n", time); synth.triggerAttackRelease(note, "16n", time);
// Draw.schedule takes a callback and a time to invoke the callback // Draw.schedule takes a callback and a time to invoke the callback
Tone.Draw.schedule(() => { Tone.Draw.schedule(() => {
@ -78,10 +78,8 @@
loop.interval = "16n"; loop.interval = "16n";
Tone.Transport.lookAhead = 0.5;
drawer().add({ drawer().add({
tone: piano, tone: synth,
title: "Piano", title: "Piano",
}); });