Math operations on a whole buffer

gorecki's icon

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,
G

Roman Thilenius's icon

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.

leafcutter's icon

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.

gorecki's icon

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

leafcutter's icon

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