npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aldel/reverbgen

v2.0.1

Published

A TypeScript library for generating artificial reverb impulse responses.

Downloads

221

Readme

reverbGen

A TypeScript library for generating artificial reverb impulse responses.

This library generates simulated room impulse responses that sound fairly decent when used in convolution reverb effects, including the Web Audio API's ConvolverNode. You can use it in your web apps to generate impulse responses as needed, or generate sound files in advance to use in any audio application.

If you just want to generate some impulse responses, see the hosted app at aldel.com/reverbgen.

The method used to generate the impulse responses is somewhat inspired by the classic paper About This Reverberation Business, by James A. Moorer, which notes that exponentially decaying white noise makes a surprisingly good sounding reverb response. This implementation adds a short user-selectable fade-in time and a gradually changing lowpass filter.

Installation

npm install @aldel/reverbgen

Usage

generateReverb(params)

Generates a reverb impulse response as an AudioBuffer. Returns a Promise<AudioBuffer>.

import { generateReverb } from '@aldel/reverbgen';

const audioContext = new AudioContext();
const convolver = audioContext.createConvolver();

convolver.buffer = await generateReverb({
  decayTime: 2.5,          // -60dB decay time in seconds (required)
  sampleRate: audioContext.sampleRate,
  numChannels: 2,          // default: 2
  fadeInTime: 0.1,         // fade-in time in seconds, default: 0
  lpFreqStart: 15000,      // starting lowpass frequency in Hz, default: 0 (no filter)
  lpFreqEnd: 1000,         // lowpass frequency at the -60dB point in Hz, default: 0
});

All parameters except decayTime are optional.

| Parameter | Type | Default | Description | |---|---|---|---| | decayTime | number | — | Required. The -60dB decay time in seconds. | | sampleRate | number | 48000 | Sample rate in Hz. Pass audioContext.sampleRate to match your playback context. | | numChannels | number | 2 | Number of audio channels. | | fadeInTime | number | 0 | Fade-in time in seconds. | | lpFreqStart | number | 0 | Starting frequency for a gradually-applied lowpass filter in Hz. 0 disables the filter. | | lpFreqEnd | number | 0 | Lowpass filter frequency at the -60dB point in Hz. |

generateGraph(data, width, height, min, max)

Creates a <canvas> element showing a graph of the given data. Useful for visualizing the impulse response waveform.

import { generateGraph } from '@aldel/reverbgen';

const buffer = await generateReverb({ decayTime: 2.5 });
const canvas = generateGraph(buffer.getChannelData(0), 400, 150, -1, 1);
document.body.appendChild(canvas);

saveWavFile(buffer, name, minTail?)

Saves an AudioBuffer as a normalized 16-bit WAV file, triggering a browser download.

import { saveWavFile } from '@aldel/reverbgen';

const buffer = await generateReverb({ decayTime: 2.5 });
saveWavFile(buffer, 'my-reverb.wav', 5);

The optional minTail parameter truncates trailing near-silence: the file is cut at the last sample frame where any channel has an absolute value (post-normalization, as a 16-bit integer) greater than minTail. Defaults to 0 (no truncation).