Room mode detection with Max

Jun 5, 2008 at 2:39pm

Room mode detection with Max

hi all,

i have a pair of JBL monitors that, through the use of an
omnidirectional mic placed at the listening point and connected to the
speakers, perform a room mode adjustment via some sine sweeps. i am
assuming that spectral analysis of the sweeps allow the monitors to
determine what frequencies a space amplifies or attenuates, and it
adjusts it’s eq accordingly.

i’m wondering if anyone on this list has done anything similar with
Max/MSP? So, assuming you have a two monitor (or PA speaker) setup with
an omnidirectional mic placed at some predetermined distance from the
speakers, how would you determine the standing waves in a given space
(automatically – that is an important caveat)? if you have done this but
with another tool, i’d be curious to hear about it, but i plan on
implementing it in Max myself.

one approach i have considered is playing a sine sweep out the monitors,
recording it, then playing that recording back and recording it, and
over again several times, until the amplified/attenuated frequencies
really start to stand out. then compare FFTs of generation 1 with
generation 5 (or something like that) and look for the significant
differences. anyway, i’m interested and curious to hear ideas, input,
criticisms, etc. this project is to end in an installation as part of my
dissertation, so all code developed for it will be shared and open. many
thanks in advance.

best,

peter

#38252
Jun 5, 2008 at 4:55pm

I never tried this, but I would definitely use only one speaker to play the sine to avoid an unnecessary risk of interference at the position of the mic.

Mattijs

#133100
Jun 6, 2008 at 4:49pm

yes, i’m doing that. i made some recordings of the Room Mode Correction
sequence that my JBLs do, and they don’t seem to put out simple sine
sweeps. this is also possibly because they are calibrating purely for
the listening position. for my purposes, i don’t care a specific
listening position, but rather just determining the standing
waves/harmonics of a space.

p

Mattijs Kneppers wrote:
> I never tried this, but I would definitely use only one speaker to play the sine to avoid an unnecessary risk of interference at the position of the mic.
>
> Mattijs
>

#133101
Jun 6, 2008 at 7:07pm

I would say take the recording of the sine sweeps (first find out what pitch range the sine sweep has-and what exact pitches occur at say, 64 points of the sine sweep) and then subtract the dry (not played back through the room, internal) sine sweep to find out what the room adds to the sound, and at what pitches the room amplifies the sine sweep at.
Then with that information send all of Max/MSPs output through a [filtergraph~] object that EQs the Max/MSP audio accordingly, before it is outputted into the room.

#133102
Jun 6, 2008 at 9:40pm

But isn’t the best way to characterize a room to simply get its impulse response? This would automatically give you the frequency response.

Mattijs

Quote: pmt4u wrote on Fri, 06 June 2008 18:49
—————————————————-
> yes, i’m doing that. i made some recordings of the Room Mode Correction
> sequence that my JBLs do, and they don’t seem to put out simple sine
> sweeps. this is also possibly because they are calibrating purely for
> the listening position. for my purposes, i don’t care a specific
> listening position, but rather just determining the standing
> waves/harmonics of a space.
>
> p
>
> Mattijs Kneppers wrote:
> > I never tried this, but I would definitely use only one speaker to play the sine to avoid an unnecessary risk of interference at the position of the mic.
> >
> > Mattijs
> >
>
>
—————————————————-

#133103
Jun 6, 2008 at 10:00pm

On Jun 6, 2008, at 2:40 PM, Mattijs Kneppers wrote:
> But isn’t the best way to characterize a room to simply get its
> impulse response? This would automatically give you the frequency
> response.

But would this tell you much about standing waves?

-C

Chris Muir
cbm@well.com

http://www.xfade.com

#133104
Jun 7, 2008 at 12:31am
#133105
Jun 7, 2008 at 12:57am

i thought about trying an impulse too, but haven’t gotten to it yet. my
guess is that i would need to do several record/play sequences to build
up enough response that the standing frequencies could be detected
automatically. another method i tried last night was just playing a few
seconds of white noise (using noise~ of course), and record/playing
several times over. that also brought out specific frequencies over
time, although i’m not quite sure yet how to actually determine those
frequencies via analysis in max (i haven’t used the fft objects before,
but i’m guessing that is where the answers lie). still, a sine sweep
seems to produce the best results so far.

p

Chris Muir wrote:
>
> On Jun 6, 2008, at 2:40 PM, Mattijs Kneppers wrote:
>> But isn’t the best way to characterize a room to simply get its
>> impulse response? This would automatically give you the frequency
>> response.
>
>
> But would this tell you much about standing waves?
>
> -C
>
> Chris Muir
> cbm@well.com
> http://www.xfade.com
>
>
>
>
>
>

