Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmckegg/soundbank-reverb
Simple Web Audio API based reverb effect.
https://github.com/mmckegg/soundbank-reverb
Last synced: about 2 months ago
JSON representation
Simple Web Audio API based reverb effect.
- Host: GitHub
- URL: https://github.com/mmckegg/soundbank-reverb
- Owner: mmckegg
- Created: 2014-12-23T07:24:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-11T11:39:26.000Z (almost 10 years ago)
- Last Synced: 2024-10-23T08:38:32.814Z (about 2 months ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 22
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-web-effect - soundbank - Simple Web Audio API based reverb effect. (🚀 A series of exquisite and compact web page cool effects / Audio Effect)
- awesome-web-effect - soundbank - Simple Web Audio API based reverb effect. (🚀 A series of exquisite and compact web page cool effects / Audio Effect)
README
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](https://github.com/mmckegg/soundbank), but it is compatible with any [Web Audio API](https://developer.mozilla.org/en-US/docs/Web_Audio_API) AudioNode set up.
## Install via [npm](https://npmjs.org/package/soundbank-reverb)
```bash
$ npm install soundbank-reverb
```## API
```js
var Reverb = require('soundbank-reverb')
```### `var reverb = Reverb(audioContext)`
Pass an instance of [AudioContext](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) to the constructor to create an AudioNode.
### `reverb.wet` [AudioParam](https://developer.mozilla.org/en-US/docs/Web/API/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](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode.type)
### `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
```js
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 = 1reverb.filterType = 'lowpass'
reverb.cutoff.value = 4000 //HzsetInterval(function(){
var source = audioContext.createOscillator()
source.type = 'sawtooth'
source.connect(reverb)
source.start()
source.stop(audioContext.currentTime + 0.5)
}, 2000)
```