[Solution] Creating a seamless music loop

Questions, skill improvement, and respectful critique involving music, sound, and movies.
Post Reply
User avatar
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY

[Solution] Creating a seamless music loop

#1 Post by Jae » Fri Oct 02, 2015 10:30 pm

I'm a complete newb when it comes to programming and was having trouble with seamless music looping yesterday. I knew how to do it in practice, but the results weren't what I wanted. I continuously faced jarring pops or breaks when the music starts transitioning.

It looks like it's an issue that pops up time and again, so I just wanted to share what I did and hopefully it helps others who have the same issue (especially newcomers doing this for the first time).

Basically just:

Code: Select all

play "filename1.ogg"
queue "filename2.ogg"
I knew coming in that playing and queuing songs will automatically make them loop when they're last on the list, but what I didn't know was that I had to create new assets in order to get that seamless transition.

Basically a track in the most simplest of forms is broken up into:

1. Intro
2. Melody
3. Outro

In many cases, at some point the song will repeat a melody (usually after a bridge), which is the perfect opportunity to loop it back to the beginning. So I ended up separating the intro and the melody sections into their own individual tracks.

Then it became something like:

Code: Select all

play "Intro.ogg"
queue "Melody.ogg"
So the intro track plays only once and the melody track will continue to loop.

Tracks created had to be in .ogg format because .mp3 files end up with weird gaps at the beginning and end of the track, which I'd like to believe is what causes the jarring pops and breaks during transitions.

Hope this helps. I know this is probably old news, but I haven't seen anyone really detail the steps to getting the actual result. If there are more efficient/effective ways, I'd like to know that, too.

User avatar
Posts: 33
Joined: Tue Jul 07, 2015 12:20 pm

Re: [Solution] Creating a seamless music loop

#2 Post by final513 » Sun Oct 04, 2015 12:17 pm

Thanks a lot for making this! Makes more sense now. Hope all goes well with your game.
Current Project: Alter Ego

Posts: 53
Joined: Tue Nov 03, 2015 1:49 am
Completed: Lifted Dreams
Projects: ----
Skype: Josou

Re: [Solution] Creating a seamless music loop

#3 Post by Yolo400 » Tue Nov 03, 2015 10:13 pm

I don't know why the MP3 codec renders with a gap, though it is a problem I ran into in FL studio back when I started composing loopable music for games (I thought it was just an irritating issue with *MY* codecs).

Essentially everything just ended up being rendered in .WAV instead, which naturally lead to the file size being huge.

When you asked if there was an easier way to get music looping comfortably, not as far as I know.

spot the waveform, identify the pattern, make seamless, make intro file. As long as any other part of the development process and with as much attention to detail.

though I'm not too sure about keeping the tail on the intro file.
Working on project "Lightning Cat" - Writing
music for sale
|| Thank you ||

Post Reply

Who is online

Users browsing this forum: No registered users