{
   "code" : "(\r\n// Simple amplitude trigger\r\nSynthDef(\\ampTrigger, { |in|\r\n\tvar snd = SoundIn.ar(in);\r\n\tvar chain = FFT(LocalBuf(512), snd);\r\n\r\n\t// here tune the threshold and sensitivity:\r\n\tvar trig = Onsets.kr(chain, 0.5);\r\n\r\n\tSendReply.kr(trig, '/ampTrigger', Amplitude.kr(snd));\r\n}).add;\r\n)\r\n\r\n// start the tracker on scsynth\r\nSynth(\\ampTrigger);\r\n\r\n(\r\n// receive the values in sclang\r\nOSCdef(\\ampTrigger, { |m|\r\n\tm.postln;\r\n\t// now use m[3] for your purpose\r\n\t// or just fire up a synth from this function ;)\r\n}, '/ampTrigger');\r\n)",
   "id" : "1-4V9",
   "is_private" : null,
   "labels" : [
      "amplitude trigger"
   ],
   "description" : "Simple amplitude trigger using Onsets, Amplitude and SendReply for sending triggers to sclang from SoundIn.",
   "ancestor_list" : [],
   "name" : "Simple Amplitude Trigger (language side)",
   "author" : "rukano"
}
