Forums > MaxMSP

Smoothing Numbers

May 02 2012 | 3:43 pm

Hi there

Background: Basically for one of my projects I am trying to control the brightness of a video with a snare drum. I have connected the drum with a contact mic which is going into the computer. How I want to control the brightness is through a drum roll and basically the harder the hit the brighter it’ll get.

The problem I’m having is that the numbers that is coming through aren’t smooth and they’re fluctuating so much that I can’t control them.

I was wondering if there is a way smoothen the process.

Attached is what I have so far, I am quite new to Max so it isn’t really designed very well.

If anyone can help I’ll very grateful :)

  1. asdf.maxpat
May 02 2012 | 3:52 pm


May 02 2012 | 5:45 pm

The problem is that you’re using number~ which is taking a sample every n ms–the catch is that even if the sound is really loud, you can’t guarantee that it’s taking that at a loud spot; it could be taking it at 0.00001, even though the peak is 0.999.

Instead, you want to look at the peak amplitude (i.e. peakamp~)

Here’s a demo with some extra smoothing stuff to improve tweakability.

-- Pasted Max Patch, click to expand. --

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP