A command to gradually increase the amplitude of a selected Sound.
determines whether you want to fade all channels or only a selected channel.
determines where the fade-in will take place. If time is earlier than the start time of the sound, the start time of the sound wil be used.
Fade time (s)
determines the start point and the endpoint of the fade-in with respect to the time argument. Depending on the sign of fadeTime, time is either the start or the end position of the fade-in. If fadeTime is positive, fade-in will take place between time and time+fadeTime. If fadeTime is negative, fade-in wil take place between time+fadeTime and time.
Silent from start
when on, makes the sound silent before the fade-in starts. When off, the sound before the fade-in starts will not be changed.
Multiplication with the first half period of a (1-cos(x))/2 function.
Cross-fading two sounds
The following script cross-fades two sounds s1 and s2 at time 1 second and leaves the result in s2.
crossFTime = 0.5
t = 1
do ("Create Sound from formula...", "s1", "Mono", 0, 2, 44100, "sin(2*pi*500*x)")
do ("Fade out...", 0, t-crossFTime/2, crossFTime, "yes")
do ("Create Sound from formula...", "s2", "Mono", 0, 2, 44100, "sin(2*pi*1000*x)")
do ("Fade in...", 0, t-crossFTime/2, crossFTime, "yes")
do ("Formula...", "self+Sound_s1")
© djmw, April 10, 2013