Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Can I seamlessly swap between two tracks?

A topic by aureuss created Mar 31, 2023 Views: 344 Replies: 10
Viewing posts 1 to 3

I have one track that I've edited into two tracks. The first track will play first and will seamlessly go to the next one to continue and loop the rest of the song. SO basically the first is the intro, and the second one is the actual song.

I've found that rpg maker puts a painful pause after the first bgm before swapping to the next. Can I have them just seamlessly cut into eachother using this plugin's pre-loading?

Developer (1 edit)

Just using the pre-loading (which is to say, this plugin's LoadBGM command) will cut out a good chunk of that painful pause. But this plugin has way more to offer than that, of course!

Having the two tracks as separate tracks can make it possible, but it depends on how they're configured. The plugin isn't really designed to jump seamlessly to a second track seamlessly unless their timing is synched correctly - that is, if track B doesn't have any sort of intro portion that corresponds to track A, the crossover won't be smooth. (The tempos don't need to match; that's accounted for. But the number of measures does, at least in the sense that track B has to account for all of track A's measures.)

But if that doesn't work for you, there are also ways to do that by combining them into a single track - check out my example video, specifically the part with the Cymore theme. I initially set the loop points to a short part at the beginning, and then, when you enter the town proper, the loop points change to the proper loop points for the rest of the song. No matter what timing you use when walking over, the music will keep right on playing as it shifts the loop points. That sounds like it best fits your needs?

If that's not a sufficient answer, then I might need more info.

The tracks do loop seamlessly, I was able to confirm that by putting them side-by-side in Audacity and letting it play through. If you want to get a feel for what I mean check out the Miitopia soundtrack for battles. The audio basically plays through the intro part and then continues through the rest of the song, but when it loops, it goes right to the end of the intro portion and plays from there.  
Thank you for the reply by the way!

By the way, I bought the plugin and was able to pretty much get around the issue. But now I'm having trouble crossfading two tracks. I am trying to do something similar to the concept showcased in your video where two tracks of the same melody get crossfaded into eachother. When I try to use my tracks, it starts from the beginning and not from where the last BGM left off.

Developer

I've had that problem when a track plays at something other than 100% pitch. It's a problem with the engine, not my plugin. If that's not what you're trying to do, then I could use more info.

Ah I fixed it. My bad lol, i didn't see the variable parameter to crossfade.

If you don't mind me asking, how did you set the loop points? I can't find much info online about the LOOPLENGTH and LOOPSTART metadata for .ogg files. How do I configure these in Audacity?
I could be searching for the wrong thing but I thought I'd ask just to be sure.

Developer (2 edits) (+2)

When you export the data to OGG, it should bring up a list of metadata. Just add two more to the list: LOOPSTART and LOOPLENGTH. You can also access this through Edit -> Metadata.

Now, getting the exact right start and length points takes a little finagling. When you have the project open in Audacity, down near the bottom, set it to "Start and Length of Selection", and where it shows the timestamps, click the little arrow and pick "Samples". Now drag over the part where you want the loop. Try to get it as close as possible to where the loop should start and end. In the newest version of Audacity, there appears to be a "Loop" button. Turn that on. (In older versions you had to hold down a key when playing to get it to loop - Shift, I think.) If you click the timeline (NOT the audio portion, the timeline above it) just before the end of your selection, it'll start playback from there and should loop back to the beginning of the selection.

When you have it right - you don't hear a jump or pop or anything when it loops - then use the sample numbers in LOOPSTART and LOOPLENGTH.

This plugin also uses sample numbers in the same way when you override LOOPSTART and LOOPLENGTH through the playback parameters.

EDIT: If the selection and loop desynch (happened to me while playing with it just now), right-click the timeline and pick "Set Loop to Selection".

Developer(+1)

Like so.

Oh I see! Thank you so much for the help by the way! I love the plugin.

Developer

Oh, and does track A loop at all? If it doesn't, then you don't even necessarily need my plugin. Just make it a single track with LOOPSTART and LOOPLENGTH set in the metadata.