strudel/packages/webaudio
Felix Roos 61559fee9d Revert "Publish"
This reverts commit 2118a20408.
2022-12-13 22:24:12 +01:00
..
feedbackdelay.mjs delay as global send via orbit 2022-09-24 21:45:23 +02:00
index.mjs move scheduler to core + move audioctx to userland 2022-08-17 21:26:00 +02:00
package-lock.json Revert "Publish" 2022-12-13 22:24:12 +01:00
package.json Revert "Publish" 2022-12-13 22:24:12 +01:00
README.md remove all occurrences of .out() 2022-10-27 19:47:07 +02:00
reverb.mjs fix: reverb mono 2022-10-31 20:34:07 +01:00
sampler.mjs fix non note samples 2022-12-12 20:53:11 +01:00
vite.config.js add webaudio cjs + esm build task 2022-11-08 23:16:24 +01:00
vowel.mjs make vowel work with node 2022-09-15 20:11:10 +02:00
webaudio.mjs add freq support to sampler 2022-12-12 20:41:09 +01:00
worklets.mjs fix: multichannel worklets 2022-10-31 20:33:42 +01:00

@strudel.cycles/webaudio

This package contains a scheduler + a clockworker and synths based on the Web Audio API. It's an alternative to @strudel.cycles/tone, with better performance, but less features.

Install

npm i @strudel.cycles/webaudio --save

Example

import { Scheduler, getAudioContext } from '@strudel.cycles/webaudio';

const scheduler = new Scheduler({
  audioContext: getAudioContext(),
  interval: 0.1,
  onEvent: (e) => e.context?.createAudioNode?.(e),
});
const pattern = sequence([55, 99], 110).osc('sawtooth');
scheduler.setPattern(pattern);
scheduler.start();
//scheduler.stop()

A more sophisticated example can be found in examples/repl.html. You can run it by opening the html file with your browser, or by clicking this link