Any2HRTF / Mesh2HRTF

Open software for the numerical calculation of head-related transfer functions
European Union Public License 1.2
111 stars 14 forks source link

Isolated node when using multiple sphere evaluation grid #72

Closed terrainer closed 1 year ago

terrainer commented 1 year ago

Trying to run numcalc on multiple sphere evaluation grids generated by the Mesh2HRTF script seems to create isolated node errors. Specifically trying to use greater_circle_5_5_x4 from https://sourceforge.net/p/mesh2hrtf-tools/code/ci/master/tree/extra_Evaluation_Grids/

I can confirm that it's the evaluation grid, as there are no errors using Default or ARI.

terrainer commented 1 year ago

Also should note that running the manage numcalc script returns: image And then when run a second time: image-1

f-brinkmann commented 1 year ago

That issue should be posted at https://sourceforge.net/projects/mesh2hrtf-tools/ first. It would be relevant for Mesh2HRTF if the grid was generated with write_evaluation_grid from the Mesh2HRTF API (https://github.com/Any2HRTF/Mesh2HRTF/wiki/Mesh2HRTF_API). If that is the case, the parameters for generating the grid would be good to have

SDX-LV commented 1 year ago

Hi, yes of course, the grid is made with 4 pyfar samplings sent in one command through write_evaluation_grid from the Mesh2HRTF API.

The script with all parameters: https://sourceforge.net/p/mesh2hrtf-tools/code/ci/master/tree/extra_Evaluation_Grids/generate_mesh2hrtf_evaluation_grid.py

The grid files, including a plot and human readable coordinates: https://sourceforge.net/p/mesh2hrtf-tools/code/ci/master/tree/extra_Evaluation_Grids/greater_circle_5_5_x4/

It is similar to https://github.com/Any2HRTF/Mesh2HRTF/blob/develop/mesh2hrtf/Mesh2Input/EvaluationGrids/Data/PlaneFrontal/EvaluationGrid.pdf, but in 3D, instead of planar evaluation grid.

I made this due to requests from people who are exploring distance-dependent binaural audio. Variable distance is quite straightforward in AR/VR/game audio, so Mesh2HRTF seems like a perfect tool to get a SOFA with complex multi-field evaluation grids. For example it can be tested using OpenAL-Soft.

f-brinkmann commented 1 year ago

Ah ok, I see. Did you ever successfully the grid? I think Mesh2HRTF can only handle grids where all nodes part of a face. The error sounds like that is note the case. This would be my suggestions:

For now, I will

SDX-LV commented 1 year ago

OK, fair solution.

I just updated the extra grids to instead generate individual grids for each radius: https://sourceforge.net/p/mesh2hrtf-tools/code/ci/master/tree/extra_Evaluation_Grids/

Now the question remains to make a script to merge individual evaluation grids into a single SOFA file that is "correct". I wonder if SOFA conventions discuss how to specify multiple radiuses for the same azimuth and elevation?

terrainer commented 1 year ago

Perhaps it is possible to find a shape that can be used for multiple radii, while still being one continuous model? The Blender evaluation grid export script isn't working for me either, so I can't experiment.

f-brinkmann commented 1 year ago

Now the question remains to make a script to merge individual evaluation grids into a single SOFA file that is "correct". I wonder if SOFA conventions discuss how to specify multiple radiuses for the same azimuth and elevation?

SOFA does not restrict the order in which the data is saved. If you find a clean solution, you could try to extend merge_sofa_files It currently expects a tuple of two folders in which SOFA files are searched. It could also get a tuple of N path to SOFA files (not folders containing SOFA files) to be merged. Should be possible, but I don't have time until the end of the semester in about a month. If you want to try I could give some ideas...

The Blender evaluation grid export script isn't working for me either, so I can't experiment.

Could you open an issue for that? The script is pretty old and I never tested it. If it does not work any more, we should exclude it from the upcoming 1.0.0 release.

petibub commented 1 year ago

Now the question remains to make a script to merge individual evaluation grids into a single SOFA file that is "correct". I wonder if SOFA conventions discuss how to specify multiple radiuses for the same azimuth and elevation?

In SOFA, every HRTF position is encoded by the 3D coordinate. So, any 3D point cloud of HRTF positions can be encoded within a single file. For an example of a SOFA file storing HRTFs for multiple radii, see SCUT_KEMAR_radius_all.sofa from the SCUT database.