mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
new hello world
This commit is contained in:
parent
e0b6ec48ad
commit
1b722a27b1
1 changed files with 4 additions and 13 deletions
17
README.md
17
README.md
|
@ -43,20 +43,11 @@ It's always much safer to use a specific version rather than just "latest".
|
|||
# Hello World
|
||||
|
||||
```javascript
|
||||
//create one of Tone's built-in synthesizers
|
||||
var synth = new Tone.MonoSynth();
|
||||
//create one of Tone's built-in synthesizers and connect it to the master output
|
||||
var synth = new Tone.SimpleSynth().toMaster();
|
||||
|
||||
//connect the synth to the master output channel
|
||||
synth.toMaster();
|
||||
|
||||
//create a callback which is invoked every quarter note
|
||||
Tone.Transport.setInterval(function(time){
|
||||
//trigger middle C for the duration of an 8th note
|
||||
synth.triggerAttackRelease("C4", "8n", time);
|
||||
}, "4n");
|
||||
|
||||
//start the transport
|
||||
Tone.Transport.start();
|
||||
//play a middle c for the duratino of an 8th note
|
||||
synth.triggerAttackRelease("C4", "8n");
|
||||
```
|
||||
|
||||
# Tone.Transport
|
||||
|
|
Loading…
Reference in a new issue