Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created June 30, 2013 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enjalot/5893325 to your computer and use it in GitHub Desktop.
Save enjalot/5893325 to your computer and use it in GitHub Desktop.
timbre.js reich
{"description":"timbre.js reich","endpoint":"","display":"svg","public":true,"require":[{"name":"supercollider","url":"http://mohayonao.github.io/subcollider.js/builds/subcollider-min.js"},{"name":"timbre-mod","url":"https://gist.github.com/enjalot/5893275/raw/3a9f3430225510d2258381c9e6ab1506ff8bb86f/timbre-mod.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/NlmUnFy.png"}
//http://mohayonao.github.io/timbre.js/
var svg = d3.select("svg");
TReset();
TFactory();
timbre.rec(function(output) {
var midis = [89, 91, 82, 96, 79, 91, 92, 76].scramble();
var msec = timbre.timevalue("bpm184 l8");
var synth = T("OscGen", {env:T("perc", {r:msec, ar:true})});
T("interval", {interval:msec}, function(count) {
if (count < midis.length) {
synth.noteOn(midis[count], 100);
} else {
output.done();
}
}).start();
output.send(synth);
}).then(function(result) {
var L = T("buffer", {buffer:result, loop:true});
var R = T("buffer", {buffer:result, loop:true});
var num = 400;
var duration = L.duration;
R.pitch = (duration * (num - 1)) / (duration * num);
T("delay", {time:"bpm120 l16", fb:0.1, cross:true},
T("pan", {pos:-0.6}, L), T("pan", {pos:+0.6}, R)
).play();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment