A command to gradually increase the amplitude of a selected Sound.
Settings
-
Channel
-
determines whether you want to fade all channels or only the left of the right channel.
-
Time (s)
-
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.
Algorithm
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
Create Sound from formula... s1 Mono 0 2 44100 sin(2*pi*500*x)
Fade out... All t-crossFTime/2 crossFTime y
Create Sound from formula... s2 Mono 0 2 44100 sin(2*pi*1000*x)
Fade in... All t-crossFTime/2 crossFTime y
Formula... self+Sound_s1[]
© djmw, March 14, 2008