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/a814af2d84a0b88eec8a to your computer and use it in GitHub Desktop.
Save mortuosplango/a814af2d84a0b88eec8a to your computer and use it in GitHub Desktop.
#‎Hackpact2015‬ laad.com.mx/hackpact2015eng.html
‪#‎Day‬ 5
s.boot;
(
c = UGen.allSubclasses.select{
|cls|
var method = cls.class.findRespondingMethodFor(\ar);
try {
(
method.notNil
and:
cls.name.asString.contains("Stk").not
and:
cls.name.asString.contains("Trig").not
and:
method.argList.contains("freq")
and:
method.argList.contains("mul")
and:
method.argList.contains("buf").not
and:
method.argList.contains("chain").not
)
}
{ false }
};
)
(
y = (($a.ascii..$z.ascii) ++ ($A.ascii..$Z.ascii)).collect({
|chr, index|
var cls = c[index];
if(cls.class.findRespondingMethodFor(\ar).argList.contains("in"), {
(chr.asAscii ++ cls.asString ++ ".ar(in: WhiteNoise.ar)").postln;
SynthDef(chr.asAscii.asSymbol, { |out=0,amp=0.1,sustain=1.0|
var snd, env;
snd = cls.ar(in: WhiteNoise.ar, input: WhiteNoise.ar);
env = EnvGen.ar(Env.perc(0.01,sustain, curve: -2), doneAction:2);
Out.ar(out, Pan2.ar(snd * env * amp, index.linlin(0,52, -1.0,1.0)));
}).add;
}, {
(chr.asAscii ++ " " ++ cls).postln;
SynthDef(chr.asAscii.asSymbol, { |out=0,amp=0.1,sustain=1.0|
var snd, env;
snd = cls.ar();
env = EnvGen.ar(Env.perc(0.01,sustain, curve:-2), doneAction:2);
Out.ar(out, Pan2.ar(snd * env * amp, index.linlin(0,52, -1.0,1.0)));
}).add;
});
});
SynthDef(" ", { |out=0,amp=0.1,sustain=1.0|
var snd, env;
snd = Line.ar(dur:sustain,doneAction:2);
}).add;
)
(
Pdef(\a,
Pbind(\instrument, Pseq(
[
Pseq(x.("au l gb")),
Prand(x.("Gaub l gbH"), 8)
],
inf),
\dur, 0.15,
\amp, 0.2,)).play
)
(
Pdef(\b,
Pbind(\instrument, Pseq(x.("ab CdE"),inf),
\dur, 0.12)).play
)
(
Pdef(\c,
Pbind(\instrument, Pseq(x.("def I"),inf),
\dur, 0.14)).play
)
(
Pdef(\d,
Pbind(\instrument, Pseq(x.("Hi jk "),inf))).play
)
(
Pdef(\e,
Pbind(\instrument, Pseq(x.(" Jk lm "),inf),
\dur, 0.45)).play
)
(
Pdef(\ee,
Pbind(\instrument, Pseq(x.("Hi lm n o"),inf),
\dur, 0.24)).play
)
(
Pdef(\f,
Pbind(\instrument, Pseq(x.(" lm n pqr"),inf),
\dur, 0.13)).play
)
(
Pdef(\d,
Pbind(\instrument, Pseq(x.("Z z ZkZ z z z z"),inf),
\dur, 0.4)).play
)
(
Pdef(\eee,
Pbind(\instrument, Pseq(x.(" F f G "),inf),
\dur, 0.2)).play
)
(
Pdef(\g,
Pbind(\instrument, Pseq(x.(" H H"),inf),
\dur, 0.5,
\amp, 0.05)).play
)
PdefAllGui.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment