Sound of a rolling ball

后端 未结 6 1183
悲&欢浪女
悲&欢浪女 2021-02-04 13:38

I\'m looking for the most realistic way of playing sound of a rolling ball. Currently I\'m using a Wav sample that I play over and over as long as the ball is moving - which jus

相关标签:
6条回答
  • 2021-02-04 14:17

    Have you tried playing the sound forward, then playing it backward, and looping that? I use this trick graphically to creating repeating patterns. I don't know much about sound but it might work?

    0 讨论(0)
  • 2021-02-04 14:23

    I really like the approach described in this SIGGRAPH paper:

    http://www.cs.ubc.ca/~kvdoel/publications/foleyautomatic.pdf

    It describes synthesizing the sound of a rock rolling in a wok (no, really :). The idea is to use modal synthesis (i.e. convolved impulse responses), and the results can be very convincing.

    Here's a link to the video demo that goes with the paper:

    http://www.cs.ubc.ca/~kvdoel/publications/foleyautomatic.mpeg

    And here's a link to the JASS library (written by one of the authors), which was used to create the sound for the video:

    http://www.cs.ubc.ca/~kvdoel/jass/jass.html

    I'm not sure if you could make it run on a smart phone, but with an efficient enough convolution routine/approximation you might be able to do something interesting...

    0 讨论(0)
  • 2021-02-04 14:23

    My question is 'why?' - do you see some benefit in this, or is it just for fun? Your question implies that you aren't happy with the wav you are using but I strongly believe that synthesising your own is going to sound far inferior.

    If your wav sample doesn't sound right, I'd suggest try to find another sample. Synthesising a sound is not easy and is never going to sound as realistic as your sample.

    Real time synthesis may require more resources for processing and computation. You may very well end up prerendering your synthesised sound into a wav file and performing a playback.

    If you want to simulate the sound of different materials then you can use some DSP, or even simple tricks like slowing or speeding the wav playback. The simplest way is the prerender these in another application and store one copy of the file for each use.

    0 讨论(0)
  • 2021-02-04 14:30

    I don't think you need the trouble to synthesize that. It would be way too hard to even sound convincing.

    Depending on how your scene is, you could loop the sound foward/backwards and simulate a doppler effect applying a low pass filter and/or changing it's pitch.

    By the way, freesoung.org is a great place for free samples. They are not professionally recorded but are a good starting point for manipulation. On the other hand, sound ideas has some great sample cds (they're actually industry standard) if you can find them on the cheap. You just have to search for which one has rolling ball sounds.

    0 讨论(0)
  • 2021-02-04 14:34

    One approach might be to analyze the sound of a rolling ball, and decompose it into its component waveforms. Then you'd be able to generate your own wav file with synthesized waves.
    You should be able to do this using an FFT on a sample of the sound.

    One drawback is that the sound will likely sound synthesized - you'll have to add noise and such to make it sound more realistic. Getting it to sound real enough may be the hardest part.

    0 讨论(0)
  • 2021-02-04 14:37

    I would guess that you'll get the biggest bang for your buck by doing a dynamic frequency adjustment on the sound that makes the playback frequency proportional to the velocity of the ball. I don't know what type of sound library you use, but most will support some variant of this.

    For example, in FMOD you could use the Channel::setFrequency method. Ideally, you would compute your desired playback frequency based on your WAV's original sample frequency (Fo), the ball's current velocity (Vc), and the ball's 'ideal' velocity at which the default WAV sounds right (Vi). Something generally like:

    F = Fo * ( Vc / Vi )

    This will tend to break down as the ball gets farther away from the 'ideal' velocity. You might want to have several different WAVs that are appropriate for different speed ranges that you switch to at certain threshold velocities. Within each WAV's bracket, you'd do the same kind of frequency adjustment.

    Another note: this is probably not something that is worth doing every frame. I'd guess that doing this more than 20 times per second would be a waste of time.

    ADDENDUM: Playback frequency scaling like this can also be used for simulating the Doppler effect as well. Once you have your adjusted playback frequency, you'd perform another scale of the Frequency based on the velocity of the ball relative to the 'listener' (the camera).

    0 讨论(0)
提交回复
热议问题