Hi!

In my project I'm compiling a new wave file from fragments of source wav files.
The problem is that this that using parts of source files sometimes causes audiable clicks (when cutting through an wave peak, i guess).

Is there a way to avoid this?
Maybe implementing some kind of amplitude envelope?

This is a typical instrument from my ORC file:

instr 60
   ivol = p4
   ipan = p5 * 1.570796327
   aleft, aright diskin "Grand/80/60.wav", 1
   aleft = aleft * ivol * cos(ipan)
   aright = aright * ivol * sin(ipan)
   outs aleft, aright
endin


This is how I use it now in the SCO file:

;inst start length vol pan
i60 0 1 1 0
i62 2 2 1 1
i64 4 4 .5 .5
i65 6 1 .2 0

Ideas? Solutions?
Thank you in advance!

Jonas