{
   "author" : "Luka P.",
   "name" : "240 plucks",
   "ancestor_list" : [],
   "description" : "using Pluck.ar with PinkNoise as input and Patterns - major scale with sequence: 1,3,7,8 and randomly 10,11,13,14 at some weighted random intervals. at 50bpm it becomes quite soothing. Needs JPverb from sc3_plugins.",
   "labels" : [
      "rythmic",
      "patterns",
      "plucking",
      "soothing"
   ],
   "is_private" : null,
   "id" : "1-5cM",
   "code" : "(\r\nSynthDef(\"plucking\", {arg out = 0, amp = 0.1, freq = 440, decay = 5, coef = 0.1;\r\n\tvar env, snd;\r\n\tenv = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\r\n\tsnd = Pluck.ar(\r\n\t\tin: PinkNoise.ar(amp),\r\n\t\ttrig: Impulse.kr(0),\r\n\t\tmaxdelaytime: 0.1,\r\n\t\tdelaytime: freq.reciprocal,\r\n\t\tdecaytime: decay,\r\n\t\tcoef: coef);\r\n\tsnd = LeakDC.ar(snd).clip2;\r\n\tOut.ar(out, snd * env);\r\n}).add;\r\n\r\nb = Bus.audio(s,1);\r\n\r\nSynthDef(\"reverbBus\", { arg outBus = 0, inBus, wet = 0.5;\r\n\tvar input, rev;\r\n\tinput = In.ar(inBus,1);\r\n\trev = JPverb.ar(input * wet, t60:3);\r\n    Out.ar(outBus, input + rev);\r\n}).add;\r\n)\r\n\r\n\r\n( // start reverb at the end of the group\r\n~reverb = Synth(\"reverbBus\", [\\inBus, b, \\wet, 0.6]);\r\n\r\nPbind(\r\n\t\\instrument, \"plucking\",\r\n\t\\out, b,\r\n\t\\scale, Scale.major.tuning_(\\just),\r\n\t\\octave, 4,\r\n\t\\degree, Pseq([1,3,7,8,Prand([7,10,11,13,14]),8,7,3], inf),\r\n\t\\dur, Pseq([Pwrand([\r\n\t\tPseq([0.2,0.2]),\r\n\t\t//0.2,\r\n\t\t0.4,\r\n\t\tPseq([0.1],4),\r\n\t\tPseq([0.05],4)],\r\n\t\t[0.5,0.3,0.1,0.1] // weights\r\n\t)], 240),\r\n\t\\coef, Pwrand([0.8, 0.6, 0.4, 0.2], [0.4,0.3,0.2,0.1], inf),\r\n\t\\amp, 1,\r\n\t\\addAction, 0, // make sure new synths are added to head of group (optional)\r\n).play;\r\n)\r\n\r\n// set reverb 'wetness'\r\n~reverb.set(\\wet,1);\r\n\r\n( // set tempo\r\nvar bpm = 50;\r\nt = TempoClock.default;\r\nt.tempo_(bpm/60) // beats per minute\r\n)"
}
