Change BGM Tempo?

So the default system only seems to support Volume and Pitch. (correct me if i'm wrong) but I would like to have the ability to change the Tempo of my BGMs. The Tempo is speeding up / slowing down without changing the pitch. For those who have Audacity, it's under "Effects > Change Tempo" in your menu bar. (Feel free to do it with any of your music)

I need this kind of thing for my project, because it's better than just changing the pitch as a method of speed up. (which I was doing originally)

This is with Ogg format by the way, cause a MIDI method would probably be different.

Hopefully we can all look into this.
I don't believe there's any way to do this, as tempo is not one of the attributes of the audio class that's accessible.


Best thing you can do, I think, is to actually change it in Audacity and save it out as a new ogg file.
I don't believe there's any way to do this, as tempo is not one of the attributes of the audio class that's accessible.
Is there a way to import new audio ruby libraries or something? And then create new engine-based commands to access them?

Best thing you can do, I think, is to actually change it in Audacity and save it out as a new ogg file.
If I try to attempt this, which I thought of earlier, i'd have to find out how to tweak0 my current "Change BGM when party is dying" script to fit it. Like "Case-When current battle BGM is _____, set new song to ______. And then do that for each Battle BGM I will have.

Spoiler
Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#             Party Dying Battle BGM#             Version: 1.0#             Author: DiamondandPlatinum3#             Date: September 5, 2012#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#  Description:##    This script allows you to play an in-danger BGM when your party HP or#    singular actor hp is below a certain point.#    Similar to Pokemon Black and White when your lead pokemon is in danger#    of fainting.#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#------------------------------------------------------------------------------#  Instructions:#  #     -  All you have to do is go into the editable region and change the#        appropriate settings to suit your needs.##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=module DP3_PartyDyingBGM#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#                                                        -=#                 Editable Region        ////            ==#                                                        =-#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=    # BGM, Volume, Pitch  # if you want the Battle BGM to play at a different volume or pitch  # Set the DyingBGM Filename value to nil  # nil means use current battle BGM                  #   Filename,           Volume   Pitch ]  DyingBGM        = [ nil,    100,     125  ]   # Should the check be for the total party hp or for single actors  # true = Entire Party, false = singular actor  EntirePartyHP   = false     # This is the Percentage of Total Health (or below) that your party or actor  # must have left in order for the Dying BGM to play, this is a perentage out of  # 100.  # Play around with it to achieve your desired amount  HP_Percentage   = 25       # Do you want to see a messagebox teling you when your breaking point  # will be?  # This is for debug purposes, set it to false after finished.  PrintBreakingPoint = false   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=end # of Editable Region#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#---------------------------------------------------------# No touchie past here unless you know what you are# doing. Failure to heed this warning could cause your# computer to yell and scream at you.## Edit at your own risk.#--------------------------------------------------------          class Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # * Start Processing  #--------------------------------------------------------------------------  alias playpartydyingbgm_start start  def start    playpartydyingbgm_start    @partytotalhp       = checkpartytotalhp    @partycurrenthp     = @partytotalhp    @current_battle_bgm = RPG::BGM.last    @current_death_bgm  = RPG::BGM.new(*DP3_PartyDyingBGM::DyingBGM)    @playing_death_bgm  = false  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  alias playpartydyingbgm_update update  def update    #////////////////////////////////////////////    if checkifindanger      playdyingbgm    else      partydyingbgm_replaybattletheme    end     #////////////////////////////////////////////    playpartydyingbgm_update  end  #--------------------------------------------------------------------------  # * Check if in danger  #--------------------------------------------------------------------------  def checkifindanger    return checkpartyremaininghp if DP3_PartyDyingBGM::EntirePartyHP    return checkactorremaininghp  end  #--------------------------------------------------------------------------  # * Check Party Total HP  #--------------------------------------------------------------------------  def checkpartytotalhp    partytotalhp = 0    $game_party.battle_members.each do |actor|      partytotalhp += actor.mhp      msgbox_p(actor.name, "Breaking Point is: ", ((actor.mhp * (DP3_PartyDyingBGM::HP_Percentage.to_f * 0.01)).to_i)) if DP3_PartyDyingBGM::PrintBreakingPoint    end    msgbox_p("Entire Party Breaking Point is: ", ((partytotalhp * (DP3_PartyDyingBGM::HP_Percentage.to_f * 0.01)).to_i)) if DP3_PartyDyingBGM::PrintBreakingPoint    return partytotalhp  end  #--------------------------------------------------------------------------  # * Check Party Remaining HP  #--------------------------------------------------------------------------  def checkpartyremaininghp    @partycurrenthp = @partytotalhp    $game_party.battle_members.each do |actor|      @partycurrenthp -= (actor.mhp - actor.hp)    end    return (@partycurrenthp < (@partytotalhp * (DP3_PartyDyingBGM::HP_Percentage.to_f * 0.01)).to_i)  end  #--------------------------------------------------------------------------  # * Check Actor Remaining HP  #--------------------------------------------------------------------------  def checkactorremaininghp    $game_party.battle_members.each do |actor|      return true if ((actor.hp < (actor.mhp * (DP3_PartyDyingBGM::HP_Percentage.to_f * 0.01)).to_i) && actor.hp != 0) #&& actor.hp != 0)    end    return false  end  #--------------------------------------------------------------------------  # * Play "Dying BGM"  #--------------------------------------------------------------------------  def playdyingbgm    if !@playing_death_bgm      @current_battle_bgm = RPG::BGM.last      @playing_death_bgm = true           if DP3_PartyDyingBGM::DyingBGM[0]        @current_death_bgm.play(@current_battle_bgm.pos) #current_death_bgm             else        RPG::BGM.new(@current_battle_bgm.name,                     DP3_PartyDyingBGM::DyingBGM[1],                     DP3_PartyDyingBGM::DyingBGM[2]).play(@current_battle_bgm.pos)      end    end  end  #--------------------------------------------------------------------------  # * Replay Battle BGM  #--------------------------------------------------------------------------  def partydyingbgm_replaybattletheme    if @playing_death_bgm      @playing_death_bgm = false      @current_death_bgm = RPG::BGM.last      @current_battle_bgm.play(@current_death_bgm.pos) #current_battle_bgm    end  endend
Won't you have to do that anyway?
Won't you have to do that anyway?
I made an edit to include the script i'm using for BGM change.  The script can use the same current battle BGM but of course only has a default system volume and pitch options.  I was hoping I could use a Tempo-Changer thingy so that I wouldn't have to make Tempo-versions of my songs and not increasing project file size by a lot for having almost-duplicate songs.
So you're playing a regular BGM during battle, then at the end of battle you want to speed it up or slow it down?


Yeah, with a second file, you not only have to tell it to play a different file, but it won't be at the same point in the file (and BGM save/replay won't help), so it will be pretty jarring.


I don't know of any other way though - I've never looked at the non-RGSS Ruby scripts.
The script already handles save/replay-BGM when it goes to change it, and that goes for any specified BGM file (or the same current BGM) And by the way it happens when an actor's HP is below 25%

------------------------------------------------------------------------------------------------

The only thing I need is either a tempo changer (which would probably include an external ruby audio library that supports it), or a case-condition checking the current battle BGM and assigning the proper tempo-version of the BGM (meaning duplicates of each BGM for more file size)

I honestly think I should just go for the latter, since the first is extremely complicated and sounds like something that would involve payment lol.

Original thread: https://forums.rpgmakerweb.com/threads/change-bgm-tempo.18052/