Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Dynamic Soundtrack Cog (?)
Dynamic Soundtrack Cog (?)
2004-12-20, 10:30 AM #1
I just want to know if this is even possible before I start trying to figure this out.... here's my plan:

I want to make a cog that will play a music sample on loop... like the one Daft is trying to figure out... But this one will change to a new loop when an specified adjoin is crossed... the CATCH is that it would have to wait for the old sample to stop before the new sample is played, so that the transition is seamless. It would need to support 6-8 samples and about 32 adjoins. In order for it to work propery, it would have to also play a specific sample upon spawn/respawn, or else you wouldn't hear anything until the adjoins are crossed.

What do you think?
We are the music makers... and we are the dreamers of dreams...
Neurotic||Mobius Grith||The Atrium
2004-12-20, 1:04 PM #2
Hm... This calls for one of Edward's Spur-of-the-Moment COGs!

Code:
# Different music per room.
# 4 adjoins per song, if that is OK by you?
# 4 different ways to get in?
#
# By Edward
flags=0x240
symbols

message    newplayer
message    crossed

surface       inroom0    linkid=0
surface       inroom1    linkid=0
surface       inroom2    linkid=0
surface       inroom3    linkid=0
surface       inroom4    linkid=1
surface       inroom5    linkid=1
surface       inroom6    linkid=1
surface       inroom7    linkid=1
surface       inroom8    linkid=2
surface       inroom9    linkid=2
surface       inroom10  linkid=2
surface       inroom11  linkid=2
surface       inroom12  linkid=3
surface       inroom13  linkid=3
surface       inroom14  linkid=3
surface       inroom15  linkid=3
surface       inroom16  linkid=4
surface       inroom17  linkid=4
surface       inroom18  linkid=4
surface       inroom19  linkid=4
surface       inroom20  linkid=5
surface       inroom21  linkid=5
surface       inroom22  linkid=5
surface       inroom23  linkid=5
surface       inroom24  linkid=6
surface       inroom25  linkid=6
surface       inroom26  linkid=6
surface       inroom27  linkid=6
surface       inroom28  linkid=7
surface       inroom29  linkid=7
surface       inroom30  linkid=7
surface       inroom31  linkid=7

sound         sample0
sound         sample1
sound         sample2
sound         sample3
sound         sample4
sound         sample5
sound         sample6
sound         sample7

int               ch=1       local

end
#
code
newplayer:
        StopSound(ch1,1);
        ch=PlaySoundLocal(sample0,0,0,0x1);
        ChangeSoundVol(ch,1,1);
return;
crossed:
        StopSound(ch,1);
        ch=PlaySoundLocal(sample0[GetSenderID],0,0,0x1);
        ChangeSoundVol(ch,1,1);
return;
end


Hope that is satisfying. If you are not happy about the way the song fades in and out, just add a timer message and place the PlaySound in there. Don't forget to add a SetTimer(1); after the StopSound.

/Edward
Edward's Cognative Hazards
2004-12-20, 1:50 PM #3
Oh wow, thanks... I'll test this out later tonight (I'm at work now)... so it looks to me that this will either fade in/out upon crossing adjoins OR play the new loop after the timer is up (depending on how long the previous sample was?) I'll figure it out....

This won't work for me unless the transition between the samples is seamless... but fading in/out is a nice touch for areas which I don't want music playing. Thanks again. I'll let you know how it goes...
We are the music makers... and we are the dreamers of dreams...
Neurotic||Mobius Grith||The Atrium

↑ Up to the top!