Skip to content

add code syntax highlighting #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,28 @@ Examples

A square wave "ping" with delay.

var context = new webkitAudioContext();
```js
var context = new webkitAudioContext();

//square wave at 440 Hz (default)
var osc = context.createOscillator();
osc.type = osc.SQUARE;
//square wave at 440 Hz (default)
var osc = context.createOscillator();
osc.type = osc.SQUARE;

//envelope with 0.001 sec attack and 0.5 sec decay
var envelope = context.createEnvelope(0.001, 0.5, 0, 0);
//envelope with 0.001 sec attack and 0.5 sec decay
var envelope = context.createEnvelope(0.001, 0.5, 0, 0);

//feedback delay of 0.4 seconds with 0.5x feedback
var feedbackDelay = context.createFeedbackDelay(0.4, 0.5);
//feedback delay of 0.4 seconds with 0.5x feedback
var feedbackDelay = context.createFeedbackDelay(0.4, 0.5);

osc.connect(envelope);
envelope.connect(feedbackDelay);
envelope.connect(context.destination);
feedbackDelay.connect(context.destination);
osc.connect(envelope);
envelope.connect(feedbackDelay);
envelope.connect(context.destination);
feedbackDelay.connect(context.destination);

//trigger the note and release after 0.6 seconds
envelope.trigger(0.6);
```

//trigger the note and release after 0.6 seconds
envelope.trigger(0.6);

API
----

Expand Down