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 🙏

© 2024 – Pkg Stats / Ryan Hefner

webaudio-effect-units-collection

v1.0.5

Published

A bunch of different EffectUnits which can be used right away. They are all based on the webaudio-effect-unit.

Downloads

17

Readme

Webaudio effect units collection

Effects for everyone!

All effects of this collection are based on the webaudio-effect-unit module. If you want to gain a deeper knowledge on how you can use those effects, have a look at this repository.

Here a list of all the effects included in this package:

  • Gain
  • Chorus
  • Delay
  • Phaser
  • Overdrive
  • Compressor
  • Lowpass
  • Highpass
  • Tremolo
  • Wahwah
  • Bitcrusher
  • Moog
  • PingPongDelay
  • Reverb
  • Dub Delay

Installation

Through npm: npm i webaudio-effect-units-collection -S

Module usage

Default export

Per default, the module exports the following function:

createEffectCollection(audioCtx)

Example

import createEffectCollection from 'webaudio-effect-units-collection';
const audioCtx = new AudioContext();
const { gain, chorus, delay, phaser } = createEffectCollection(audioCtx)

This function requires an AudioContext object as its 1° argument. It returns an object with all effects contained by this package. The property names of this object are equivalent to the effect names.

Effect data

If you are using this package, it is likely that you want to include a possiblity to manipulate them via an User Interface. Therefore, the needed information to accordingly represent those effects in an UI is exported manually (so you could seamlessly integrate it in the application state, if needed).

An array with the name 'EFFECT_DATA' is exported for this purpose.

To understand the following, you should have read the documentation of the webaudio-effect-unit module.

Here's an example of an object contained by this array:

{
  name: 'chorus',
  values: [

    {
      name: 'rate',
      options: {
        type: 'range',
        defaultValue: 1.5,
        min: 0.01,
        max: 8,
        step: 0.01
      },
      set: (effectChain, value) => {
        effectChain.chorus.rate = value;
      }
    },

    {
      name: 'feedback',
      options: {
        type: 'range',
        defaultValue: 0.2,
        min: 0,
        max: 1,
        step: 0.01
      },
      set: (effectChain, value) => {
        effectChain.chorus.feedback = value;
      }
    },

    {
      name: 'delay',
      options: {
        type: 'range',
        defaultValue: 0.0045,
        min: 0,
        max: 1,
        step: 0.01
      },
      set: (effectChain, value) => {
        effectChain.chorus.delay = value;
      }
    }

  ]
}

If you correctly understood the webaudio-effect-unit module, you should have got it. If it's to unclear, please feel free to open an issue with questions! I am glad if I can help you. :smile:

Use just single effects

If you don't want to import all effects, you can also only import single ones. The effect-files are contained in the 'effects' directory.

The exported function to create the EffectUnit follows the following pattern: create{EffectName}(audioCtx: AudioContext)

To just import the data for an effect, the following pattern applies: {EffectName}Data

Example

import gainData from 'webaudio-effect-units-collection/effects/gain';
import createGain from 'webaudio-effect-units-collection/effects/gain';

const audioCtx = new AudioContext();
const gainEffect = createGain(audioCtx);

gainEffect.setValue('gain', 0.4);