Felix Roos e9e25ef8d8 Publish
- @strudel.cycles/core@0.2.0
 - @strudel.cycles/eval@0.2.0
 - @strudel.cycles/midi@0.2.0
 - @strudel.cycles/mini@0.2.0
 - @strudel.cycles/react@0.2.0
 - @strudel.cycles/soundfonts@0.2.0
 - @strudel.cycles/tonal@0.2.0
 - @strudel.cycles/tone@0.2.0
 - @strudel.cycles/webaudio@0.2.0
 - @strudel.cycles/webdirt@0.2.0
 - @strudel.cycles/xen@0.2.0
2022-08-14 17:56:28 +02:00
..
2022-08-12 00:53:40 +02:00
2022-08-11 22:58:37 +02:00
2022-06-18 13:11:25 +02:00
2022-08-14 17:56:28 +02:00
2022-08-14 17:56:28 +02:00
2022-04-16 15:49:40 +02:00
2022-08-12 22:28:19 +02:00
2022-08-11 22:58:37 +02: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').out()
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