Ok i spent a lot of time scripting music:
The playasong command does as following:
calls the music function and plays a rnd song from fantastic/music.
The musicvol 1 mute but not off, musicvol 0 is stopped. to get the music to fade out do the following.
fademusic = [
times = 20
d = 0
loop i $times [
sleep (* $i $arg1 ) [
if (= $arg2 "out" ) [ volum = (- 100 (* 5 $d ) )]
if (= $arg2 "in" ) [ volum = (+ 1 (* 5 $d ) )]
musicvol $volum
d = (+ $d 1 )
]
]
sleep (+ $arg1 (* $times $arg1 ) ) [
if (= $arg2 "in" ) [ musicvol 101 ]
if (= $arg2 "out" ) [ musicvol 1 ]
]
]
simply do:
fademusic speed(in millisecond * 21 ) in/out
fademusic 100 "in"
fademusic 100 "out"
hope this helps
chasester