mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-14 12:53:59 +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
|
# Hello World
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
//create one of Tone's built-in synthesizers
|
//create one of Tone's built-in synthesizers and connect it to the master output
|
||||||
var synth = new Tone.MonoSynth();
|
var synth = new Tone.SimpleSynth().toMaster();
|
||||||
|
|
||||||
//connect the synth to the master output channel
|
//play a middle c for the duratino of an 8th note
|
||||||
synth.toMaster();
|
synth.triggerAttackRelease("C4", "8n");
|
||||||
|
|
||||||
//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();
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Tone.Transport
|
# Tone.Transport
|
||||||
|
|
Loading…
Reference in a new issue