Building from Source
PitchNet is built with CMake. You need CMake 3.22+, a C++17 compiler and Git.
| Platform | Requirements |
|---|---|
| Windows | Visual Studio 2019+ with the C++ workload, Windows SDK |
| macOS | Xcode and the command line tools |
| Linux | GCC or Clang, ALSA development libraries |
git clone https://github.com/SessionLoops/PitchNet.git
cd PitchNet
git submodule update --init --recursive
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
On macOS you can also generate an Xcode project with cmake -B build-xcode -G Xcode and run the PitchNet scheme.
Options
| Flag | Effect |
|---|---|
-DUSE_CUDA=ON | CUDA execution provider (Windows) |
-DUSE_DIRECTML=ON | DirectML execution provider (Windows) |
-DUSE_ASIO=ON | ASIO audio (Windows) |
-DONNXRUNTIME_VERSION=… | Override the ONNX Runtime version (downloaded during configure) |
AAX_SDK_PATH | Builds AAX when set to a valid AAX SDK |
CUDA and DirectML cannot be enabled together. ARA is enabled when the third_party/ARA_SDK submodule is present.
Models
The build expects these files in Resources/models and stops if one is missing:
swift_f0.onnx, pc_nsf_hifigan.onnx (on macOS pc_nsf_hifigan.mlmodelc, the CoreML build, from the repository's
models release), the GAME/ folder (downloaded by CMake when missing), cent_table.bin and mel_filterbank.bin.
The optional basic_pitch_nmp.onnx and yamnet.onnx are downloaded by CMake when missing.
fcpe.onnx and rmvpe.onnx are not in the repository and not needed: FCPE and RMVPE are alternative pitch detectors
that only debug builds can select. Release builds always use SwiftF0.