Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created November 17, 2012 10:30
Show Gist options
  • Save Sciss/4094727 to your computer and use it in GitHub Desktop.
Save Sciss/4094727 to your computer and use it in GitHub Desktop.
// posted sc-user nov 2012
SynthDef(\elastic  , {  arg  t_trig = 1, freq = 4;
    var signal, in ;
    t = K2A.ar( t_trig) > 0;
     m = Spring.ar(ToggleFF.ar(t), 100, 0.6);
     in = LocalIn.ar(1) * 0.098;
     
     n = Spring.ar(m + in , 3, 0.001);
         h = Spring.ar(n, 0.5  , 0.000026);
         j = Spring.ar(h, 100  , 0.00016);
         k = Spring.ar(j, 1  , 0.000086);
      LocalOut.ar(k* 0.3);
       x = (       DemandEnvGen.ar(
                 Dseq([m, n, h, j, k], inf ),
                SampleDur.ir * 10.5  * freq* (SinOsc.kr(0.0015).range(0.95, 1.04)),
                5,
                -4
            );
        ) * 0.5;
 x =      Limiter.ar(
                LeakDC.ar( x )  );
w = [x, DelayN.ar(x, 0.001, 0.001)];
signal = x * 0.5;
#w, signal = Limiter.ar(LeakDC.ar([w, signal]));
Out.ar([1], w * 0.5);
signal = Out.ar([0], signal );
}).add()
x = Synth(\elastic, [\freq, 8.8]);
x.set(\t_trig, 1);
x.set(\freq, 0.1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment