Giter Site home page Giter Site logo

soundbank-reverb's Introduction

soundbank-reverb

Simple Web Audio API based reverb effect.

Based on https://github.com/web-audio-components/simple-reverb by Nick Thompson.

Intended for use as a processor in soundbank, but it is compatible with any Web Audio API AudioNode set up.

Install via npm

$ npm install soundbank-reverb

API

var Reverb = require('soundbank-reverb')

var reverb = Reverb(audioContext)

Pass an instance of AudioContext to the constructor to create an AudioNode.

reverb.wet AudioParam

reverb.dry AudioParam

reverb.cutoff AudioParam

Defaults to 20000.

reverb.filterType (get/set)

Defaults to "lowpass".

Can be any of the filters types specified by BiquadFilterNode

reverb.time (get/set)

Impulse time in seconds. Defaults to 3.

reverb.decay (get/set)

reverb.reverse (get/set)

true or false. Defaults to false.

Example

var Reverb = require('soundbank-reverb')

var audioContext = new AudioContext()

var reverb = Reverb(audioContext)
reverb.connect(audioContext.destination)

reverb.time = 1 //seconds
reverb.wet.value = 0.8
reverb.dry.value = 1

reverb.filterType = 'lowpass'
reverb.cutoff.value = 4000 //Hz

setInterval(function(){
  var source = audioContext.createOscillator()
  source.type = 'sawtooth'
  source.connect(reverb)
  source.start()
  source.stop(audioContext.currentTime + 0.5)
}, 2000)

soundbank-reverb's People

Contributors

mmckegg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

soundbank-reverb's Issues

Problems with MS Edge

It looks like this is causing distorted/choppy output in MS Edge, which has a sampleRate of 192000. The other browsers I've been testing seem to use 44100, which is fine.

Any ideas?

I can put together a test case if need be.

Sometimes Turns off

I've noticed sometimes it goes into a 'mute' state where, it seems like, it's no longer firing the next() event. Any ideas? Similarly, is there a way we could manually call .tick() on the reverb node or something, for games that have a requestAnimationFrame loop and don't want to get into managing timeouts?

Sorry I don't have a repo for testing yet... I'm trying to wrap my head around how this reverb effect actually works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.