-
Notifications
You must be signed in to change notification settings - Fork 16
Installation
Download the latest version of Mesh2HRTF from the release section, or clone the git repository with the command
git clone --recursive https://github.com/Any2HRTF/Mesh2HRTF.git
.
Note: The following instructions cover Unix based operating systems. Most tools can be used under MacOS and Windows as well. However, we do not test nor support Mesh2HRTF for MacOS and Windows.
These steps are required to export Mesh2HRTF projects from Blender.
Install Blender (version 2.80 or newer)
-
Open the file path/to/your/Mesh2HRTF/mesh2hrtf/Mesh2Input/mesh2input.py in any text editor.
-
Change the default value of the variable
programPath
to the absolute path of the mesh2hrtf folder by changing the linedefault=r"/path/to/mesh2hrtf",
. The folder that you enter should contain the sub-folders Mesh2Input, NumCalc, and Output2HRTF -
Open Blender, and go to
Edit -> Preferences -> Add-ons
in the menu. -
Press
Install...
, navigate to path/to/your/Mesh2HRTF/mesh2hrtf/Mesh2Input/mesh2input.py and pressInstall add-on
. -
Tick the checkbox to enable the add-on
-
If you go to
File -> Export
you should now see an optionMesh2HRTF
These steps are required to numerically simulate HRTFs with NumCalc and are executed in the terminal.
- Install the C++ build essentials by running
sudo apt-get install build-essential
- Go into the NumCalc directory by running
cd path/to/your/Mesh2HRTF/mesh2hrtf/NumCalc/src
- Compile NumCalc by running
make
. It is now located in the foldermesh2hrtf/NumCalc/bin
- Copy NumCalc to a folder in your program path: in the same directory run
sudo cp NumCalc /usr/local/bin/
- Now NumCalc can be used by running
NumCalc
(don't do this yet).
The Mesh2HRTF API is required for processing and inspecting HRTFs.
The Python API needs to installed in the terminal, before it can be used.
Environment
It is recommended to create an environment for mesh2hrtf. This can for example be done with conda or Anaconda in a terminal or the Anaconda Prompt.
conda create --name mesh2hrtf python
conda activate mesh2hrtf
Install mesh2hrtf package
To make mesh2HRTF available in Python, go to your mesh2HRTF directory (the one containing setup.py) by running
cd your/path/to/mesh2hrtf-git
Then install mesh2HRTF using pip
pip install -e .
Note that the -e
option will make changes in mesh2HRTF immediately available. This is helpful if you adapt parts of the code to your needs. If you do not want this, omit this option.
You can now use mesh2HRTF by importing it in your Python code, e.g.
import mesh2hrtf as m2h
These steps are required to save HRTFs as SOFA files using Matlab.
Requirements: Octave or Matlab, SOFA-API
- Add the folder path/to/your/Mesh2HRTF/mesh2hrtf and all sub-folders to your Matlab path
- Downlaod and add the SOFA Matlab API (or get the source code from Github to have the latest version) to your Matlab path by running
SOFAstart.m
- (Note: you perhaps need a workaround to permanently add the folders to the MATLAB search path. Mine was replacing the pathdef.m file in /usr/local/MATLAB/R2020b/toolbox/local.)
We provide a Docker Image in case you want to use Mesh2HRTF as a containerized app. If you want to modify the container, check out the Dockerfile.
If you want to develop or test mesh2HRTF you will find more information in the contributing guidelines