advice on bouncing-ball delay viz

alexstacey's icon

Hi, I'm still very new to Max For Live so thought I'd ask a bit of advice on a plugin I'd like to write, in the hope that I might get some pointers.

I'd like to write a "bouncing ball" type of delay, with a parameter to control gravity. It would be nice to additionally have some kind of graphical representation of a curve that the delay will produce.

I think I can work out the audio effect itself (the gravity control will change a factor that the delay time will decrease - I think that will be simple enough), but not really sure where to start with a visualisation for it.

Any thoughts on that? Thanks in advance.

alexstacey's icon

I found a nice visualisation in another patch that I can use for this but the audio effect itself is proving more difficult than I had imagined!

I want everything that goes into the plugin to have a delay that feeds back with an ever-decreasing delay time. Fo for example, the first time a signal goes through a tapin~ tapout~ pair, I want the tapout~ time to be, say 500ms, then for it to feed back into itself, this time with a delay of 400ms, and decrease by 20% each time.

Is there a way to pass a parameter along with the audio signal itself so it can remember what the last delay value was and decrease it by a certain amount each time?

jrs1's icon

I don't understand 100% procent, but what about

1) using a timer to wait until the delay time is over, then udpate the timer + tapin/out

or
2) monitor the audio signal, when it goes above or below a threshold for a certain duration, then update the tapin/tapout times
.
to monitor the signal you can use snapshot~ and avg~ or average~ (hmm sorry don't have max open and i've forgoten the name)

Roman Thilenius's icon

i would draw vertical lines in an [lcd] to visualize the delay times.

alexstacey's icon

thanks for the replies.

jrs1, neither of those will really do what i want i don't think. For example, a sound is played into the delay which starts at 500ms then decreases each time it loops round, if another sound is played when the delay time gets to 100ms, that sound will start at 100ms, rather than 500ms as I want it to.

The only way I can think to do it is to somehow make the signal aware of how many times it has looped round.

spectro's icon
Max Patch
Copy patch and select New From Clipboard in Max.

The bouncing audio sequence is accomplished easily enough, (see my example below) however, if I understand you correctly, there is no obvious way around the fact that you will need some fancy voice management (or maybe more simply a way of resetting the bounce cycle on detection of a new sound event) in order for it to go through its own complete and uninterrupted bounce sequence.

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

A variation of spectro's method-- it calculates total bounce time for you

Roman Thilenius's icon

one should eventually also try not to use tapout~ at all.

teeth~ can be a fine delay, or an allpass.

or you might consider building more a kind of streaming sampler
or sampler, then you can use play~ and index~ to read.

the alternative is to see it as nothing more than a certain setting of
a multitap delay. you would just calculate the delay times and apply
them to 10, 20, or 30 tapouts which you make available in parallel.