René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

adsr (Csound opcode)

Generates an ADSR (attack, decay, sustain, release) envelope.
ar      adsr   iatt, idec, isust_level, irel [,idel]
iatt: Time for attack (from value 0 to value 1)
idec: Time for decay (from value 1 to value isust_level)
irel: Time for release from isust_level to 0
adsr.orc
sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 2

instr 1
  ilen = p3
  iamp = p4
 
  aenvr adsr 1*ilen/10, 6*ilen/10, 0.8, 3*ilen/10

  aenvl = aenvr*aenvr

  outs aenvl*iamp, aenvr*iamp
endin
adsr.sco
i1 0 1 30000
/csound/opcodes/adsr.jpg