#133106
Jun 7, 2008 at 1:05am

this is useful, although i’m not sure if it is in terms of what i’m
trying to accomplish in this particular patch. the issue here is that it
should be an automated process, i.e., that the software should be able
to sound out the fundamental modes of the room, and then use them to
musical effect later on. this means it knows nothing about the space’s
actual dimensions. this is still nice tool though, thanks!

p

Klaas-Jan Govaart wrote:
> this might help:
> http://www.marktaw.com/recording/Acoustics/RoomModeStandingWaveCalcu.html
>

#133107
Jun 7, 2008 at 1:37am

Yes, you’re going to have to analyze the recorded sine sweep or impulse with the Fast Fourier Transform, so get comfortable with the objects that use it.

#133108
Jun 7, 2008 at 9:21am

a quick and dirty way to do this is to record the ambient sound of the
room then play it back into the room, then record that, and play it,
then record that, then play it… etc. It is a rough way of doing it
and any attenuations and boosts in your speaker or mic might influence
the result but it is a quick way to get some of the stronger room
modes and it is a fun experiment :)

On Sat, Jun 7, 2008 at 2:37 AM, Eli Stine wrote:
>
> Yes, you’re going to have to analyze the recorded sine sweep or impulse with the Fast Fourier Transform, so get comfortable with the objects that use it.
>

#133109
Jun 7, 2008 at 10:21am

So you want Max to detect the room modes. Ok.
Guess I was skipping through your original message a bit too fast yesterday. I thought you just wanted to know (through whatever means) what the modes of the room are. The math behind that isn’t really that hard, so I figured you could just calculate it instead of using a patch measuring. When trying to dig out the formulas I ran into the applet that does in for you.

I guess sweeping the room could get you some data on the dips and peaks (but at the exact mic position only!). I’m assuming you would want to correct for those using eq? Keep in mind that a peak in one spot (near a node) often has a corresponding dip (near the anti-node) ans vice versa.
Say you measure -3dB at 100Hz where your mic is.. Then you set up an eq to compensate for that.. In another place in the room, you have now increased a 3db peak at 100Hz to 6dB. (Simplified example, but you get the idea).
Keep in mind that using a sine sweep through one speaker is only a very rough approximation of the real life situation. With two speakers and complex sound, moving the microphone only an inch can result in a very different measurement. Prepare to lock your head using some metal.. You need to be in a fixed position…
Also, room modes are not only a frequency, but also a time domain issue.. They are resonances – stored energy. Read into modal ringing.

I feel that eq/filtering is not the way of dealing with problems in acoustics, generally. Money spent of speakers and plugins that provide “corrective” systems, is often better spent on a bass trap or two… After doing some calculations, of course. This way you deal with the problem at the source. “Corrections” using filtering and such are just a band-aid.

What is your application?? Or is it just about “can I built the same thing in Max?”, regardless of it being a good way of dealing with things or not?

regards,
kjg

Quote: pmt4u wrote on Sat, 07 June 2008 03:05
—————————————————-
> this is useful, although i’m not sure if it is in terms of what i’m
> trying to accomplish in this particular patch. the issue here is that it
> should be an automated process, i.e., that the software should be able
> to sound out the fundamental modes of the room, and then use them to
> musical effect later on. this means it knows nothing about the space’s
> actual dimensions. this is still nice tool though, thanks!
>
> p
>
> Klaas-Jan Govaart wrote:
> > this might help:
> > http://www.marktaw.com/recording/Acoustics/RoomModeStandingWaveCalcu.html
> >
>
>
—————————————————-

#133110
Jun 7, 2008 at 2:44pm

thanks! i was wondering how much of a difference mic position would
make. i figured it would make a lot, thanks for confirming that. in
terms of my application, i’m not actually looking to eq/filter at all.
this is for a piece, a sort of automated sound installation that could
be placed in any enclosed space, sound out the space, and then play with
the resonances/modes it detects. so i’m really looking to play with and
exploit those modes, rather than filtering them out or compensating for
them. my jbl monitors obviously do this analysis as a form of
correction, which gave me the idea to use a similar technique for a
difference purpose.

p

