This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@strudel.cycles/webaudio

0.10.0 • Public • Published

@strudel.cycles/webaudio

DEPRECATION NOTE: This package is old and won't get any updates! The newer version goes by the name of @strudel/webaudio.

This package contains helpers to make music with strudel and the Web Audio API. It is a thin binding to superdough.

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.

Package Sidebar

Install

npm i @strudel.cycles/webaudio

Weekly Downloads

6

Version

0.10.0

License

AGPL-3.0-or-later

Unpacked Size

48.7 kB

Total Files

9

Last publish

Collaborators

  • felixroos
  • yaxupaxo