Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created June 30, 2013 00:15
Show Gist options
  • Save enjalot/5893228 to your computer and use it in GitHub Desktop.
Save enjalot/5893228 to your computer and use it in GitHub Desktop.
timbre.js
{"description":"timbre.js","endpoint":"","display":"svg","public":true,"require":[{"name":"timbrejs","url":"http://mohayonao.github.io/timbre.js/timbre.js"},{"name":"supercollider","url":"http://mohayonao.github.io/subcollider.js/builds/subcollider-min.js"},{"name":"supercollider","url":"http://mohayonao.github.io/subcollider.js/builds/subcollider-min.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/erEyNZY.png"}
var svg = d3.select("svg");
T.reset();
timbre.reset();
//timbre.rec(function(output) {
var midis = [69, 71, 72, 76, 69, 71, 72, 76].scramble();
var msec = timbre.timevalue("bpm120 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);
}
}).play();
/*
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