XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

Initial track to loop track

Last post 07-21-2008 6:07 PM by HerrUppoHoppa. 6 replies.
  • 07-18-2008 2:34 PM

    Initial track to loop track

    Hi, my music guy wants to split the level music into two parts, one that plays from the start and a second part that will loop infinitely.

    I tried doing this in XACT and almost managed....twice. the first thing I tried was adding two sounds into a cue where I put 100% chance on the first part and then just click loop infinitely on the second part but this won't work since I will have to play the cue twice.

    The second approach almost worked. I put the two audio files on separate tracks in one sound and add a delay to the second track by using the Time stamp field on the "play wave" event. This works for most of my stuff but it seems that I can't put as long a delay as I wan't, there seems to be a limit of ~65 seconds and I need 93 seconds. Not sure why this limit is here or if it's based on the audio file length...but still not the entire length or whatever the problem is.

    Does anyone have a clue to how I could solve this?

    Edit:

    Oh and BTW I thought I might be able to use one track but have two "play wave" events but I can't seem to add another....the option is grayed out.

    Regards,

    Pontus Birgersson Shortfuse Entertainment http://www.shortfuse.se/
  • 07-18-2008 3:10 PM In reply to

    Re: Initial track to loop track

    You can't do perfect music timing in XNA with XACT. You'll need XAudio2-style buffer pushing to do that, which isn't exposed into XNA.

    A work-around might be to create a playlist for the cue, with the cues in the order you want. You don't use random weight for ordered playlists. Then set "limit instances" to 1, and set the behavior of multiple requests to "queue." Then you can start the cue twice when you want to play it, and it will play the first, then queue the second part. With XACT, I don't think you can get better than that.

     

    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 07-18-2008 3:28 PM In reply to

    Re: Initial track to loop track

    I've been searching around and I can't seem to find any info on creating playlists for queues, how would I go about creating one?
    Pontus Birgersson Shortfuse Entertainment http://www.shortfuse.se/
  • 07-18-2008 4:00 PM In reply to

    Re: Initial track to loop track

    I've also been trying to figure out how to get xna-xact to do beat matched multi-looping with a variable reference. However, I don't think it's possible within xna-xact yet.

    There's a lot of posts on here describing a method of doing this, but they don't seem to work...  here's the system I've derived...

    ...put multiple wavs into one "sound", each on its own track, and reserve the first track for markers. (these waves are different tracks of the same music loop used for variance.)  Set each to infinitely loop... Attach an RPC to each sound for volume between tracks.  Create an interactive cue and drop in your "sounds". Create a variable that will control your music selection and assign each "sound" to a variable range...this variable will also control your volume RPC within each sound- you'll have to set the variable ranges on a global scale.  Set up your transitions. This will give you a scale from, say, 0-100, that will transition between tracks within a sound as well as between actual sounds, giving you a lot of possibility... 

    (I set it up like this so I can use one variable to control the intensity of the music in its entirety.  0 is low intensity, 100 is max intensity... and along the way there are 3 main loops, each with multiple tracks...)

    however, this doesn't work: transitioning between tracks works because you're simplying using RPCs to control an inverse volume relationship between two tracks within a single sound that has music loops that are identical in length and beat looping at the same time.  The problem is transitioning between "Sounds".  If you set your transitions to go from the 'end of source' to the 'beginning of destination' you'd think it would match up the beats... sadly it doesn't- as soon as your variable crosses into a new loops range, the transition will happen immediately, NOT at the end of the loop. Markers don't seem to help your transitions either- they have the same problem.

    I have been trying for a week to get this to work properly and I can't. I'm no programming whiz by any means- I am a full-time sound designer familiar with FMOD and a few other game audio tools, so I'm not a complete moron... but I certainly am stumped with getting this to work on my own.

     

    Transitions in interactive cues seem so temperamental I think we're just stuck having to just fade in/out of loops without matching beats for now. (Matching beats seems possible, but not without an audio programmer that can do a significant amount of external code- maybe that will work for you...but unfortunately, our programming team is overbooked as it is and beat matching is out of the scope of our ability unless I can do it myself.)

    Good luck to you!

  • 07-18-2008 4:20 PM In reply to

    Re: Initial track to loop track

    Woooh you're waaay above my level here!

     I think I'm going to have to do some manual programming instead, seems like learning XACT good enough to do this is going to be harder than I thought.
    Thanks for your help, you seem to know what you're going so good luck with it:p

    Regards

    Pontus Birgersson Shortfuse Entertainment http://www.shortfuse.se/
  • 07-18-2008 5:53 PM In reply to

    Re: Initial track to loop track

    I put the two audio files on separate tracks in one sound and add a delay to the second track by using the Time stamp field on the "play wave" event. This works for most of my stuff but it seems that I can't put as long a delay as I wan't, there seems to be a limit of ~65 seconds and I need 93 seconds.

    I've certainly seen it done this way before but didn't know there was a limit to the delay. Why so long at 93 seconds? Seems like a very long intro.

    Failing that though - surely you can just author a single wav containing both the attack and the loop, and use a loop marker in the wav itself? I'm pretty sure if you simply do that and set the sound to looping in XACT, it will loop on the loop marker. I mean, I assume the important distinction here is "attack" and "loop" not that you have to use two separate files for some specific reason.

    Pandemonium, an occasionally updated blog about my game, XNA, games development, and the games industry; XapParse, a parser for XAP (XACT) files
  • 07-21-2008 6:07 PM In reply to

    Re: Initial track to loop track


    Andy Patrick:
    I've certainly seen it done this way before but didn't know there was a limit to the delay. Why so long at 93 seconds? Seems like a very long intro.

    Yeah you know artists:p He had some explaination that I barely understood. Something about needing to go through the loop once in the starting sound before the actual loop was played because the loop needed to start differently the first time from the rest...it's like he needs to do an ugly hack but with sound:)

    Andy Patrick:
    Failing that though - surely you can just author a single wav containing both the attack and the loop, and use a loop marker in the wav itself? I'm pretty sure if you simply do that and set the sound to looping in XACT, it will loop on the loop marker. I mean, I assume the important distinction here is "attack" and "loop" not that you have to use two separate files for some specific reason.

    Oh cool that might work, I'll have to talk to the sound guy about it, maybe he knows more. If all else fails I guess I'll just make a playlist as was suggested previously.

    Pontus Birgersson Shortfuse Entertainment http://www.shortfuse.se/
Page 1 of 1 (7 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG