strudel/packages/webaudio
Felix Roos 90a58858ca Publish
- @strudel/codemirror@0.8.4
 - @strudel.cycles/core@0.8.2
 - @strudel.cycles/csound@0.8.0
 - @strudel.cycles/eval@0.8.0
 - @strudel.cycles/midi@0.8.0
 - @strudel.cycles/mini@0.8.2
 - @strudel.cycles/osc@0.8.0
 - @strudel.cycles/react@0.8.0
 - @strudel.cycles/serial@0.8.0
 - @strudel.cycles/soundfonts@0.8.2
 - @strudel.cycles/tonal@0.8.2
 - @strudel.cycles/tone@0.8.0
 - @strudel.cycles/transpiler@0.8.2
 - @strudel/web@0.8.3
 - @strudel.cycles/webaudio@0.8.2
 - @strudel.cycles/webdirt@0.8.0
 - @strudel.cycles/xen@0.8.0
2023-06-30 08:17:19 +02:00
..
feedbackdelay.mjs delay as global send via orbit 2022-09-24 21:45:23 +02:00
helpers.mjs fix: envelope in chrome 2023-03-17 08:56:05 +01:00
index.mjs first draft of soundMap to register keys for s 2023-03-05 23:27:37 +01:00
package.json Publish 2023-06-30 08:17:19 +02:00
README.md overhaul the remaining readmes 2023-02-01 16:29:18 +01:00
reverb.mjs fix: reverb mono 2022-10-31 20:34:07 +01:00
sampler.mjs feat: register fn for sample prefix handling 2023-06-29 10:46:32 +02:00
synth.mjs - feat: add freq support to gm soundfonts 2023-03-23 10:18:24 +01:00
vite.config.js webaudio build 2023-01-28 23:14:56 +01:00
vowel.mjs make vowel work with node 2022-09-15 20:11:10 +02:00
webaudio.mjs clamp delayfeedback 2023-05-28 12:41:46 +02:00
worklets.mjs fix: multichannel worklets 2022-10-31 20:33:42 +01:00

@strudel.cycles/webaudio

This package contains helpers to make music with strudel and the Web Audio API.

Install

npm i @strudel.cycles/webaudio --save

Example

import { repl, controls } from "@strudel.cycles/core";
import { initAudioOnFirstClick, getAudioContext, webaudioOutput } from "@strudel.cycles/webaudio";
const { note } = controls;

initAudioOnFirstClick();
const ctx = getAudioContext();

const { scheduler } = repl({
  defaultOutput: webaudioOutput,
  getTime: () => ctx.currentTime
});

const pattern = note("c3", ["eb3", "g3"]).s("sawtooth");

scheduler.setPattern(pattern);
document.getElementById("start").addEventListener("click", () => scheduler.start());
document.getElementById("stop").addEventListener("click", () => scheduler.stop());

Play with the example codesandbox.

Read more in the docs about samples, synths and effects.