Room mode detection with Max

pmt's icon

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

Mattijs's icon

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

pmt's icon

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
>

Eli's icon

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.

Mattijs's icon

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

Chris Muir's icon

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

kjg's icon
pmt's icon

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

pmt's icon

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

Eli's icon

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.

dodgeroo's icon

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.
>

kjg's icon

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

pmt's icon

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

kjg's icon

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

Luis Marques's icon

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?

pmt's icon

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?
>

Luis Marques's icon

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

pmt's icon

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.
>

Luis Marques's icon

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

Luis Marques's icon

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.

pmt's icon

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.
>