Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s.boot;
- ~nRhythmPerms = 10; //differnet rhythm permutations at every performance
- ~patRhythm = ~nRhythmPerms.collect{|i| [i+1, [1, 2+i, [3+i, [4, 5]], 6+i]].convertRhythm};
- ~rSwitch = (); //make dict
- ~pstepDur = ();
- ~pstepDur[\cicada] = 8; ~pstepDur[\cricket] = 8; ~pstepDur[\ferry] = 8; ~pstepDur[\natchez] = 8;
- ~pstepDur[\rainGutter] = 8; ~pstepDur[\rainShower] = 8; ~pstepDur[\riverDrone] = 8; ~pstepDur[\thunder] = 8;
- ~cicada = ();
- ~cicada[\profDurSynth] = [[1077.17,1016.71,254.18,254.18,1016.71,1077.17,1016.71,1016.71,1077.17,1016.71,1077.17],[1016.71,1077.17,1016.71,1077.17,1016.71,1016.71,1046.5,1016.71,1016.71],[1108.73,1016.71,1016.71,1108.73,932.33,1108.73,1108.73],[1046.5,1108.73,1108.73,1046.5,880.0,1046.5,1046.5],[1046.5,1046.5,1046.5,1046.5,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1046.5,1046.5],[932.33,1046.5,1046.5,1046.5,932.33,932.33,932.33],[880.0,1046.5,932.33,932.33,987.77,880.0,880.0],[905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,932.33,880.0,880.0,1141.22,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79],[932.33,905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1108.73,932.33,932.33],[987.77,1141.22,932.33,932.33,1108.73,987.77,987.77],[1141.22,1174.66,1141.22,987.77,959.65,1108.73,1141.22],[1108.73,1108.73,1108.73,1141.22,1046.5,1108.73,1108.73],[1174.66,959.65,959.65,1174.66,1108.73,959.65,1174.66],[959.65,959.65,959.65,959.65,1046.5,1046.5,959.65],[1046.5,1046.5,1046.5,1046.5,1016.71,1108.73,1046.5],[1108.73,1108.73,1046.5,1046.5,1046.5,1046.5,1108.73],[1046.5,1016.71,1016.71],[1046.5]];
- ~cicada[\profDurSynthInv] = [[959.65,1016.71,905.79,959.65,959.65,1174.66,1174.66,1016.71,959.65,1016.71,959.65],[987.77,959.65,959.65,293.66,277.18,293.66,277.18,987.77,987.77],[932.33,880.0,959.65,285.3,285.3,932.33,932.33],[987.77,932.33,959.65,277.18,269.29,987.77,987.77],[1108.73,932.33,959.65,277.18,277.18,987.77,1108.73],[1141.22,1046.5,987.77,959.65,905.79,1016.71,932.33,959.65,320.24,320.24,1108.73,1016.71,905.79,959.65,987.77,1046.5,1141.22],[1077.17,1077.17,959.65,329.63,254.18,293.66,261.63,269.29,277.18,302.27,329.63,1174.66,1077.17],[1016.71,1046.5,1108.73,320.24,320.24,1016.71,905.79,959.65,987.77,1046.5,1141.22,1016.71],[905.79,987.77,1141.22,302.27,302.27,1077.17,905.79],[905.79,987.77,1077.17,261.63,261.63,1016.71,905.79],[905.79,987.77,1077.17,269.29,254.18,905.79,905.79],[932.33,905.79,905.79,254.18,269.29,905.79,932.33],[1077.17,1016.71,905.79,269.29,302.27,905.79,1077.17],[1077.17,1016.71,932.33,302.27,311.13,932.33,1077.17],[959.65,905.79,1016.71,311.13,269.29,1077.17,959.65],[987.77,987.77,1077.17,277.18,285.3,959.65,987.77],[987.77,959.65,932.33,269.29,932.33,987.77],[987.77,987.77],[987.77]];
- ~cicada[\profDynSynth] = [[959.65,1016.71,905.79,959.65,959.65,1174.66,1174.66,1016.71,959.65,1016.71,959.65],[987.77,959.65,959.65,293.66,277.18,293.66,277.18,987.77,987.77],[932.33,880.0,959.65,285.3,285.3,932.33,932.33],[987.77,932.33,959.65,277.18,269.29,987.77,987.77],[1108.73,932.33,959.65,277.18,277.18,987.77,1108.73],[1141.22,1046.5,987.77,959.65,905.79,1016.71,932.33,959.65,320.24,320.24,1108.73,1016.71,905.79,959.65,987.77,1046.5,1141.22],[1077.17,1077.17,959.65,329.63,254.18,293.66,261.63,269.29,277.18,302.27,329.63,1174.66,1077.17],[1016.71,1046.5,1108.73,320.24,320.24,1016.71,905.79,959.65,987.77,1046.5,1141.22,1016.71],[905.79,987.77,1141.22,302.27,302.27,1077.17,905.79],[905.79,987.77,1077.17,261.63,261.63,1016.71,905.79],[905.79,987.77,1077.17,269.29,254.18,905.79,905.79],[932.33,905.79,905.79,254.18,269.29,905.79,932.33],[1077.17,1016.71,905.79,269.29,302.27,905.79,1077.17],[1077.17,1016.71,932.33,302.27,311.13,932.33,1077.17],[959.65,905.79,1016.71,311.13,269.29,1077.17,959.65],[987.77,987.77,1077.17,277.18,285.3,959.65,987.77],[987.77,959.65,932.33,269.29,932.33,987.77],[987.77,987.77],[987.77]];
- ~cicada[\profDynSynthInv] = [[932.33,1174.66,1077.17,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,959.65,959.65,905.79,987.77,1016.71,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[905.79,269.29,932.33,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,905.79,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,932.33,905.79,905.79,905.79],[932.33,269.29,905.79,905.79,905.79,905.79],[932.33,254.18,905.79,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,285.3,932.33,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,269.29,932.33,905.79,932.33,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,1077.17,905.79,905.79,959.65,932.33,932.33,987.77,1046.5],[1077.17,1016.71,959.65,959.65,905.79,987.77,1077.17,905.79,932.33,959.65,932.33,932.33,987.77,1046.5],[1077.17,1077.17,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[1077.17,1077.17,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[1077.17,1016.71,1016.71]];
- ~cicada[\profPitchSynth] = [[254.18,254.18,254.18,254.18,254.18,254.18,254.18],[880.0,880.0,880.0,880.0,880.0,880.0,880.0],[932.33,932.33,932.33,932.33,932.33,932.33,932.33],[1016.71,1016.71,1016.71,1016.71,1016.71,1016.71,1016.71],[932.33,932.33,932.33,932.33,932.33,932.33,932.33],[1046.5,1046.5,1046.5,1046.5,1046.5,1046.5,1046.5],[959.65,959.65,959.65,959.65,959.65,959.65,959.65],[1077.17,1016.71,1077.17,1016.71,1077.17,1016.71,1016.71,1077.17,1016.71,1077.17,1016.71,1077.17,1016.71,1077.17],[959.65,959.65,959.65,959.65,959.65,959.65,959.65],[987.77,987.77,987.77,987.77,987.77,987.77,987.77],[1046.5,1046.5,1046.5,1046.5,1046.5,1046.5,1046.5],[1108.73,1108.73,1108.73,1108.73,1108.73,1108.73,1108.73],[905.79,905.79,905.79,905.79,905.79,905.79,905.79],[1141.22,1141.22,1141.22,1141.22,1141.22,1141.22,1141.22]];
- ~cicada[\profPitchSynthInv] = [[1141.22,1141.22,1141.22,1141.22,1141.22,1141.22,1141.22],[329.63,329.63,329.63,329.63,329.63,329.63,329.63],[320.24,320.24,320.24,320.24,320.24,320.24,320.24],[285.3,285.3,285.3,285.3,285.3,285.3,285.3],[311.13,311.13,311.13,311.13,311.13,311.13,311.13],[277.18,277.18,277.18,277.18,277.18,277.18,277.18],[302.27,302.27,302.27,302.27,302.27,302.27,302.27],[269.29,285.3,269.29,285.3,269.29,285.3,285.3,269.29,285.3,269.29,285.3,269.29,285.3,269.29],[302.27,302.27,302.27,302.27,302.27,302.27,302.27],[293.66,293.66,293.66,293.66,293.66,293.66,293.66],[277.18,277.18,277.18,277.18,277.18,277.18,277.18],[261.63,261.63,261.63,261.63,261.63,261.63,261.63],[320.24,320.24,320.24,320.24,320.24,320.24,320.24],[254.18,254.18,254.18,254.18,254.18,254.18,254.18]];
- t = TempoClock(queueSize: 8192*2).permanent_(true);
- SynthDef(\bpfsaw, {
- arg atk=2, sus=0, rel=3, c1=1, c2=(-1),
- freq=500, detune=0.2, pan=0, cfhzmin=0.1, cfhzmax=0.3,
- cfmin=500, cfmax=2000, rqmin=0.1, rqmax=0.2,
- lsf=200, ldb=0, amp=1, out=0;
- var sig, env;
- env = EnvGen.kr(Env([0,1, 1,0],[atk,sus, rel]), doneAction:2);
- sig = Saw.ar(freq * {LFNoise1.kr(0.5,detune).midiratio}!2);
- sig = BPF.ar(
- sig,
- {LFNoise1.kr(
- LFNoise1.kr(4).exprange(cfhzmin,cfhzmax)
- ).exprange(cfmin,cfmax)}!2,
- {LFNoise1.kr(0.1).exprange(rqmin,rqmax)}!2
- );
- sig = BLowShelf.ar(sig, lsf, 0.5, ldb);
- sig = Balance2.ar(sig[0], sig[1], pan);
- sig = sig * env * amp;
- Out.ar(out, sig);
- }).add;
- SynthDef(\reed, {
- |out = 0, freq = 440, amp = 0.1, gate = 1, atk = 0.3, rel = 0.3|
- var snd, blow;
- snd = Pulse.ar((Rand(-0.03, 0.05) + freq.cpsmidi).midicps, 0.48 + LFNoise1.kr(0.06, 0.1), 0.2);
- snd = Disintegrator.ar(snd, 0.5, 0.7);
- snd = snd * LFNoise2.kr(5, 0.05, 1);
- blow = EnvGen.ar(Env.asr(atk, 1.0, rel), gate, doneAction: 2);
- snd = snd + BPF.ar(snd, blow.linexp(0, 1, 2000, 2442), 0.3, 3);
- snd = BHiShelf.ar(snd, 1200, 1, 3);
- snd = snd * blow;
- Out.ar(out, Pan2.ar(snd, 0, amp));
- }).add;
- SynthDef(\satan, {
- arg envTime = 1.0e-3, knee = -10.dbamp, out, in, mix = 1, amp = 0.1;
- var sig, inSig = In.ar(in, 2);
- sig = DelayC.ar(inSig, 0.01, envTime * 0.5) *
- EnvFollow.ar(inSig, 1 - (envTime * SampleRate.ir).reciprocal).max(knee).reciprocal;
- sig = sig * amp;
- Out.ar(out, (1 - mix) * inSig + (sig * mix));
- }).add;
- SynthDef(\reverb, { |out, in, damp = 0.5,
- delayTime = 10, size = 2, diff = 0.2, feedback = 0.2|
- var sig, inSig = In.ar(in, 2);
- Out.ar(out, Greyhole.ar(inSig, delayTime, damp, size, diff, feedback));
- }).add;
- (
- ~rSwitch[\cicada] = Pswitch(~patRhythm, Pseq([5, 6, 7], inf)).asStream;
- ~pstepDur[\cicada] = 6;
- i = [\cicadaDefSrc, \cicadaDefDist, \cicadaDefVerb];
- Pbindef(\cicadaDefSrc,
- \instrument, Prand([\reed, \bpfsaw], inf),
- \amp, 0.2*(1**Pgauss(0, 0.1)),
- \freq,Pstep(Pseq(~cicada[~cicada.keys.choose], inf), ~pstepDur[\cicada], inf),
- \dur, Pstep(~rSwitch[\cicada].next, ~pstepDur[\cicada], inf),
- \legato, 1,
- \atk, Pwhite(1, 4),
- \rel, Pwhite(1, 4),
- \strum, Pseq([0.1, 0.3, 0.0, 0.5], inf),
- \fxOrder, Pstep([[1, 2], 1, 2], ~pstepDur[\cicada], inf),
- \cleanupDelay, Pfunc{|e| e.atk + e.rel},
- \cleanupClock, t,
- \freePerGroup, true
- );
- Pbindef(\cicadaDefDist,
- \fx, \satan,
- \mix, Prand([0.0, 0.1, 0.2], inf),
- \envTime, 0.0001,
- \knee, -30.dbamp,
- \cleanupDelay, Pkey(\envTime)
- );
- Pbindef(\cicadaDefVerb,
- \fx, \reverb,
- \delayTime, 20,
- \damp, 0.2,
- \size, 30,
- \diff, 0.2,
- \feedback, 0.2,
- \cleanupDelay, Pkey(\delayTime)
- );
- p = PbindFx(*i.collect { |x| Pbindef(x) });
- ~cicadaDef = p;
- );
- Pdef(\cicada, ~cicadaDef).play;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement