{
   "labels" : [
      "harp",
      "pluck",
      "plucked",
      "just intonation"
   ],
   "id" : "1-5hU",
   "is_private" : null,
   "code" : "(\r\nSynthDef.new(\\harp, {\r\n\t|out=0, freq=440, amp=0.5, gate=1, c3=20, pan=0|\r\n\tvar env, inp, son, tune, pluck, sost;\r\n\tenv = Env.new([0,1, 1, 0],[0.005,0.006, 0.0005],[5,-5, -8]);\r\n    inp = amp * LFClipNoise.ar(2000) * EnvGen.ar(env,gate);\r\n\r\n\ttune = freq.expexp(20.midicps, 100.midicps, 1.003, 1.0001);\r\n\tpluck = freq.explin(20.midicps, 100.midicps, 1/3, 1/2);\r\n\tsost = freq.expexp(20.midicps, 100.midicps, 2, 0.1);\r\n\r\n    son = DWGPlucked2.ar(freq, amp, gate, 4/7, 1/sost, c3, inp, sost, tune);\r\n\tson = LPF.ar(son, max(freq * 3, 2000)) * AmpComp.kr(freq, 300, 1/2);\r\n    DetectSilence.ar(son, 0.0001, doneAction:2);\r\n    Out.ar(out, Pan2.ar(son * 0.05, pan));\r\n}).add;\r\n)\r\n\r\n(\r\n~melody = [\r\n\t3, [7, 9, 12], [6, 8, 11], [7, 9, 12], [7, 9, 12], [6, 7, 9],\r\n\t7/2, [6, 9, 11], [5, 7, 21/2], [6, 8, 10], [6, 8, 10], [5, 6, 8]\r\n];\r\n\r\n~strum_patterns = [\r\n\tPseq([1, 2, 1, 1/2, 1/2, 3]),\r\n\tPseq([1, 1, 2, 4/3, 4/3, 4/3]),\r\n\tPseq([1, 2, 1/2, 1/2, 1, 3]),\r\n\r\n\tPseq([1, 1, 1, 1/2, 1/2, 2]),\r\n\tPseq([1, 1, 1, 1, 1, 1]),\r\n\tPseq([1, 1, 1/2, 1/2, 1, 2]),\r\n];\r\n\r\nPbind.new(\r\n\t\\instrument, \\harp,\r\n\t\\delta, Prand(0.7*~strum_patterns, inf),\r\n\t\\legato, inf,\r\n\t\\amp, 0.5,\r\n\t\\strum, Pseq(0.06*[0, 1, 1, 0, 0, 0.5], inf),\r\n\t\\freq, Pseq([0, -1, -2, -1, 0, 1, 2, 1].dupEach +.x ~melody, inf) * 308 / 7\r\n).play;\r\n\r\nPbind.new(\r\n\t\\instrument, \\harp,\r\n\t\\delta, Prand(0.7 * [Pseq([1/2], 4), Pseq([1/3], 6), Pseq([1/4], 8)], inf),\r\n\t\\legato, inf,\r\n\t\\amp, 0.1,\r\n\t\\freq, Pseq([1, 2, 1, 4, 1, 2], inf) * 308 / 7\r\n).play\r\n)",
   "author" : "akselai",
   "name" : "Digital Harp (and a just intonation demo)",
   "ancestor_list" : [],
   "description" : "Digital concert harp. Requires DWGPlucked2."
}