Klaas-Jan Govaart wrote:
> So you want Max to detect the room modes. Ok.
> Guess I was skipping through your original message a bit too fast yesterday. I thought you just wanted to know (through whatever means) what the modes of the room are. The math behind that isn’t really that hard, so I figured you could just calculate it instead of using a patch measuring. When trying to dig out the formulas I ran into the applet that does in for you.
>
> I guess sweeping the room could get you some data on the dips and peaks (but at the exact mic position only!). I’m assuming you would want to correct for those using eq? Keep in mind that a peak in one spot (near a node) often has a corresponding dip (near the anti-node) ans vice versa.
> Say you measure -3dB at 100Hz where your mic is.. Then you set up an eq to compensate for that.. In another place in the room, you have now increased a 3db peak at 100Hz to 6dB. (Simplified example, but you get the idea).
> Keep in mind that using a sine sweep through one speaker is only a very rough approximation of the real life situation. With two speakers and complex sound, moving the microphone only an inch can result in a very different measurement. Prepare to lock your head using some metal.. You need to be in a fixed position…
> Also, room modes are not only a frequency, but also a time domain issue.. They are resonances – stored energy. Read into modal ringing.
>
> I feel that eq/filtering is not the way of dealing with problems in acoustics, generally. Money spent of speakers and plugins that provide “corrective” systems, is often better spent on a bass trap or two… After doing some calculations, of course. This way you deal with the problem at the source. “Corrections” using filtering and such are just a band-aid.
>
> What is your application?? Or is it just about “can I built the same thing in Max?”, regardless of it being a good way of dealing with things or not?
>
> regards,
> kjg
>
>
>
> Quote: pmt4u wrote on Sat, 07 June 2008 03:05
> —————————————————-
>
>> this is useful, although i’m not sure if it is in terms of what i’m
>> trying to accomplish in this particular patch. the issue here is that it
>> should be an automated process, i.e., that the software should be able
>> to sound out the fundamental modes of the room, and then use them to
>> musical effect later on. this means it knows nothing about the space’s
>> actual dimensions. this is still nice tool though, thanks!
>>
>> p
>>
>> Klaas-Jan Govaart wrote:
>>
>>> this might help:
>>> http://www.marktaw.com/recording/Acoustics/RoomModeStandingWaveCalcu.html
>>>
>>>
>>
> —————————————————-
>
>
>

#133111
Jun 7, 2008 at 3:30pm

Quote: pmt4u wrote on Sat, 07 June 2008 16:44
—————————————————-
> thanks! i was wondering how much of a difference mic position would
> make. i figured it would make a lot, thanks for confirming that. in
> terms of my application, i’m not actually looking to eq/filter at all.
> this is for a piece, a sort of automated sound installation that could
> be placed in any enclosed space, sound out the space, and then play with
> the resonances/modes it detects. so i’m really looking to play with and
> exploit those modes, rather than filtering them out or compensating for
> them. my jbl monitors obviously do this analysis as a form of
> correction, which gave me the idea to use a similar technique for a
> difference purpose.

ok, sounds interesting! keep us posted on your progress, ok?

good luck!
klaas-jan

#133112
Jun 9, 2008 at 12:24pm

hi, i read this post and is a realy interesting subject, but, instead of using fft why don’t simple use analyze~ ?? i’m i going to a wrong way?

#133113
Jun 9, 2008 at 3:05pm

thanks luis, i’ll check it out. currently cnmat.berkeley.edu (where the
object is apparently hosted) is not responding for me, so hopefully
they’ll bring it back online soon. i’ll let you know if analyzer~ does
what i’m looking for. thanks again.

best,

peter

Luis Marques wrote:
> hi, i read this post and is a realy interesting subject, but, instead of using fft why don’t simple use analyze~ ?? i’m i going to a wrong way?
>

#133114
Jun 9, 2008 at 3:10pm

i can send it to you, or post a link here… just let me know.

#133115
Jun 9, 2008 at 4:43pm

that would be great. either emailing to me or posting a link on the list
is fine. the cnmat site is still currently down (at least from where i’m
trying to reach it). i need the OSX version of the external. thanks luis!

p

Luis Marques wrote:
> i can send it to you, or post a link here… just let me know.
>

#133116
Jun 9, 2008 at 5:01pm

ok, below is the rapidshare link, since you mention CNMAT i presume you want the whole package. just let me know if analyze~ is the answer.

http://rapidshare.com/files/121246903/CNMAT-MachO.zip.html

#133117
Jun 9, 2008 at 5:04pm

i forgot to mention, this is the mac osx package and i tested in max 4.6.3 and 5.0.2 and works fine. i presume this works on windows too, but in not shure, since i only work whit mac.

#133118
Jun 9, 2008 at 5:34pm

thank you again luis, this is great. as far as platforms go, tristan
jehan provides separate binaries for win, os9, and osX on his site, so
i’m not sure these ones would work on anything other than a mac running
os x. anyway, i’ll get to work learning about them, and will update the
list if i come up with any interesting/working solutions to my problem.
many thanks again for your help.

best,

peter

Luis Marques wrote:
> i forgot to mention, this is the mac osx package and i tested in max 4.6.3 and 5.0.2 and works fine. i presume this works on windows too, but in not shure, since i only work whit mac.
>

#133119

You must be logged in to reply to this topic.