mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
renaming synth var
This commit is contained in:
parent
bdbc6dfccd
commit
c4578ce047
1 changed files with 3 additions and 5 deletions
|
@ -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",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue