• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Room simulator for non-shoebox rooms

vesalaasanen

Member
Joined
Sep 21, 2021
Messages
10
Likes
46
Couldn't find a room mode simulator that handled anything other than shoebox rooms, so I made one. Been using it for my own projects, but decided to throw it online.

Rectangular rooms do the usual analytical mode calculation. The more useful bit is the custom mode. Draw whatever floor plan you have, and it solves the modes with FEM in the browser. L-shapes, angled walls, alcoves, and so on. There's a pressure heatmap too so you can see where the nulls and peaks end up with your speaker positioning. You get the frequency response at the listening position with up to 6 sources, each with independent gain, delay, and polarity, and their coherent sum.

The ceiling has to be flat. The FEM is 2D with vertical modes tacked on. Full 3D would be way too slow to keep interactive. Rigid walls, uniform absorption, no furniture. Works best below the Schroeder frequency, as you'd expect.

No installation, no login, runs in the browser. Ideas and bug reports welcome.

1771408365985.png
 
This is great, thank you so much!

Just out of curiosity - how big of a task would it be to make a simulator that could simulate non-uniform roof height- and shape in addition to non-rectangular floor plan?

I have been searching for one, as my second (more serious) listening space has a gabled roof with a flat middle portion in addition to L-shaped floor plan (sorry, hard to explain).
 
This is great, thank you so much!

Just out of curiosity - how big of a task would it be to make a simulator that could simulate non-uniform roof height- and shape in addition to non-rectangular floor plan?

I have been searching for one, as my second (more serious) listening space has a gabled roof with a flat middle portion in addition to L-shaped floor plan (sorry, hard to explain).

My estimation is that a full 3D FEM would be 100-1000x more computationally complex in normal-sized rooms. It's not a super complex thing to do, but it would not fit in the category of interactive simulators :) Making something like that would require C++ or Rust instead of JavaScript to make it even remotely interactive.
 
Couldn't find a room mode simulator that handled anything other than shoebox rooms, so I made one. Been using it for my own projects, but decided to throw it online.

A challenge - could it do anything for my room? I coudn't find a way to upload my room plan.

In pretty happy with the room as it is after adding furniture, carpets, etc, but any information that may improve matters always welcome.
 

Attachments

A challenge - could it do anything for my room? I coudn't find a way to upload my room plan.

In pretty happy with the room as it is after adding furniture, carpets, etc, but any information that may improve matters always welcome.

Well that's an interesting room shape for sure!
 
A challenge - could it do anything for my room? I coudn't find a way to upload my room plan.

In pretty happy with the room as it is after adding furniture, carpets, etc, but any information that may improve matters always welcome.
Currently doesn't support curved walls or uploading.
 
Couldn't find a room mode simulator that handled anything other than shoebox rooms, so I made one. Been using it for my own projects, but decided to throw it online.

Rectangular rooms do the usual analytical mode calculation. The more useful bit is the custom mode. Draw whatever floor plan you have, and it solves the modes with FEM in the browser. L-shapes, angled walls, alcoves, and so on. There's a pressure heatmap too so you can see where the nulls and peaks end up with your speaker positioning. You get the frequency response at the listening position with up to 6 sources, each with independent gain, delay, and polarity, and their coherent sum.

The ceiling has to be flat. The FEM is 2D with vertical modes tacked on. Full 3D would be way too slow to keep interactive. Rigid walls, uniform absorption, no furniture. Works best below the Schroeder frequency, as you'd expect.

No installation, no login, runs in the browser. Ideas and bug reports welcome.

View attachment 511875
tremendous work
 
There is also i-Simpa. It's a professional tool, so it's not exactly easy to use. You have to create a CAD drawing of the room and then import it into the program.
Eons ago, I used CaraCad, unfortunately no longer developed, it was very developed at the time.
 
Last edited:
There is also i-Simpa. It's a professional tool, so it's not exactly easy to use. You have to create a CAD drawing of the room and then import it into the program.
I was looking at this before starting the project, but this was a bit too hardcore for my use case. But awesome project nevertheless!
 
This is great, thank you so much!

Just out of curiosity - how big of a task would it be to make a simulator that could simulate non-uniform roof height- and shape in addition to non-rectangular floor plan?

I have been searching for one, as my second (more serious) listening space has a gabled roof with a flat middle portion in addition to L-shaped floor plan (sorry, hard to explain).
You can find (the link to) an arbitrary shape 3-D room mode simulator in this thread. It is built using the COMSOL FEM application builder by member @ylio. However, you'll need to import the room geometry in a 3-D CAD format (STL is the preferred one) since it would be impractical to construct a 3-D room of any complexity without using a 3-D CAD solid modeler.
 
Awesome!
And I just saw we can add more points/walls in custom, its ease of use made me realise that few variations don’t have such a big effect, no need for perfect representation.
Super useful to test different bass traps spots next we!
Thx a lot!
 
