Skip to content

Instantly share code, notes, and snippets.

@audionerd
Created January 6, 2009 04:29
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 audionerd/43669 to your computer and use it in GitHub Desktop.
Save audionerd/43669 to your computer and use it in GitHub Desktop.
// "Laugh Track" -- an attempt at laugh synthesis
// For SuperCollider 3.2 -- requires FormantTable
(
#f, a, q = FormantTable.get(\altoA);
e = Env(
[ 1.6315789222717, 2.8684210777283, 0, 1.1526317596436, 0, 0.63157892227173, 0, 0, 0.39473664164831, 0.41710549016785, 0, 0.33685091589462, 0.3538348548878, 0, 0.10526323318481, 0 ],
[ 0.099179289557717, 0.029608596454967, 0.070896452123469, 0.015656579624523, 0.045265132730657, 0.08636364069852, 0.027344267630401, 0.021196740851856, 0.025568173912275, 0.020519098486223, 0.029819674626466, 0.025645296259773, 0.057419430367461, 0.18465909090909, 0.16357317837802 ]
);
w = SCWindow("Laugh Editor", Rect(200,200,400,300));
v = SCEnvelopeEdit(w, w.view.bounds.moveBy(20,20).resizeBy(-40,-140), e, 20).resize_(5);
b = SCButton(w, w.view.bounds.moveBy(20,200).resizeBy(-40,-240)).states_([["Laugh"]]).resize_(5)
.action_({
x = {
var saw = Saw.ar((EnvGen.kr(v.env, doneAction:2) * 440)); // lazy
var out = Mix.new(BBandPass.ar(saw, f, q) * a).dup;
HPF.ar(out, 250); // avoid blowups
}.play;
});
w.front;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment