Skip to content

Instantly share code, notes, and snippets.

@mortuosplango
Created September 20, 2015 22:10
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 mortuosplango/46188ba6f5c5dfca2df7 to your computer and use it in GitHub Desktop.
Save mortuosplango/46188ba6f5c5dfca2df7 to your computer and use it in GitHub Desktop.
#‎Hackpact2015‬ laad.com.mx/hackpact2015eng.html
‪#‎Day‬ 7
(
s.reboot;
StageLimiter.activate;
)
(
p = [];
~buildPath = { |cls,path,index=0|
if(cls.subclasses.size > 0, {
cls.subclasses.do{ |subcls, index|
~buildPath.(subcls,path ++ (cls -> [cls.methods.size, index]), index);
};
}, {
p = p.add(path ++ (cls -> [cls.methods.size, index]));
});
};
~buildPath.(Object, []);
)
(
~playPath = { |path|
var lossarray = 0.95;
var karray = path[1..].collect({ |v| v.key.name.asString.size }).linlin(2, 30, -1.0, 1.0);
var delaylengtharray = path.collect({ |v| v.value[0] }).linlin(0, 330, 0.01, 0.8);
var numSubclasses = path[path.size-2].key.subclasses.size;
var index = path.last.value[1];
var pos = index.linlin(0,numSubclasses,-1.0,1.0);
var impMul = if(index==0, { 1 }, { 0.8 });
path[0].key.name.post;
path[1..].do{ |node|
("->" ++ node.key.name).post;
};
"\n".post;
{
var snd = NTube.ar((InFeedback.ar([0,1].choose) * EnvGen.ar(Env.asr(0.01, 0.2,0.45)))
+ Ringz.ar(Impulse.ar(0, mul: impMul * [-1,1].choose ),
Rand(50.0,55.0),
0.1)
, lossarray, karray, delaylengtharray);
DetectSilence.ar(snd, 0.001, 0.1, doneAction:2);
Pan2.ar(LeakDC.ar(snd.tanh) * 0.5, pos);
}.play;
}
);
(
Tdef(\tree, {
p.do{ |path,index|
~playPath.(path);
(0.03 + (0.03 * path.size) + 0.01.rand).wait;
};
}).play;
)
Tdef(\tree).stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment