Examples: Pling

Three lines of DSP code generating a self-scheduling structure of modal percussion events (by Joachim Heintz).

Download pling.csd
instr Pling
  // generate one sound in a wide range between short/noisy and long/pitched
  plg:a = mode(mpulse(ampdb(random(-22,0)),p3), mtof(random(80,100)),10^(p3-1))
  // distribute anywhere in the stereo field and output
  out(pan2:a[](plg,random(0,1)))
  // call the next instance of this instrument
  schedule(Pling,rnd(1),random(1,4))
endin
schedule(Pling,0,1)