Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // wavepot.com
- // satan's bagpipes - justaboutdead
- var volume = 0.666;
- var pitch = 0.666;
- var chorus;
- var voices = 6;
- var separation = 0.00666;
- var detune = 666.666;
- function dsp(t){
- chorus = 0;
- for(i = 0; i < voices; i++){
- chorus += (1 / voices) * $(pitch + (detune * i), t + (i * separation));
- }
- return volume * chorus;
- }
- var tau = 2 * Math.PI;
- function $(n, t){
- return sub(0.666 * tri(n, t) + 0.0666 * sin(n * 666, t), (1 + sin(666, t)) * (2 + (1 + sin(666, t)) * 1), t);
- }
- function sub(wave, mul, t){
- return Math.sin(wave * mul + tau * t);
- }
- function sin(x, t){
- return Math.sin(tau * t * x);
- }
- function tri(x, t){
- return Math.abs(1 - (2 * t * x) % 2) * 2 - 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement