[RMVX ACE] MUSIC CROSS-FADING (OVERLAPPING BETWEEN MAPS).

Posts

Pages: 1
Hi! I'd like to ask if anyone knows how to make the BGM from one map cross-fade into another during a transfer event. It's because I'm making seam-less maps a la Pokemon style. I got the mapping down, but the music changes between maps is too abrupt and jarring.

If that wasn't very clear, here:
<map 1 BGM playing> -- /*Player transfers to map 2*/ -- <map 1 BGM fadeout> <map 2 BGM fadein> -- <map 2 BGM playing>

Thank you :3
About 3 days with no replies, so I'll bump this (is that a thing here?).
If anything I asked is unclear, please do tell me so I can explain it further...

Thanks.
You can do it the pokerman way: When you change maps just call the fadeout BGM for X seconds, wait X * 60 frames + a bit, then start playing your current one. If you want this effect across the entire game I can look into whipping up a quick script for this.

If you want a proper cross fade then there may be some trickery you can do with the audio players to play the current BGM fading out and another at the same time but I can't find it. I even tried seeing if you could fadeout the BGM, fade in a BGS, then once the BGM has faded out tell the BGM player to play what the BGS player was at the same position but it isn't seamless. At the switch the music cuts for a moment then the BGM/BGS quickly fades in.
LouisCyphre
can't make a bad game if you don't finish any games
4523
author=GreatRedSpirit
At the switch the music cuts for a moment then the BGM/BGS quickly fades in.


Why not just... alternate BGM and BGS the entire game, like with a switch or something? This isn't the most elegant solution, but it solves your clipping issue!
author=GreatRedSpirit
You can do it the pokerman way: When you change maps just call the fadeout BGM for X seconds, wait X * 60 frames + a bit, then start playing your current one. If you want this effect across the entire game I can look into whipping up a quick script for this.

The problem with this is that there will be a short delay where the player will be stuck waiting during every map and BGM change...

I've also already tried binding the BGM's to a common event, using a variable to track map ID and cond. branches to decide the BGM, but it didn't work very well.
author=LouisCyphre
author=GreatRedSpirit
At the switch the music cuts for a moment then the BGM/BGS quickly fades in.
Why not just... alternate BGM and BGS the entire game, like with a switch or something? This isn't the most elegant solution, but it solves your clipping issue!


afaik playing an ME won't pause the BGS, only the BGM. There's a few issues besides the clipping with trying to hijack the BGS player, there's the game mute options (BGM+ME and/or BGS+SE) that turning one off will fuck up the music entirely. There's also potential script issues, I know there'll be a problem with Yanfly's system settings where you can set the volume of each player that'll have to be addressed. I don't think using the BGS player as a second BGM player is a viable solution with Ace even if what I tried didn't have clipping issues (muting one set of players would reveal the whole charade).


author=karins_soulkeeper
author=GreatRedSpirit
You can do it the pokerman way: When you change maps just call the fadeout BGM for X seconds, wait X * 60 frames + a bit, then start playing your current one. If you want this effect across the entire game I can look into whipping up a quick script for this.
The problem with this is that there will be a short delay where the player will be stuck waiting during every map and BGM change...

I've also already tried binding the BGM's to a common event, using a variable to track map ID and cond. branches to decide the BGM, but it didn't work very well.


As long as the event handling the BGM change is a parallel process the pause shouldn't be an issue. How are you handling the BGM change exactly?
Parallel process, GRS. I made it so that it will be called by the transfer events prior to transferring the player. The problem there was that the BGM of the new map will still leak through, in a portion of a second before the fade-out and fade-in processes could be performed...
Alright, threw together a quick script proof of concept to emulate pokemon style fadeouts at least. Download here. If the BGM or BGS change between maps it'll fade out the old one then play the new one (no fadein for that because ace doesn't support that by default because ace is dumb). If you want to change the fadeout or delay durations you can change the values like these:

def self.bgm_fadeout_duration
  return 3000
end

You can change it to use a variable too by changing it to something like:
def self.bgm_fadeout_duration
  return $game_variables[1]
end

Which will use the value in variable 1 as the # of milliseconds to fade out for.
Thanks GRS!
I'll try it out in a jiff :D

Edit: And it works like a charm! The fadein doesn't really seem necessary at all. I just made the play delay lower than the fadeout duration. It isn't really noticeable that the new BGM did not fade in.

Thanks again! :3
Pages: 1