#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
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}, |
// basic usage: new Markov(lotsOfText).generate() | |
// markov chain constructor | |
// | |
// @string input {example text} | |
// @integer len {optional # of words to output} | |
// @integer stateSize {optional chain order} | |
function Markov( input, len, stateSize ){ | |
this.cache = Object.create(null) | |
this.words = input.split(/\s/) |
// 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; | |
}()); | |
}()); |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', 'path/to/file.mixlair') | |
xhr.responseType = 'arraybuffer' | |
xhr.onload = function(){ | |
var buffer = new Float32Array(xhr.response) | |
, ac = new webkitAudioContext() | |
, ab = ac.createBuffer(1, buffer.length, 44100) | |
, src = ac.createBufferSource() | |
ab.getChannelData(0).set(buffer) | |
src.buffer = ab |