strudel/packages/superdough
2023-08-11 12:22:03 +02:00
..
example fix: still had strudel core imports 2023-08-11 10:51:59 +02:00
feedbackdelay.mjs add superdough package 2023-08-11 10:42:59 +02:00
helpers.mjs Revert "rename: superdough.mjs > webaudio.mjs" 2023-08-11 12:22:03 +02:00
index.mjs Revert "rename: superdough.mjs > webaudio.mjs" 2023-08-11 12:22:03 +02:00
package.json bump to 0.9.2 2023-08-11 11:13:31 +02:00
README.md add link to codesandbox 2023-08-11 11:09:33 +02:00
reverb.mjs add superdough package 2023-08-11 10:42:59 +02:00
sampler.mjs fix: still had strudel core imports 2023-08-11 10:51:59 +02:00
superdough.mjs Revert "rename: superdough.mjs > webaudio.mjs" 2023-08-11 12:22:03 +02:00
synth.mjs Revert "rename: superdough.mjs > webaudio.mjs" 2023-08-11 12:22:03 +02:00
util.mjs fix: still had strudel core imports 2023-08-11 10:51:59 +02:00
vite.config.js fix: build entry file 2023-08-11 10:43:59 +02:00
vowel.mjs add superdough package 2023-08-11 10:42:59 +02:00
worklets.mjs add superdough package 2023-08-11 10:42:59 +02:00

superdough

superdough is a simple web audio sampler and synth, intended for live coding. It is the default output of strudel. This package has no ties to strudel and can be used to quickly bake your own music system on the web.

Install

via npm:

npm i superdough --save

Use

import { superdough, samples, initAudioOnFirstClick, registerSynthSounds } from 'superdough';

const init = Promise.all([
  initAudioOnFirstClick(),
  samples('github:tidalcycles/Dirt-Samples/master'),
  registerSynthSounds(),
]);

const loop = (t = 0) => {
  // superdough(value, time, duration)
  superdough({ s: 'bd', delay: 0.5 }, t);
  superdough({ note: 'g1', s: 'sawtooth', cutoff: 600, resonance: 8 }, t, 0.125);
  superdough({ note: 'g2', s: 'sawtooth', cutoff: 600, resonance: 8 }, t + 0.25, 0.125);
  superdough({ s: 'hh' }, t + 0.25);
  superdough({ s: 'sd', room: 0.5 }, t + 0.5);
  superdough({ s: 'hh' }, t + 0.75);
};

document.getElementById('play').addEventListener('click', async () => {
  await init;
  let t = 0.1;
  while (t < 16) {
    loop(t++);
  }
});

Open this in Codesandbox

Credits