#This script generates a fade-in and fade-out to the selected Sound # using the cosine-function squared in [0, 0.5*pi] # the variable 't' (next line) determines the window of the fading t = 0.01 Formula... if x < 't' then self * (1- (cos(0.5 * pi * (x/'t'))^2)) else self fi ft = Get finishing time Formula... if (x > ('ft' - 't')) then self * (1- (cos((0.5*pi * (( 'ft' - x )/'t')))^2)) else self fi