StopMusic and RestartMusic

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: StopMusic and RestartMusic

by earbenT » Thu May 10, 2007 5:12 pm

Nash wrote:Oooh! I would really really really love the ability to define a separate main menu music!

If that gets added... don't forget that the map music should resume where it left off when you accessed the menu, and not play back from the beginning.
Take a break from an intense fragging session and relax to a loungey acapella rendition of E1M1's music. :lol:

by Nash » Thu May 10, 2007 3:25 pm

there's no way I know of to consistently stop all actors (including projectiles)
The new TimeFreezer powerup can do this, but there is no way to force TimeFreezer to wear off (even if you try to TakeInventory away the powerup from the player) so you're stuck with have to wait for the effect to wear down.

by HotWax » Thu May 10, 2007 8:33 am

jimmy91 wrote:If you wanted a way round this that's already possible in this version of ZDoom, just create an outside sector with a texture that looks like a menu. Place a camera in the sector and bind Esc to launch into the script to go to the custom "menu".
That wouldn't work very well, if at all. First off, there's no way I know of to consistently stop all actors (including projectiles) in the map and have them resume where they left off when the "menu" is closed. Second, you can't rebind the player's ESC key without their assistance (or some invasive batch file), since it will nearly always be bound to the internal menu. Finally, this still wouldn't actually be able to pause the music (or any playing sounds for that matter) because there are no functions to do this yet, so the entire purpose is defeated.

by Kate » Wed May 09, 2007 5:18 pm

JL_Harkster wrote:What if we don't want a crossfade, just a fade in/out?

Code: Select all

Script 1 (void)
{
    SetMusic ("", 0, 2.0); //Fade out.
    [...]
    SetMusic (""); //Kill the music that's already playing.
    SetMusic ("*", 0, 2.0); //Fade in.
}
Simple enough.

by JL_Harkster » Wed May 09, 2007 5:12 pm

What if we don't want a crossfade, just a fade in/out?

by Kate » Wed May 09, 2007 4:53 pm

This was asked for already:

Code: Select all

SetMusic (str song [, int pattern [, int unused]])
The unused argument was named fade, and was originally meant to determine the time it took to crossfade from one music piece to another, but it seems to have been dropped for some reason.

by JL_Harkster » Wed May 09, 2007 4:29 pm

Hey, that's also a good idea. I wonder if it's possible?

FadeMusic(StartVolume, EndVolume, Duration)

And it shouldn't actually change the midi volume in the sound settings, just the output volume.

by Lamneth » Wed May 09, 2007 2:54 pm

I want to see the ability to fade music in and out, and since this thread is about music I'd like to throw in that request as well. Is it possible to do that? It doesn't have to be perfect crossfading, but the ability to fade out/fade in with SetMusic somewhere would be nice.

by Jimmy » Wed May 09, 2007 1:07 pm

Nash wrote:Oooh! I would really really really love the ability to define a separate main menu music!
If you wanted a way round this that's already possible in this version of ZDoom, just create an outside sector with a texture that looks like a menu. Place a camera in the sector and bind Esc to launch into the script to go to the custom "menu".

Of course, you'd have to know a lot of ACS, and I don't know how you would go about halting gameplay ENTIRELY with this method, but it's a suggestion nonetheless.

by Nash » Wed May 09, 2007 11:50 am

Oooh! I would really really really love the ability to define a separate main menu music!

If that gets added... don't forget that the map music should resume where it left off when you accessed the menu, and not play back from the beginning.

by Enjay » Wed May 09, 2007 11:06 am

Risen wrote:Could a MAPINFO option be added to pause the music on pause/menu?
Or could there even be a MAPINFO entry to define pause/menu music like a lot of games have?

by Risen » Wed May 09, 2007 10:53 am

Could a MAPINFO option be added to pause the music on pause/menu?

by Nash » Wed May 09, 2007 5:57 am

That will work, but the main menu doesn't stop the music so it'll desync again.

It'll be slightly better if the MIDI isn't looped (which is uncommon for downloaded MIDIs - you'd have to do it yourself in a MIDI editor). The music will just stop earlier before the next music change.

For cutscenes that have to sync with music, I came up with a solution by making the song an MP3 or OGG, then play it as a sound by using the ACS function AmbientSound().

Sounds can be paused and will continue playing where it stopped when unpaused, and it works for the main menu too.

by JL_Harkster » Wed May 09, 2007 5:40 am

Psycho Siggi wrote:I was wondering, does ZDoom know when the music currently playing has started a new loop?

I was thinking it would be nice for the music for a specific stage to have an intro, then a loop. The idea being, you'd set a specific track for the music in the level when the level begins, and when the 1st track ends changed to another 2nd track which loops.

I have no idea how possible this is, either currently, or as a feature suggestion. It's just something I think of asking every now and then.
With a midi, if you knew the length of the music, you can write a script that does this yourself. Just have the script wait for a specified period of time until the length of the midi passes, then change the music to the new piece.

by Nash » Wed May 09, 2007 4:06 am

Tracked music (.mod, .it, .xm, .s3m etc) has commands that tell the song to loop at a specific pattern so it is kind of possible.

You'd be limited to tracked music and still at the mercy of the main menu and pausing.

Top