Delay
A Javascript Delay function. I think I got it right.
The constructor takes params:
- delay time in samples
- feedback level
- mix level
- bufferSize - defaults to to whatever your delay time requires, but can be set to to higher so you can increase the delay time.
You can change the delay time, feedback, and mix levels on the fly. If you set the delay to a higher value than the buffer can hold, it will create a larger buffer.
npm install jdelay
usage
Initiate the delay with the values you want, It will return a function
var audio = ;var Delay = delay = // no feedback { var newDelayParam = time % 5 > 25 ? audiosampleRate * 2 : audiosampleRate * 4 // 2 & 4 second delays // optionally, change delay, feedback and mix params on the fly when you call the delay function var feedback = mix = null var x = return x};
example
Initiate the delay with the values you want, It will return a function
This examples creates a Web Audio API compatible webaudio node:
var audio = ;var Delay = delay = delay2 = Reverb = webaudio = amod = osc = ;var troloop = ; var echo reverb = 0;var dd = 0 swich = true; { echo = / 2 reverb = / 2 return echo + reverb }; var audioSourceBuffer = ; audioSourceBufferloop = false var delayNode = ; audioSourceBuffer; delayNode; audioSourceBufferstart0