Area music to keep playing during a specific fight

Hello there!

I am attempting to create a boss fight where the boss theme plays slightly before the boss fight begins, and said song will carry over into the fight itself (as in seamlessly transition not restart). Essentially the boss attempts a potshot on one of the protagonists, and the fight happens from there after the two of them exchange a few lines. I attempted to do this using VX Ace's method but had no such luck. If anybody would like to inform me on how to do this I would be more than happy to try it.

Thank you for your help,
Miinion.
start the music X frames (converted from seconds) before the actual start of the battle, so that the loop is caught when the battle scene is already presented.

it's all about math and timing, there's really no other solution to it. (aside from splitting the track in two, and using an intro and a battle loop separately, but you still have to time it correctly anyways)
I think there is another solution, and a smoother one at that. I can't open my RMXP right now so I'm going based off of VX Ace, but I see a method in BattleManager called "play_battle_bgm". You can probably find its equivalent by searching the project file for "bgm".

At the beginning of this method (after the "def" line), add a line:
if ($game_switches[x] == false)
where x is the ID of a Switch you'd like to set to TRUE in an event whenever you want the music to not restart when entering battle, and at the end of the method (right before the final "end" line), and another line that reads:
end

Then, just be sure to set the switch to TRUE before any battle where you don't want the music to restart, and be sure to set that switch back to FALSE afterwards.

EDIT:
I got my RMXP working and I think I found where the BGM plays. In the call_battle method, there is a line that reads:
$game_system.bgm_play($game_system.battle_bgm)
You will need to add the lines I mentioned earlier, above and below that line. So after your edit, the method should look like this:
Code:
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    if ($game_switches[x] == false)
        $game_system.bgm_play($game_system.battle_bgm)
    end
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
Hrm, this reminds me of a scene (and subsequently the music) from Final Fantasy VIII where the the heroes of Balamb Garden are on a troop transport at sea about to get dropped off at a beach front. The music start off slow and laboring as the boats approach, but then goes into a fast and relentless fervor when the teams drop off to face wave after wave of enemies in a continuous loop.

For those not familiar, look for Final Fantasy VIII's track called 'The Landing', it is Disc 1 - Track 8.

In this, they didn't use two piece of music, but one. They began playing the piece, but had 'loop points' in place. Instead of ending the piece and returning to its beginning, it returns to a pre-defined point past the well-written and orchestrated opening flourish.

This feature is not available in RPGMaker per-say, except by way of scripts that use Window's MCISendstring feature to play the music. The earliest version of a script that handled this was by a Japanese scripter named cogwheel (who also made the famous RTAB system), later adapted by GubiD (of the GTBS system, and then later I had a hand in making a version offering multiple audio channels. But using any of these systems will not let looping music play throuh RPGMaker's native DirectSound drivers, but by those in Windows.

And it's sometimes a real ***** to find the loop points you really desire. And Ogg Vorbis requires extra drivers and loop points are even harder to acquire due to its format. Glad I made an editor...
@Wavelength: I just came here to ask the same question as Miinion, actually, so thank you for already answering it. I just started with RPG Maker yesterday though, and don't know exactly where I should be looking. I went to tools > script editor (here: https://i.gyazo.com/2f14a6a132ddd19fcd826caaddc78571.png), but I don't see anything called BattleManager on the left, and I can't find the method you mentioned with control+f.

Should I be in a different section altogether? I looked around, but nothing else seems like it'd relate to scripting, hahah!
Thanks again for the help. Having the bgm repeat every time a battle starts is a real drag for the area I'm making.

Edit: Should've looked a bit harder. Found it under Scene_Map. Works great. Thanks again, Wavelength! =)
@RHC2019 Glad you got your problem solved, but please don't necro-post in the future.

Original thread: https://forums.rpgmakerweb.com/threads/area-music-to-keep-playing-during-a-specific-fight.110882/