Skip to content

Installation

Fabian Brinkmann edited this page Jul 1, 2024 · 11 revisions

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.

Blender Export

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 line default=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 press Install add-on.

  • Tick the checkbox to enable the add-on installation_exportmesh2hrtf_03

  • If you go to File -> Export you should now see an option Mesh2HRTF

NumCalc

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 folder mesh2hrtf/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).

Output2HRTF

The Mesh2HRTF API is required for processing and inspecting HRTFs.

Using mesh2HRTF with Python

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

Using mesh2HRTF with Matlab

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

Using Mesh2HRTF with Docker

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.

For developers

If you want to develop or test mesh2HRTF you will find more information in the contributing guidelines