Skip to content

Commit

Permalink
Update package readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-thompson committed Oct 10, 2023
1 parent 00fd3b1 commit 567e14b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions js/packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { el, Renderer } from '@elemaudio/core';

// Here we're using a default Renderer instance, so it's our responsibility to
// send the instruction batches to the underlying engine
let sampleRate = 44100;
let core = new Renderer(sampleRate, (batch) => {
let core = new Renderer((batch) => {
// Send the instruction batch somewhere: you can set up whatever message
// passing channel you want!
console.log(batch);
Expand Down
2 changes: 0 additions & 2 deletions js/packages/offline-renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Please see the full documentation at [https://www.elementary.audio/](https://www
npm install --save @elemaudio/offline-renderer
```

**Note**: the offline renderer requires Node v18, or Node v16+ with the `--experimental-wasm-eh` flag set.

## Usage

```js
Expand Down
16 changes: 8 additions & 8 deletions js/packages/web-renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ import WebRenderer from '@elemaudio/web-renderer';

// Note that many browsers won't let you start an AudioContext before
// some corresponding user gesture. We're ignoring that in this example for brevity,
// but typically you would add a click event callback to make or resume your
// AudioContext instance to start making noise.
// but typically you would add an event callback to make or resume your
// AudioContext instance in order to start making noise.
const ctx = new AudioContext();
const core = new WebRenderer();

core.on('load', function() {
core.render(el.cycle(440), el.cycle(441));
});

(async function main() {
// Here we initialize our WebRenderer instance and connect the resulting
// Web Audio node to our AudioContext destination.
// Here we initialize our WebRenderer instance, returning a promise which resolves
// to the WebAudio node containing the runtime
let node = await core.initialize(ctx, {
numberOfInputs: 0,
numberOfOutputs: 1,
outputChannelCount: [2],
});

// And connect the resolved node to the AudioContext destination
node.connect(ctx.destination);

// Then finally we can render
core.render(el.cycle(440), el.cycle(441));
})();
```

Expand Down

0 comments on commit 567e14b

Please sign in to comment.