Skip to content

Instantly share code, notes, and snippets.

@Dewb
Last active May 28, 2018 19:01
Show Gist options
  • Save Dewb/4b8da2dd9343545ab3e161355f9b9c69 to your computer and use it in GitHub Desktop.
Save Dewb/4b8da2dd9343545ab3e161355f9b9c69 to your computer and use it in GitHub Desktop.
THX sound Supercollider exercise
// THX sound
// https://twitter.com/THX/status/1000077588415447040
p = Pseq([90, 86, 81, 74, 69, 62, 57, 50, 45, 38, 26].wrapExtend(30).midicps + List[0,1,-1].stutter(11)).asStream;
SynthDef.new("thx", {
var saws = {
var target = p.next;
var midtime = 2.6.rand2;
var env = Env(
[200.400.rand2, if (target > 300, {200}, {400}), target],
[midtime, 14 - midtime],
\sine
);
Saw.ar(EnvGen.kr(env));
}.dup(30);
var amp = EnvGen.kr(Env([0, 0.3, 0.6, 1.0, 1.0, 0], [0.25, 7.75, 10, 8, 4], \linear));
var stereo = Splay.ar(saws.scramble, 1, amp, 0, true);
Out.ar(0, FreeVerb2.ar(stereo[0], stereo[1], 0.45, 0.35, 0.3, 1.0));
}).play;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment