Today’s Agenda

Tone.JS Source code template

To make your life easier, feel free to copy the following template as it has the tone library already included in the index.html and it also has a power button to turn on Tone (some browsers require Tone.start() to be started with a mouse press, this is a security setting to ensure browsers don’t start playing sound automatically when a page is loaded):

Synths

mySynth.triggerAttack(”C4”); // starts note

mySynth.triggerRelease(); // ends note

mySynth.triggerAttackRelease(”C4”,1); // starts note and releases it 1 second later

mySynth.oscillator.type=”sine”; // changes oscillator to sine, sawtooth, square

mySynth.volume.value= -40 to 10 // volume is exponential starting negative