how to get the frequency of bangs

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

Hello.
I'm on a really simple thing I can't solve.
I wanted to evaluate the frequency of an event, for instance , the space bar key presses.
This frequency would control the playback of a movie or a soundtrack.
So I tried to use a counter object but the result is not really efficient and playback is not smooth at all.
Do you have in mind any better solution to find the frequency of a bang?
Thanks

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

maybe something like that will help you.

Luke Hall's icon

Try using [timer]

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.
piet's icon
Max Patch
Copy patch and select New From Clipboard in Max.

thanks everybody, I did not know about timer, which is pretty handy to get BPM (thanks chris)
I still have gliches in my playback, Tried to smooth it with a line object but it s a bit noisy.

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

You might also want to try averaging the last few values so that you're not changing so abruptly each time you press the space bar, something like this might help: