Bouncing ball delay

Sam Sturtivant's icon

I was wondering if there is an easier way about creating a delay that replicates a bouncing ball/exponential decay.

spectro's icon

Easier than ...? In any case, the forum search should reveal at least a few threads on the topic. Here is one I recall contributing to - It contains some examples that should get you bouncing away...

Peter McCulloch's icon

UltraComb, one of my free SubtleSonic M4L devices does this.

There are three approaches: lots of delay taps and gain on the taps; feedback loop with decreasing delay time (check out the vdelay (?) abstraction for a clickless way of changing times); recording sound into a buffer and looping progressively shorter segments.

The first one works continuously and has some fun properties. The second two do not work continuously, but are more efficient, and can be built using poly~ in order to have overlapping delays.

jazzisfaction's icon

Hey
I'd like to build a bounce-player by scratch, based on a 'no-matter what' sound-sample.
It should be able to:
1) determine the start position
2) determine the length of the bounced sample
3) determine the number of tabs (e.x. between 5 and 64)
4) determine the tempo of the tabs
-> the combination of 3&4 should influence/determine the length of the bounce
5) the gain decreases at the end of the bounce
6) there should be the choice that not only the gain decreases but also the pitch in- or decreases

I have not so much experience with any kind of sample-based bounce player so far....any hints / patches / tips which could help?
Thanx a lot
Peer

Peter McCulloch's icon

Bouncing balls have an exponential decay in terms of time between bounces. When the ball hits the ground, the collision is not perfectly elastic, so energy will be lost. You can model that as a multiplier that we'll call a, where a is the amount of energy preserved (1 would be perfectly elastic, 0 would be a dead fish). Each time through the loop, that multiplier is applied.

So the duration of the loops will be:
a^0, a^1,a^2,a^3,a^4,....a^n.

Because a will be in [0,1), the duration of the loops will decrease. If a were 0.8, this would look like:

1, 0.8, 0.64, 0.512, 0.4096, 0.32768, etc.

The overall duration would be the sum of those values.

In building your loop player, you'll get varying results based on your source material. Ideally, your algorithm could take this into account in choosing its parameters. If you were working with a percussive sound, say from a hand drum, I would have the first loop start at a transient, and then move the start point progressively later with each loop. That way you will get a natural decay, as the subsequent bounces will occur more on the sustained portion of the sound. You could also use the coefficients that I listed above as a way to successively decrease the volume of the sound, though you might want to take into account the sound's amplitude envelope as well with that calculation.

Hope this helps!

cobtob's icon

This could be a way to go. Using a poly~ for each bounce and wrap that in another poly~ for several bouncing balls. I just fill colls with the params for each bounce.

bounce_player.zip
zip
jazzisfaction's icon

thanx to all of you....that helps a lot

Cheers
Peer