Handy guides on how to do things, written by users for users.
Moderators:GZDoom Developers, Raze Developers
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
If you ever made music for your mod that isn't MIDI, you probably wondered how to make the end and beginning connect well to each other without a big silence, killing the action. This isn't a big deal for music that has a real finishing part or an ending, the problem is when the music needs to be looped. WARNING: THIS IS SUPPORTED ONLY BY OGG VORBIS AND FLAC FORMATS, NOT MP3
What we will need:
A music track
Audacity and basic knowledge of working in it
THE WRONG WAY:
Spoiler:
So, without a big knowledge of ZDoom's possibilities, you probably did something like this (I did too...):
You copy-paste the music track, let's call them A and B. You move track B so it starts where track A ends and adjust it so when you play it, it will transition from track A to B nicely and smoothly.
You then select track A from point where it connects with track B to where it ends, take it out, delete track B and put the cut part of track A to the beginning of the song.
Now we have a nice loop, right? Well, no, as you probably guessed, when you want to listen to the track, you'll hear echoes from the ending, even the first time we play it. We want to hear the echoes when it loops, so it doesn't sound terribly cropped, but we don't when we first run the track.
So, how do we make the music loop seamlessly everywhere except the first few seconds? Very easily, using ZDoom's audio tags.
THE RIGHT WAY:
Spoiler:
Instead of deleting the track B, just cut it from the point, where track A ends.
That sounds stupid, right? Stay with me. Select the entire audio of track B and switch your timer to samples: Also, make sure that one timer is switched to "Length", not "End".
We want the game to continue playing the music where track B left it off. We could use normal timestamps with seconds etc., but I personally don't like that, it just feels so unprecise.
Anyway, without letting go of the selection, we export the track (be sure not the export only the selection) into .ogg or .flac, and when window for tagging appears, we add a new tag LOOP_START and put in the number of samples we got in the bottom timer.
Save it and now you have a track ready for looping in ZDoom! You don't have to worry about anything else, ZDoom will automatically loop the track, it depends only on the tag.
fredistehboss wrote:How does ZDoom know where to line up the music track? Am I missing something here? Is this just to make it closer to gapless or something?
You're missing on reading the [wiki]audio loop[/wiki] link.
fredistehboss wrote:How does ZDoom know where to line up the music track? Am I missing something here? Is this just to make it closer to gapless or something?
You're missing on reading the [wiki]audio loop[/wiki] link.
Okay so I read it, I'm just having a hard time understanding it. I see that you create "tags" to mark the times of the track.
But how it would "sound" for a song that isn't intended to loop? I'm trying to imagine it is all. When I have time to try it I will.
You'd have to specify exactly where in the song you want the loop to start and end. This will, naturally, depend largely on the song itself, and not all songs will loop gracefully no matter what you do with them.
fredistehboss wrote:Okay so I read it, I'm just having a hard time understanding it. I see that you create "tags" to mark the times of the track.
But how it would "sound" for a song that isn't intended to loop? I'm trying to imagine it is all. When I have time to try it I will.
This is just the way you tell the engine at which points the song loops. Of course, that means you have to find these points yourself -- the engine cannot possibly try to guess. Without such points, the behavior is to loop back to the start of the audio file once the end of the audio file is reached. And of course, if a song isn't intended to loop, it's possible that there isn't any point where a loop would sound good -- in that case, the best scenario is to allow the song to end and then to restart normally. Loop points are for songs that can be made to loop; don't expect miracles.