Felix Roos 89acc4870b Publish
- @strudel.cycles/core@0.3.2
 - @strudel.cycles/eval@0.3.2
 - @strudel.cycles/midi@0.3.2
 - @strudel.cycles/mini@0.3.2
 - @strudel.cycles/react@0.3.2
 - @strudel.cycles/soundfonts@0.3.2
 - @strudel.cycles/tonal@0.3.2
 - @strudel.cycles/tone@0.3.2
 - @strudel.cycles/transpiler@0.3.2
 - @strudel.cycles/webaudio@0.3.2
 - @strudel.cycles/webdirt@0.3.2
 - @strudel.cycles/xen@0.3.2
2022-11-08 22:45:44 +01:00
..
2022-11-08 22:45:44 +01:00
2022-11-08 22:45:44 +01:00
2022-10-27 19:47:07 +02:00
2022-10-31 20:34:07 +01:00
2022-09-15 20:11:10 +02:00
2022-10-31 23:30:50 +01:00
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