var wave = require('../lib/wave');
var squa = require('../lib/square');
var a = 1;
/**
* pseudo-random envelope functions
*/
function preA(f0, t) {
return squa(f0, t)
* squa(f0 + 1, t)
* squa(f0 + 3, t)
* squa(f0 + 7.3, t)
;
}
function preB(f0, t) {
return squa(f0, t)
* squa(f0 + 1, t)
* squa(f0 + 3.9, t)
* squa(f0 + 7.1, t)
;
}
function preC(f0, t) {
return squa(f0, t)
* squa(f0 + 0.1, t)
;
}
function preSimple(f0, t) {
return squa(f0, t)
* squa(f0 + 0.1, t)
* squa(f0 + 0.7398, t)
;
}
function preSlow(t) {
return squa(1/20, t+10);
}
/**
* sounds
*/
function waveBucket(f, pre, t) {
return wave(f, t) * pre(1.28, t)
+ 1 / 3 * wave(3 * f, t) * pre(4.375, t)
+ 1 / 5 * wave(5 * f, t) * pre(9, t)
+ 1 / 7 * wave(7 * f, t) * pre(11, t)
+ 1 / 9 * wave(9 * f, t) * pre(53, t)
+ 1 / 11 * wave(11 * f, t) * pre(174, t)
+ 1 / 13 * wave(13 * f, t) * pre(17, t)
+ 1 / 15 * wave(15 * f, t) * pre(10, t)
;
}
function waveBass(t) {
return wave(50, t) + 0.3 * wave(150, t)
+ 0.4*(squa(50, t)*squa(50, t+(1/50*1.1))) //___|___|___ 50Hz
;
}
function main(t) {
return a * (
0
+ waveBucket(50, preB, t)
+ waveBucket(1000, preA, t)
+ 0.4 * waveBucket(5000, preC, t) * waveBucket(5001, preC, t)
+ 0.2 * waveBass(t) * (0.5 + 0.5 * wave(1/35, t))
+ (
preA(1.17, t) * wave(200, t)
+ preA(1, t) * wave(900, t)
+ preA(3, t) * wave(880, t)
) * preSlow(t)
) ;
}
return function(t) {
return main(t);
}
The Entropy Void еще тексты
Оценка текста
Статистика страницы на pesni.guru ▼
Просмотров сегодня: 2