Use JMSL to generate a CSound score file using statistical distributions of grains read from input sound file.
Paste the output from the text area below into your favorite text editor, save as xxx.sco, and
use xxx.orc listed directly below .
Assumes a CSound orc file like the following, where "aiff\marimba.aif" is the source for grains and has length 0.126 sec.
You MUST set "Dur of input audio file" properly by checking your file's duration first!!!
sr = 44100 ; audio sampling rate is 44.1 kHz
kr = 4410 ; control rate is tenth that Hz
ksmps = 10 ; number of samples in a control period (sr/kr)
nchnls = 2 ; number of channels of audio output
idur = p3
iamp = p4
iskiptime = p5
iattack = p6
irelease = p7
ipan = p8
kamp linen iamp, iattack, idur, irelease
asig soundin "aiff\marimba.aif", iskiptime
arampsig = kamp * asig
outs arampsig * ipan, arampsig * (1-ipan)