How do I normalize a file and save it as a new file?

mheumann's icon

Hello all.

I am very new to Max/MSP and I have a question that is probably fairly noobish, but I'll ask it anyways.

I want to create a patch that will read a sound file into a buffer, normalize it, and then write out the normalized sound into a new file. I know I can play the normalized sound file and then record it while it's playing, but I'd prefer an automated process (my goal being to eventually create a patch that will be able to do a variety of sound file manipulations automatically, but I'm starting with something easy).

I've tried doing this any number of different ways but none seem to work. I'm sure there is a very easy answer to this, so I thought I would ask all of you nice people here.

Thanks,
mh

Roth's icon

If you load your soundfile into a [buffer~] you can then send the command the message "normalize 1.0" (no quotes of course) to the [buffer~] and this will have the effect of normalizing to 0dB. Any float number can follow "normalize" and then the highest pick will be scaled to that value.

Jean-Francois Charles's icon

To copy the buffer into another one, then normalize it, you may also use [mxj buf.Op]. Comes with a help file. Look at copyFrom and normalize methods.
J-F.

mheumann's icon

Thanks,

I'll give that one a try. I appreciate the help.
mh

Jean-Francois Charles wrote on Fri, 03 April 2009 19:39To copy the buffer into another one, then normalize it, you may also use [mxj buf.Op]. Comes with a help file. Look at copyFrom and normalize methods.
J-F.

Roth's icon

[mxj buf.Op] is a handy object you should definitely check out, but if all you need to do is normalize your sound and save a new soundfile, using two [buffer~]s and [mxj buf.Op] is more than you need. For example:

Max Patch
Copy patch and select New From Clipboard in Max.

mheumann's icon

I knew there was an easy solution. Thanks very much!
mh

Roth wrote on Fri, 03 April 2009 20:30[mxj buf.Op] is a handy object you should definitely check out, but if all you need to do is normalize your sound and save a new soundfile, using two [buffer~]s and [mxj buf.Op] is more than you need. For example:

Max Patch
Copy patch and select New From Clipboard in Max.

Roth's icon

No problem. It is a good thing I checked before giving you my first off the top of my head solution. I was going to have you use the [waveform~] object (also has a normalize command) because any of my patches that I'm dealing with needing to normalize a buffer has always been in situations where I'm using a [waveform~] with that [buffer~] and I have gotten into that habit.

I mention this because if you aren't familiar with it yet, you should check out [waveform~] because I have a feeling you may want to use some of its features soon.

mheumann's icon

Yeah, I like waveform~ a lot. Here's a variation of what you did using waveform. Again, thanks for help.
mh

Max Patch
Copy patch and select New From Clipboard in Max.

Roth wrote on Fri, 03 April 2009 20:54No problem. It is a good thing I checked before giving you my first off the top of my head solution. I was going to have you use the [waveform~] object (also has a normalize command) because any of my patches that I'm dealing with needing to normalize a buffer has always been in situations where I'm using a [waveform~] with that [buffer~] and I have gotten into that habit.

I mention this because if you aren't familiar with it yet, you should check out [waveform~] because I have a feeling you may want to use some of its features soon.