strudel/packages/webaudio
2022-10-31 20:33:42 +01:00
..
examples example: import from modules 2022-08-12 00:53:40 +02:00
clockworker.mjs work on scheduler: 2022-08-11 22:58:37 +02:00
feedbackdelay.mjs delay as global send via orbit 2022-09-24 21:45:23 +02:00
index.mjs move sampler to webaudio 2022-06-18 13:11:25 +02:00
package-lock.json Publish 2022-08-14 17:56:28 +02:00
package.json Publish 2022-08-14 17:56:28 +02:00
README.md remove all occurrences of .out() 2022-10-27 19:47:07 +02:00
reverb.mjs add reverb link 2022-09-25 23:23:37 +02:00
sampler.mjs remove all occurrences of .out() 2022-10-27 19:47:07 +02:00
scheduler.mjs allow changing cps from a hap 2022-08-12 22:28:19 +02:00
vowel.mjs make vowel work with node 2022-09-15 20:11:10 +02:00
webaudio.mjs note default to 36 2022-10-30 18:49:26 +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