Great tool, awesome work! Thank you.
Currently doesn't support curved walls or uploading.
But a polygon approximation will probably be pretty close.
room-plan_61Hz.png


The browser address field seems to contain all the info from the room model, but this seems not to work as a link.
This is the link to the room in the picture.

With such great possibilities the interactive mode becomes some kind of a disadvantage. I could not find a way to directly edit the vertices. And every move triggers the computation. So editing vertices becomes rather cumbersome.
Another problem I ran into is moving edge vertices. When dragging outwards the zoom function kicks in and everything starts to slide. Nearly impossible to exactly place a vertices at the edge.
Is there a way to see at least the coordinates without clicking on them (and again triggering the computation most of the time)?It would be nice to be able to stop both the zoom function and the interactive computation in some situations.

And some way to numerically edit the vertices like it is possible with positions of subs and listener.

It is a bit counterintuitive that changing gain or moving toward a sub does not change the sound level.
How is "0dB" defined?
 
Great tool, awesome work! Thank you.

But a polygon approximation will probably be pretty close.
View attachment 511931

The browser address field seems to contain all the info from the room model, but this seems not to work as a link.
This is the link to the room in the picture.

With such great possibilities the interactive mode becomes some kind of a disadvantage. I could not find a way to directly edit the vertices. And every move triggers the computation. So editing vertices becomes rather cumbersome.
Another problem I ran into is moving edge vertices. When dragging outwards the zoom function kicks in and everything starts to slide. Nearly impossible to exactly place a vertices at the edge.
Is there a way to see at least the coordinates without clicking on them (and again triggering the computation most of the time)?It would be nice to be able to stop both the zoom function and the interactive computation in some situations.

And some way to numerically edit the vertices like it is possible with positions of subs and listener.

It is a bit counterintuitive that changing gain or moving toward a sub does not change the sound level.
How is "0dB" defined?

Yeah, it's a balance game to create a web app with enough but not too many controls. Did you try to set the zoom from fit to something reasonable for your room, like 10m? Then it doesn't zoom. You can also use "clear / redraw" button to draw the room without triggering the computation before you hit done.

Everything is relative in the calculation. 0dB is just the average of the sum. I guess I could define an absolute level option, but then it's again the balance between options and where to fit them.

It's actually a good idea to create a system where you can share a link with all the data. Have to think about it.
 
Yeah, it's a balance game to create a web app with enough but not too many controls. Did you try to set the zoom from fit to something reasonable for your room, like 10m? Then it doesn't zoom. You can also use "clear / redraw" button to draw the room without triggering the computation before you hit done.
My room is a bit under 5m, so a 10m canvas is already mighty big. And with the draw option it is actually not easy to draw a rectangle as the coordinates are not shown, only the length of the edge. And even with the coordinates shown (editing after the initial drawing) it is a challenge to hit the right number with my trackpad in 10m canvas size. And the computation kicks in all the time again ;).
I totally agree that an UI is always a balance of compromises, and I know it's all my OCD in defining the exact measures to the cm, but some way of numerical editing (right click or whatever) would be so much easier and more exact. And for positioning the subs there is the numerical option and there are even sliders on top. These take up so much space, that anything below sliders of Sub 5 (including Room Properties and Listener Position) cannot be adjusted while looking at the heat map on my screen, thereby . [I was trying to check whether my room (slightly non-rectangular) might work with a double bass array.]

I get some funny results in the heat map. I don't know whether that happens from Javascript corruption after playing around or from calculation errors in the code.
Here is an example (but I have seen other weird results) with 4 subs with identical settings in the front of the room. At 255Hz a flat mode is just not possible even less with 24dB all over the room. It does not conform with the FR graph either which looks reasonable.
Another thing: I moved the subs to Y= 4.30m by hand. If I change with the slider or numerically the position jumps to 4.00m and can be brought to 4.30m only by hand again.
funny result.png
 
It's INCREDIBLE. Lately I've been testing sub positions, since I recently moved and it's hella accurate.
The UI is great, fast and intuitive. I've tried other tools before but discarded them because they were tedious, clunky and a bit too complex for my taste.

Thank you very much for sharing your excellent work.
 
My room is a bit under 5m, so a 10m canvas is already mighty big. And with the draw option it is actually not easy to draw a rectangle as the coordinates are not shown, only the length of the edge. And even with the coordinates shown (editing after the initial drawing) it is a challenge to hit the right number with my trackpad in 10m canvas size. And the computation kicks in all the time again ;).
I totally agree that an UI is always a balance of compromises, and I know it's all my OCD in defining the exact measures to the cm, but some way of numerical editing (right click or whatever) would be so much easier and more exact. And for positioning the subs there is the numerical option and there are even sliders on top. These take up so much space, that anything below sliders of Sub 5 (including Room Properties and Listener Position) cannot be adjusted while looking at the heat map on my screen, thereby . [I was trying to check whether my room (slightly non-rectangular) might work with a double bass array.]

