Math operations on a whole buffer

Jan 8, 2012 at 5:30pm

Math operations on a whole buffer

Hello forum,
Though I’m a Max user for a whole decade this is my first post, so I’d like to say hi, and it’s a privilege to be part of the community.

I was wondering if there is any obvious way to do some math on a whole buffer of arbitrary size. As a very simple example, finding out the maximum of a buffer in one pass… I know it can be done in realtime but I’m interested in faster than realtime. I can think up a couple of ways to do this, but they are so convoluted that I believe there must be some simple approach.

Best regards,

Jan 8, 2012 at 6:12pm

not obvious, but possible,

go to DSP preferences, you will find a nonrealtime driver there.

eventually you also might want to put the audio in a poly~, where you could process it
using 8 or 16 times upsampling, which ist still faster than without.

Jan 8, 2012 at 6:41pm

Look at “mxj buf.Op” and it’s help file for this kind of thing, it’s super super fast and comes as standard with Max.

The stock object covers a multitude of buffer operations including getting a peak buffer value.

It’s written in java so you can modify the code to suit your needs.

Jan 8, 2012 at 6:51pm

Thanks, but.Op solves it, should have thought about mxj
The non realtime driver would be a crafty solution, but I need realtime audio on my patch as well.
All the best

Jan 8, 2012 at 6:56pm

Be careful of un-licenced but.Op’s! They can be deadly.


You must be logged in to reply to this topic.