forked from mmckegg/loop-drop-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudio-context.js
33 lines (28 loc) · 941 Bytes
/
audio-context.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var audioContext = new webkitAudioContext()
module.exports = audioContext
audioContext.sources = {
sample: require('soundbank-sample'),
oscillator: require('soundbank-oscillator')
}
audioContext.providers = {
inherit: require('soundbank-inherit'),
scale: require('soundbank-scale'),
slice: require('soundbank-slice'),
multi: require('soundbank-multi'),
range: require('./lib/range')
}
audioContext.modulators = {
lfo: require('lfo'),
adsr: require('adsr'),
slide: require('soundbank-slide')
}
audioContext.processors = {
gain: audioContext.createGain.bind(audioContext),
filter: audioContext.createBiquadFilter.bind(audioContext),
delay: require('soundbank-delay'),
dipper: require('soundbank-dipper'),
overdrive: require('soundbank-overdrive'),
bitcrusher: require('bitcrusher').bind(this, audioContext, {bufferSize: 256}),
pitchshift: require('soundbank-pitch-shift')
}
audioContext.sampleCache = {}