Xonotic Forums
Custom music looping! [SOLVED] - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Music and Sound Development (https://forums.xonotic.org/forumdisplay.php?fid=33)
+--- Thread: Custom music looping! [SOLVED] (/showthread.php?tid=359)

Custom music looping! [SOLVED] - unfa - 05-01-2010

Hey all!

Is there any way to set up a custom looping points for music tracks?
For example I want my track to loop from the end to 0:25, not the beginning.

Can I do that in Xonotic?

Is it possible to layer two instances of music track?
I mean...
the whole track: ##A#######B+-,.
I want it to loop from point A to point B but without cutting the fadeout that continues after point B. It would loop freaking seamlessly that way!

the first instance: ###########+-,.______--#########+-,.
the second one: _____________--#########+-,.__________

It goes like that:
1. the game starts first instance is being played from the beginning (with intro)
2. first instance reaches it's B point, so...
3. second instance is being lauched from it's point A and both are layered
4. second instance reaches it's B point so...
5. first instance that ended earlier is raised again from point A and...
6. it continues from line 2

RE: Custom music looping! - The mysterious Mr. 4m - 05-01-2010

Can You try explaining this by using another program as an example? If i understand You correctly, one could run two instances of VLC Media Player, for example, or mix the tracks into one with Audacity.

Edit: Do You mean playing a track from the start, with intro, then looping a sequence within the track, discarding the intro, and mixing-in another track at some point?

RE: Custom music looping! - unfa - 05-02-2010

Hmm, let's try...

I have a VLC and empty playlist. I also have three files for one track.
Thirst track is the intro with rest of the track but without the fadeout
Second track is everything but intro, with the fadeout mixed with in beginning of it and not in the end

I place them in the playlist like that:
1. First
2. Second
3. Second
4. Second
... etc.

If VLC can play them seamlessly, you would (most likely) hear what I'am aiming for in the game.


As for now the tracks are being looped from end to start. Once the track reaches it's end, it is immidietly started again from the beginning.

But what I asking for is a bit more complicated.

I don't mean two different tracks to be mixed - just two instances of the one, same track.
It is all to avoid the "moment of silece" which is a seam in looping. A smooth seam, but still.
Additionally I want the intro of the track to be played just once - at the beginning of the match. This will also give the musitians (like me) posiibility to make the music warm up the match with intro stage Smile

Someone who was playing with trackers might know what am I aiming for. It is very similiar, but requires also mixing the track's fadeout with the beginning of it's new instance to avoid the CUT effect.

RE: Custom music looping! - The mysterious Mr. 4m - 05-03-2010

I was just a little confused and unsure. This is definitely something that would be wanted.

RE: Custom music looping! - The mysterious Mr. 4m - 05-06-2010

Could somebody from the devs please answer?

RE: Custom music looping! - mand1nga - 05-16-2010

OGG files support this, I knew about this feature thanks to divVerent. Please see what he added to the Music wiki page here

I don't know how to do this technically, but it'd nice to experiment with your track and document the process Smile

RE: Custom music looping! - unfa - 05-16-2010

I have just found this, thanks to you, mand1ga:

Quote:For this the ideal way is to find a start and end sample index, so that that region is perfectly (clickless) loopable. These can be set as LOOP_START and LOOP_END tags in the Vorbis file, and the engine will seek back to LOOP_START when reaching LOOP_END.
Seems like a bit of a solution.

RE: Custom music looping! - mand1nga - 05-16-2010

Yeah, please if you managed to do that leave a brief how-to note so I can add it to the wiki. Probably divVerent already knows how to do that but I forgot to ask him today.
If you need any help just ask.

Thank you

RE: Custom music looping! [SOLVED] - unfa - 06-14-2010

(05-16-2010, 06:18 PM)mand1nga Wrote: Yeah, please if you managed to do that leave a brief how-to note so I can add it to the wiki.

It works!Not exactly the way I was talking about before but this solution is satysfying me as a musician - big thumb up for the developer who coded it! Thanks! Smile

It's easy to do with Audacity, all you need to do:

Select the region to be looped (use 'Z' key after that to snap to zero-crossing - helps eliminate looping clicks):

.png   screenshot2.png (Size: 5.58 KB / Downloads: 41)

Change to view selection start and end time to samples:

.png   screenshot3.png (Size: 4.5 KB / Downloads: 41)

Save the file adding two special tag entries: LOOP_START and LOOP_END:

.png   screenshot4.png (Size: 28.12 KB / Downloads: 41)