Looping BGM with an intro in RPG Maker MV/MZ (and VX Ace), no plugin: the LOOPSTART/LOOPLENGTH tags

A lot of RPG Maker games loop their BGM from the very top, so a song with an intro replays the intro every time, or the reverb at the end turns into a little gap before it starts over. You don’t need a plugin or two separate files to fix that. The engine already supports loop points.

RPG Maker MV and MZ (and VX Ace) read two tags stored inside an OGG file: LOOPSTART and LOOPLENGTH. The BGM plays from the beginning, and when it reaches LOOPSTART + LOOPLENGTH it jumps back to LOOPSTART. Everything before LOOPSTART plays once, so that’s your intro. If the tags aren’t there, it just loops the whole file.

A few things that trip people up:

  • Both numbers are in samples, not seconds. At 48 kHz, a loop that starts 6.5 seconds in is LOOPSTART=312000, and a 128-second loop is LOOPLENGTH=6144000. If they’re off by even a little, you can get a click every time it loops.
  • It has to be OGG Vorbis. Not Opus, WAV or MP3. VX Ace will play a WAV, but it ignores the WAV’s loop points and loops the whole thing, intro and all.
  • Converters and normalizers can quietly drop the tags. Make the tagged OGG the last step before it goes into audio/bgm.
  • The jump back is instant. If your track has reverb or a note ringing past the loop end, that ring-out gets cut off at the jump. The fix happens in the file. Take the tail that rings past the loop end and mix it into the start of the loop, so when RPG Maker jumps back, the tail is already there.

You can add the tags with any editor that edits OGG metadata (Vorbis comments). You just have to work out the sample numbers yourself.

I’m a game composer and I ended up building a Windows tool for this part, called Loopsmith. You set the loop points on the waveform, listen to it come back around, and the RPG Maker export gives you an OGG with LOOPSTART and LOOPLENGTH already written and the reverb tail mixed into the loop start. Drop it in audio/bgm and pick it as the BGM. There’s a free demo (the full app for three of your own tracks) if you want to try it: Loopsmith: Game-ready seamless loops by austinhaynes

I wrote this up in more detail here too: RPG Maker Loops Music Seamlessly Without a Plugin. Almost Nobody Uses It. – Austin Haynes Music

If your BGM loop clicks or has a gap, post the numbers you’re using and I’ll take a look, whether you use the tool or not.