Jump to content
Sign in to follow this  
Flechita

BGM Fadeout

Recommended Posts

The event command to fade out the bgm doesn't fades the music nicely, it fades until very low volume and then cut offs abruptly. If you are using headphones then this effect is very noticeable.

I've tried with a fresh new project and default rtp music set at 100 volume and 100 pitch and this still happens.

 

I'd like to have a script to fade out the music in a nice and soft way, without hard cutoffs.

 

Thanks

  • Like 1

Share this post


Link to post
Share on other sites

Try this script 

class Scene_Base
  
  
  def custom_fadeout
    @fading_out = true
    @fadeout_timer = 0
  end
  
  
  alias fadeout_update update
  def update
    fadeout_update
    if @fading_out
      @fadeout_timer+=1
      bgm = RPG::BGM.last
      bgm.volume -=1 if bgm.volume > 0 && @fadeout_timer%2 == 0
      bgm.play
      if bgm.volume == 0
        @fading_out = false 
        RPG::BGM.stop
      end
        
    end
  end
  
  
end
  

bgm.volume -=1 if bgm.volume > 0 && @fadeout_timer%2 == 0

 

This line means the volume will decrease by one every 2 frames

 

if you increase the number next to fadeout_timer,it will fade out more slowly

if you increase the number next bgm.volume it will fade out more quickly 

 

Edit you active it with the following script command

SceneManager.scene.custom_fadeout

Edited by Shiggy
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the help but you can still hear the audio cut off at the end.

 

Even this way you can hear the audio cut off:

class Scene_Base
  
  def custom_fadeout
    @fading_out = true
  end
  
  alias fadeout_update update
  def update
    fadeout_update
    if @fading_out
          bgm = RPG::BGM.last
          bgm.volume -=1
          bgm.play
    end
  end
  
end

The problem seems to be that the output level difference between volume 1 and volume 0 is way too big. If you are using headphones you will notice the cut off and it doesn't sound nice at all.

Share this post


Link to post
Share on other sites

You can't do more with the audio library the game uses,so either you find  script that add another library and more options. Either you edit your audio tracks to lower their general volume, thus the difference between 0 and 1 will be lower

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted