0.3.0 • Published 1 year ago

@ondas/dattorro-reverb v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

DattorroReverb

Algorithmic reverb

npm version npm version

Dattorro algorithmic reverb implemented as an AudioWorklet.

The actual dsp code is taken from https://github.com/khoin/DattorroReverbNode slightly adapted.

import { DattorroReverb } from "@ondas/dattorro-reverb";

const audioContext = new AudioContext();
const reverb = new DattorroReverb(audioContext);
reverb.getParam("decay").setValue(0.2);

const piano = new TinyPiano(audioContext).bus1(reverb, 0.2);

Install

npm i @ondas/dattorro-reverb

Usage

All reverb parameters are accessed using getParam method. It returns an AudioParam, so they can be scheduled with the Web Audio API:

reverb.getParam("decay").setValue(0.2);
reverb.getParam("wet").linearRampToValueAtTime(context.currentTime + 1.0, 0.5);

The full list of params are exposed as paramNames:

reverb.paramNames; // =>
// [
//  "preDelay", "bandwidth", "inputDiffusion1", "inputDiffusion2",
//  "decay", "decayDiffusion1", "decayDiffusion2",
//  "damping", "excursionRate", "excursionDepth",
//  "wet", "dry",
// ];