GameMaker has native audio loop points now. Don't poll track position in Step.

One easy mistake is treating music looping like a game-timing problem: watch audio_sound_get_track_position() in Step and seek back when it reaches the boundary. GameMaker's own manual warns that this cannot be accurate. The audio thread advances at 44,100 or 48,000 samples per second while the game normally updates around 60 times per second, so many samples can pass between the check and the seek.

GameMaker now has proper audio-thread loop controls:

audio_sound_loop_start(snd_music, 10.0);
audio_sound_loop_end(snd_music, 42.0);
var music_voice = audio_play_sound(snd_music, 100, true);

The start and end values are seconds. You can set them on the sound asset before playing, or on the returned sound instance while it is playing. When the playhead reaches the loop end, GameMaker performs the jump on the audio thread instead of waiting for Step.

This also gives you a clean intro / loop / outro layout in one file. Put the intro before the loop start, the repeating body between the two points, and the outro after the loop end. Start it with looping enabled. When the game is ready to leave the music state, call:

audio_sound_loop(music_voice, false);

The current pass finishes, crosses the loop end without jumping, and continues into the outro. No polling and no frame-timed seek. GameMaker supports one loop section per sound, but you can change the section by setting new start and end values.

There is still a second problem that loop points do not solve: the reverb tail. If the last chord is still ringing after the loop end, a one-voice jump discards that old pass while the fresh start begins. The timing can be sample-accurate and the seam can still sound like a hole.

The three practical options are:

  1. Compose or render a genuinely dry boundary.
  2. Render past the end, mix that tail underneath the beginning, then export only the repeating body. This makes a self-contained one-voice loop, although its first pass contains a tail from a pass that never happened.
  3. Use two voices so the previous pass can ring out while the next pass starts. This is the most natural result, but it requires runtime scheduling and voice management.

This came out of implementing GameMaker delivery notes in Loopsmith, a looping tool I built. It reports the exact loop positions and can prepare folded-tail or two-voice deliveries. Mentioning that for disclosure; none of the technique above requires my tool. The relevant GameMaker manual section is Audio > Audio Loop Points.

Hopefully this saves someone from debugging a frame-timed loop that can never be sample-accurate. Happy to answer questions or test edge cases.

reddit.com
u/composingkeys — 7 days ago

Music loops are really two separate problems, and most threads only talk about the first one

