-m128
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
seed 0
//and add random deviations to attack time
instr PercSine
iDb = -14
iMidiPitch = 70
iAttackTime random 1/1000, 3/1000 ;seconds for rise from zero to maximum
aEnv transeg 0, iAttackTime, 4, ampdb(iDb), p3-iAttackTime, -4, 0
aEnvRndDb randi 2, 20, 2
kPchRnd randi 1/6, 6, 2
aSine poscil aEnv*ampdb(aEnvRndDb), mtof(iMidiPitch+kPchRnd)
out aSine, aSine
endin
i "PercSine" 0 5
100
100
320
240
true
255
255
255