Hi folks,

a practical solution i tried when using player-objects
for kind of bg-music is the following:
A bit less complicated than putting sounds into bgs ;-)

Make a palette-window! far off-screen. -5000,-5000 will do.
Put one (or more) players onto the first (and only cd)
and write this, or a similar stackscript (for 1 player):

on starten
 start player 1
end starten

on stoppen
stop player 1
end stoppen

on rewind
 set the currenttime of player 1 to 0
end rewind

on othersong thesong
 set the filename of player 1 to thesong
starten
end othersong

etc...

You then can call these commands with

send "starten" to stack "the_bg-muziek_stakk" etc...

whenever and from wherever you need to.

I think, you get the picture...


In case someone is interested in how to fadein and out
sounds played with the "play audioclip xxx" command,
where the playloudness is working on WIN and Mac,
here's a little script:

(This does NOT work with player-objects!)
--Put this into the stackscript

on fadeout diezeit            --fadeout time in millisecs
  if the sound is "done" then exit mouseup
--no sound, no need to fade out
  put the playloudness into altvol
--store the old volume setting
 put round(diezeit/altvol) into warten
  repeat with pl = altvol down to 0
    wait warten millisecs
    set the playloudness to pl
  end repeat
  play stop ac
--stop the sound before the next line is executed
  set the playloudness to altvol
--restore the volume setting
end fadeout

--Call this handler whenever you want with:
-- on xxx
--   fadeout 1500  --for 1.5 secs
-- end xx

on fadein derklang, diezeit      --the sound, the time in milliesecs
  if the sound is not "done" then
      fadeout 500       --it's more elegant...
  end if
  put the playloudness into altvol
  set the playloudness to 0
  play ac derklang  --start the sound, so it can be faded in :-)
  put round(diezeit/altvol) into warten
  repeat with pl = 1 to altvol
    wait warten millisecs
    set the playloudness to pl
end fadein

--Call this handler whenever you want with:
-- on xxx
--   fadein "soundzzz/thesound.wav", 2000
-- end xxx

If you find these scripts useful, please give little feedback
to me privately.


Regards from germany

Klaus Major


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to