Problem 1 is whether the engine even reads your loop points. WAV keeps them in the smpl chunk, OGG uses LOOPSTART/LOOPLENGTH vorbis comments, and support is all over the place. Godot reads smpl natively. Unity actually reads it too, which surprised me (undocumented, and the default vorbis import wrecks it, which is why everyone says it doesn't work). Unreal ignores smpl but reads cue markers sample-accurately. RPG Maker reads the OGG tags. FMOD and Wwise don't care about the file, you loop inside the project.

Problem 2 is the one that gets you after the markers are perfect: the tail. The last bar is still ringing when the playhead jumps back. That decay gets chopped, and the dry attack of the loop start lands right where the ring-out should have been. Sounds like a gap even though the samples are contiguous. Loop points can't fix it because it's not a loop point problem, it's just what happens when one playhead wraps.

Two ways I know to deal with it. Run two voices, where the old pass rings past the loop end while the new pass starts. Wwise does this out of the box with post-exit audio on a music segment. FMOD can do it with a transition timeline and the tail as an async instrument, which FMOD's own QA has called not very discoverable. In plain Unity/Godot/web you schedule it yourself against the DSP clock. Or you bake the tail into the head of the file, so a plain one-voice loop carries its own ring-out. That works anywhere including RPG Maker and GameMaker, with the tradeoff that the very first pass plays a tail from a pass that never happened. Dense mixes hide it, sparse intros don't.

Happy to answer questions about any of these setups.

reddit.com
u/composingkeys — 7 days ago

RPG Maker loops music natively. No plugin, just two tags in the OGG file.

Search "RPG Maker music loop" and you mostly find plugin recommendations, script calls, or people cutting a track into two files. But MV and MZ read LOOPSTART and LOOPLENGTH straight out of the OGG's Vorbis comments: the intro plays once, the body repeats forever, and the jump is sample-exact.

The catch is that the values are in samples, they have to be exactly right, and any tool that re-encodes the file can silently strip them, which is why the feature feels like it doesn't exist.

I wrote up how it works, including the one thing the native loop cannot do (carry a reverb tail across the jump) and the render trick that fixes it: https://www.austinhaynesmusic.com/rpg-maker-music-loops

Full disclosure: I'm a game composer (Cognition, The Silver Lining) and I built a tool that does this, because doing it by hand meant re-exporting the same track four or five times to land the samples exactly. The manual method is in the article too and works fine with any metadata editor, it's just slow once you have more than a couple of tracks.

u/composingkeys — 7 days ago

Unreal ignores embedded loop points in audio files. Here's the MetaSound setup I use for seamless music loops.

Posting this in case it saves someone the time it cost me.

Unreal does not read embedded loop points. If you have written smpl chunk loop markers into a WAV, which is what Godot and most samplers read, UE ignores them completely. The Looping flag on a Sound Wave just wraps the whole file.

What it does read is cue markers, sample accurately. That turns out to be the way in.

The setup that works for music with a reverb tail:

Two Wave Players on the same asset, not one. Voice A plays the pass, and at the loop point voice B starts the next one while A keeps playing so its tail rings out underneath. That overlap is what stops the seam sounding like a cut. A single looping player will always chop the tail off.

Drive the handoff from the audio's own sample clock, a looping Wave Player's On Looped, rather than a timer, so it cannot drift over a long session.

For stingers, quantize against cue markers baked into the file. The grid comes from the audio itself, so it can never drift away from the music.

Intro: give it its own player and fire the loop clock from its On Finished.

Musical ending: a Trigger Control gate that closes on an End trigger, so the current pass finishes and resolves at the loop point instead of cutting off wherever the player happens to be.

Cheaper than I expected to run: about 0.63% of a CPU core steady state in 5.8 with four stems plus intro, ending and a stinger, roughly eighteen wave players. The loop wraps themselves measured as free. The one cost is the first play, which peaked higher while the assets decompressed, so Prime On Load is worth setting if your music starts mid gameplay.

I build a tool that generates this whole setup (Loopsmith), but everything above is reproducible by hand and worth knowing either way. Happy to go into any part of it.

reddit.com
u/composingkeys — 27 days ago
▲ 119 r/GameDevelopment+3 crossposts

Every engine handles music loop points differently. Here's what I found across eight of them.

I've been implementing seamless music loops across a lot of engines and the inconsistency surprised me, so here's a summary in case it saves someone time.

The loop metadata situation:

Godot reads the WAV smpl chunk natively.

RPG Maker reads LOOPSTART/LOOPLENGTH tags in OGG.

Unreal reads neither. It ignores embedded loop points entirely, though it does honor cue markers.

Unity reads the smpl chunk too, but undocumented and fragile (the default Vorbis import shifts or loses the points, it needs WAV on PCM or Decompress On Load), so in practice you schedule the loop yourself. (Edited: I originally wrote that Unity ignores them, a commenter on my r/Unity3D post corrected me.)

FMOD and Wwise handle it at runtime inside their own projects.

So a file that loops correctly in one engine can silently fail in the next, because the marker you wrote is simply not read.

The harder problem is the reverb tail. If your track has any decay, looping back to the start cuts that tail off and you hear the seam, even when the loop points are sample perfect. The fix everyone converges on is playing two voices: the previous pass keeps ringing while the next one starts underneath it. Wwise does this natively with post-exit playback, FMOD with a transition timeline, and in Unreal you build it from two Wave Players handing off at the loop point.

For one-voice engines that just play a file and loop it, the alternative is folding the tail back into the head of the file, so the wrap is seamless with no runtime work at all.

One thing worth knowing about Unreal specifically, since it caught me out: it will not read smpl chunk loop points no matter how you author them, but it does read cue markers sample accurately. That makes cue markers the practical way to carry a musical grid into a MetaSound.

This came out of building a tool that writes these setups per engine, if it is useful to anyone: https://austinhaynes.itch.io/loopsmith

Happy to go into the per-engine details, the tail overlap especially.

u/composingkeys — 25 days ago

Game music almost always clicks when it loops. I spent months building a tool that fixes the seam.

If you've ever put music in your own game, you've probably hit this: a track that sounds perfect start to finish clicks or gaps the second it loops, especially anything with reverb or a pad tail. Fixing it by hand means zoom-matching waveforms in a DAW and grafting the reverb tail back in, and then doing it again for every track.

https://reddit.com/link/1umqt7l/video/9r4ol80o33bh1/player

I write music for games, so I built Loopsmith to handle the tedious part. You set the loop point (by ear, or snap it to the bar from the tempo), hear the exact seam before you commit, and export a clean loop with the reverb tail intact. It also writes the drop-in code for Unity, Godot, and the web, so you paste one line instead of wiring up the looping yourself. It does the adaptive stuff too: layered stems, switching tracks on a cue, and stingers that land on the beat.

Free demo (Windows): austinhaynes.itch.io/loopsmith

Built with AI-assisted code; the music in the demo is my own.

reddit.com
u/composingkeys — 2 months ago

I built a tool that gives RPG Maker seamless music loops with the reverb tail intact

I write music for games. RPG Maker is one of the few engines where looped BGM just works: drop an OGG with LOOPSTART and LOOPLENGTH tags into audio/bgm and it loops. But making the loop itself is still the hard part. You have to find the right loop point, and the reverb tail gets cut dead when the song jumps back to the start.

I built a Windows tool called Loopsmith for exactly this. Load your track, set the loop by ear, BPM with snap to beat/bar, or auto-detect it, audition the exact seam before you commit, and export. The OGG comes out with the LOOPSTART and LOOPLENGTH tags already written. For music with a reverb or ambience tail there is a folded tail option that bakes the ring-out into the start of the loop, so the seam keeps its reverb even though RPG Maker plays a single file.

45 second before and after, sound on: https://www.youtube.com/watch?v=rplLvTdqXaA

Free demo (Windows): https://austinhaynes.itch.io/loopsmith and the full version is a one time purchase.

About the flair: the tool's code was written with AI assistance. The music in the video is my own composition, not AI. Happy to answer questions about the looping side of RPG Maker audio.

u/composingkeys — 2 months ago