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

Changing pitch gradually down to 0 Hz

Last post 04-01-2008 2:14 PM by ht. 6 replies.
  • 03-30-2008 7:28 AM

    Changing pitch gradually down to 0 Hz

    Hi All

    The project that we are working on has a playback feature where everything slows down gradually, freezes for a sec, and then speeds up gradually again. We would like the sound to do this as well, but I haven't been able to find a way.

    Making a variable (with XACT authoring tool) that I can control from the game engine that will modify the pitch is easy and works in principle, except for the crucial fact that it allows you to only change the pitch by a factor of 0.5 (an octave). Of course we want it to go down far below this, up to 0. Is this possible? For instance, is there a way to change the pitch limitation of 12 semitones?

    Or is there a way to just change the pitch directly in code?

    [Note, the solution suggested in the thread http://forums.xna.com/thread/46487.aspx won't work, because we need gradual changes.]

    Thanks

    ht
    Luma Labs Tutorials, Game Prototypes, Tools
  • 03-30-2008 2:30 PM In reply to

    Re: Changing pitch gradually down to 0 Hz

    In general, no, probably because the re-sampling engine in XAudio isn't intended to bend further than that (I would assume the reason is that the filtering gets kind-of expensive after one octave up/down).

    This is one of those things that you really want direct access to the sound buffers for, because then you can implement your custom sound engine that allows you to do this effect.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 03-31-2008 3:53 AM In reply to

    Re: Changing pitch gradually down to 0 Hz

    This probably wouldn't sound like you imagine anyway. Stretching a digital sample that far sounds absolutely awful, what you'll end up with is a distorted crackly mess very quickly. Your best option would be to record the stretching from an analogue source, and use that as a sample in your game.
  • 03-31-2008 11:44 AM In reply to

    Re: Changing pitch gradually down to 0 Hz

    Thanks for the replies. We will probably do something like you suggest, Matt.

    ht
    Luma Labs Tutorials, Game Prototypes, Tools
  • 03-31-2008 2:38 PM In reply to

    Re: Changing pitch gradually down to 0 Hz

    Stretching a digital sample that far sounds absolutely awful, what you'll end up with is a distorted crackly mess very quickly


    No, it won't, if you design it correctly. You can, in the digital domain, do a stretch down to 0 Hz, just like you can slow down a tape recorder back to 0 ips. It does, however, require a much more expensive interpolation filter than what you can use for simple +/- 1 octave bending, as I said above.

    Recording in advance is a problem if what you're doing is taking a current scene, and slowing it down -- something like bullet time effects in Max Payne. Perhaps what you can do is create multiple versions of each sound effect -- one playing at one-quarter speed, one playing at one-sixteenth speed -- and use the existing range within each effect. The problem is then that you can't blend into "the middle" of a plying cue when you reach the edge of where that cue will go.


    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 04-01-2008 1:06 PM In reply to

    Re: Changing pitch gradually down to 0 Hz

    For what it's worth, the new XAudio2 API allows pitch shifts up or down by a factor of 1024, i.e. ten octaves up or down.  XACT V3 is built on XAudio2 so it could theoretically support something like this as well, and if it's important to you I'd definitely make a request for the feature.  Every bit of feedback helps us choose/justify new features to add.

    However, our built-in SRC implementation is optimized for games; it's very fast, and sounds fine in common game scenarios, but its fidelity does degrade if you push it to extremes.  Freezing the world as you described is a scenario I'd love to enable, but I'm not sure that this SRC would do a good job of it.  Again, a possible feature request for you guys - do you want to be able to replace the built-in SRC with your own implementation for specific voices?

    Thanks,
    Dugan Porter
    (XAudio2 developer, MS)

    Dugan Porter [MS]
    Game Audio Team
  • 04-01-2008 2:14 PM In reply to

    Re: Changing pitch gradually down to 0 Hz

    @Matt: To confirm what jwatte is saying, some of my colleagues had some success with this on other systems, so in theory at least, it can work.

    @jwatte: Our sounds are very non-specific (homogeneous), so with proper blending what you suggests might work. In our case it is very hard to distingiush one part of the cue from another, so if there aren't any out-of-phase weirdness, it should be okay. We will have to listen how this sounds though.

    @Dugan: Yes, pitch shifting by 10 octaves is definetaly a feature worth implementing. Although it is a small part of the bigger picture, the amount of effort and time spent on workarounds and such can be tremendous. For example, on our current project, I have spent just about as much time on this issue as on all the other sound issues together (of course, that is because setting "normal" things up is made so simple in the first place!)

    As for custom SRCs, my first response will be yes! More is always better, even if you don't use it... However, one of the charms of the system as it stands is just how easy it is to set things up and get basic effects. Not only the programming side of things, but also the way things are structured - making managing sound pleasureable (compared with art, which is a nightmare). So I would be a bit weary of features that threatens the organisation of our projects... Of course, having this kind of custumisation opens the door for so many other cool things!

    In the meantime, we will explore some workarounds - I will report here for others if we get something that works.

    Thanks all

    ht
    Luma Labs Tutorials, Game Prototypes, Tools
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