I get some funny results in the heat map. I don't know whether that happens from Javascript corruption after playing around or from calculation errors in the code.
Here is an example (but I have seen other weird results) with 4 subs with identical settings in the front of the room. At 255Hz a flat mode is just not possible even less with 24dB all over the room. It does not conform with the FR graph either which looks reasonable.
Another thing: I moved the subs to Y= 4.30m by hand. If I change with the slider or numerically the position jumps to 4.00m and can be brought to 4.30m only by hand again.
View attachment 512005
Thanks for the feedback. Very useful!

The corruption you see is due to the precision of the calculations. There is a tradeoff between room size, upper frequency, and processing time. I've now made the precision adaptive and, by default, doubled the max precision. The system now caps to the upper reliable frequency limit. There is also a new double-precision button at the very bottom. This effectively doubles the reliable frequency range but also increases calculation time in large rooms.

I also added a compute toggle in the Room Plan. This disables computing so you can change the room shape without autotriggering the compute with every move.

There is now numerical input of all elements in the Room Plan top bar.

Made the left side much more compact. Removed the listener x,y, and removed the coordinates of speakers.
 
There is now numerical input of all elements in the Room Plan top bar.

Made the left side much more compact. Removed the listener x,y, and removed the coordinates of speakers.
Awesome, I love what you did. This is working great now. Thank you a lot!
The problem with the pressure map is gone. I don’t know whether you changed some code or my computer was having an overflow or something, but all seems good now.
I found the reason for the pressure map level mismatch (red all over the area). Obviously the pressure map is not normalised the way the FR graph is. Changing the number of subs or the the level of a single sub will increase the level in the pressure map. So with multiple subs the pressure map becomes more and more reddish, basically because the pressure exceeds the limit in large areas. (I can counter that by reducing the gain of each sub, but that is a bit tedious.)

I actually see this as a feature, this way I could explore what are the cost of inverted and delayed back subs in the DBA. The automatic normalisation of the FR graph hides that.

The problem is that details of the pressure distribution get lost.

One way to deal with that would be to normalise the pressure map too, but I would much prefer to keep the ”absolute“ levels.
EDIT: A reasonable definition of "0dB" could be the anechoic SPL of a single sub with 0dB gain in 1m distance.

A scaling (slider?) of the pressure color scheme would keep the „right“ levels and provide all the flexibility for “seeing“ the pressure details.
To get pressure map and FR graph to be consistent one could use the pressure values from the pressure map and (automatically) shift the scale instead of normalising to the averaged SPL.

About the left column. Big improvement, much more efficient use of space.
Still I cannot edit gain and delay of Sub6 and look at the heat map at the same time but it is so much better.
A scrolling function that rolls up the left column even more than now would help (now it stops when left and right columns are flush at the bottom).
You might think about placing the label of a slider left of it (like with the frequency slider in the heat map frame) and use only a single line this way.
And I would place the more general parameters (Listener and Room Properties) on top as these will probably be changed interactively more often.
The value of ”Listening Height” in the left frame is not connected to the respective value in the Room Plan when ”Listener“ is activated. But both options can change the (active) value.


Frequency Range options

Pressure Map slider

FR-graph axis

Chrome

Min value only down to 20Hz

Max value is ok

OK

Safari (macOS)

Min value only down to 20Hz

Max value only up to 376Hz

Min value ok,

Max value above 376Hz is cut off
Safari (iOS)Min value only down to 20Hz

OK
OK

Did I mention that 8 subs would be great to have to simulate a crazy overkill DBA? ;-)
Even better would be to have 10 subs to investigate the superposition of subs (DBA) and mains in the crossover region.
Considering the amount of questions about sub integration a crossover option would bring this tool in a class of itself.
Once the geometry is solved the interactivity of sub/speaker/listener configuration and placement seems not to be particularly resource demanding.

And you certainly don't want to fall behind REW in features, would you?
EDIT:
I tried a simple and symmetric room 2x2x5m with one sub in the center of one small wall (2x2), listener is at half room height of 1m (I suppose the pressure map is calculated at listener height?).
Here is the screen shot with map for 94Hz and max of Frequency range 500Hz (see below).
screen.png

Surprisingly the map is not symmetrical. I somehow doubt this is due to rounding errors as I switched to double precision.
But that is the very small effect.
Something funny happens when calculating the pressure with different values for the frequency range.
For example:
Max of frequency range set to 300 Hz, map for 94Hz
room-plan_94Hz.png

Max of frequency range set to 100Hz, map for 94Hz
room-plan_94Hz (1).png

This is more than significant.
At the same time the FR graph seems to be changed only a small bit.

And there is more.
When adding a vertex on a room plan without changing the geometry the map sometimes changes significantly after computation. Max of frequency range 300Hz, pressure map for 94Hz, right with additional vertex on the top wall.
room-plan_94Hz (2).png
room-plan_94Hz (3).png


The latter effect changes the FR graph a bit too.
 
Last edited:
Back
Top Bottom