StopMusic and RestartMusic

Moderator: GZDoom Developers

Lamneth
Posts: 187
Joined: Thu Apr 26, 2007 12:00 am
Location: Dark Falz's chamber

Post by Lamneth »

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.
JL_Harkster
Posts: 94
Joined: Wed Sep 13, 2006 2:03 pm
Location: In front of a Baron, holding a Plasma Rifle

Post by JL_Harkster »

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.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

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.
JL_Harkster
Posts: 94
Joined: Wed Sep 13, 2006 2:03 pm
Location: In front of a Baron, holding a Plasma Rifle

Post by JL_Harkster »

What if we don't want a crossfade, just a fade in/out?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

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.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

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.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

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.
earbenT
Posts: 16
Joined: Mon Jan 29, 2007 12:43 pm

Post by earbenT »

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:
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”