#effect params
Quick and dirty overview of what things are and how you can change them
##tremolo periodic modulation of gain.
example: opening guitar riff here
var sr = 48e3 | |
, sec = 5 | |
, len = sr * sec | |
, ctx = new webkitAudioContext() | |
, arr = new Float32Array(len) | |
, buf = ctx.createBuffer(1, len, sr) | |
, src = ctx.createBufferSource() | |
, i = 0 | |
for ( ; i < len; ++i ) arr[i] = Math.random() |
for(i=0;++i<100;)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i) |
function fibonacci( n ){ | |
var val = '1', last = '0', tmp, i = 1 | |
for ( ; val.length < n; ++i ){ | |
tmp = val | |
val = add(last, val) | |
last = tmp | |
} | |
return i | |
} |
var max = 1e4, obj = {}, val = t = i = 0 | |
function sum( n ) { | |
for ( var m = Math.sqrt(n), v = 1, i = 2; i <= m; ++i ) | |
!(n % i) && (v += i) && i != m && (v += n / i) | |
return n ? v : 0 | |
} | |
for ( ; i < max; ++i ) | |
if ( !obj[i] && (t = sum(i)) != i && sum(t) == i ) |
var i, l, max = 2e6, primes = [], val = 0 | |
function isPrime( n ) { | |
var i = 2 | |
if ( n < 2 ) return false | |
if ( n == 2 ) return true | |
for ( ; i < n; ++i ) | |
if ( n % i === 0 ) | |
return false | |
return true |
// return an array containing (len) linearly-spaced values from (min) to (max) | |
function linspace(from, to, len){ | |
var arr = new Array(len) | |
, step = ( to - from ) / ( len - 1 ) | |
, i = 0 | |
for ( ; i < len; ++i ) | |
arr[i] = from + ( i * step ) | |
return arr | |
} |
// populate | |
$('.sections').each(function(){ | |
var min = $(this).offset().top | |
, height = $(this).outerHeight(); | |
offsets.push({min: min, max: min + height}); | |
}); | |
// turns into this... | |
var offsets = [ | |
{min: 300, max: 600}, |
// audioContext == webkitAudioContext | |
// bufferSource == AudioBufferSourceNode | |
var tremolo = new Tremolo(audioContext) | |
bufferSource.connect(tremolo.input) | |
tremolo.connect(audioContext.destination) | |
tremolo.depth = 0.5 | |
tremolo.frequency = 7 |
#effect params
Quick and dirty overview of what things are and how you can change them
##tremolo periodic modulation of gain.
example: opening guitar riff here
var global = (function(){ | |
return (function(){ | |
return this.constructor.prototype; | |
}()); | |
}()); |