A demo application that processes audio files using slimmable Neural Amp Models (NAMs). This demo integrates NeuralAmpModelerCore with SlimmableNamDsp to allow runtime adjustment of model complexity.
- Load and process WAV audio files (mono, 24-bit, 48kHz)
- Load slimmable NAM model files (.nam)
- Automatically detects all available slimmable sizes
- Processes audio with each available size
- Saves separate output files for each size (e.g.,
output-1.wav,output-2.wav, ...)
- CMake 3.15 or higher
- C++17 compatible compiler
- Eigen3 library
- libsndfile library
brew install eigen libsndfile cmakesudo apt-get install libeigen3-dev libsndfile1-dev cmake build-essentialvcpkg install eigen3 libsndfileClone the repository (including submodules):
git clone --recursive <repository-url>Or if you've already cloned:
git submodule update --init --recursiveBuild the project:
./build.shRun with default files:
./build/slimmable-demoThis will process data/pop-punk.wav with data/slimmable-model.nam and create output/output-1.wav, output/output-2.wav, etc.
Using the build script (recommended):
./build.shManual build:
# Make sure submodules are initialized
git submodule update --init --recursive
mkdir build
cd build
cmake ..
makeWindows with Visual Studio:
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config Release./slimmable-demo [input.wav] [model.nam] [output_prefix]input.wav- Input audio file (WAV format, must be mono, 24-bit, 48kHz)- Default:
data/pop-punk.wav
- Default:
model.nam- Slimmable NAM model file (must be a slimmable model)- Default:
data/slimmable-model.nam
- Default:
output_prefix- Prefix for output files- Default:
output
- Default:
- Input: Must be mono (1 channel), 24-bit, 48kHz WAV file
- Output: Always saved as mono, 24-bit, 48kHz WAV file
- The application will reject input files that don't meet these requirements
- The application requires a slimmable NAM model (non-slimmable models will be rejected)
The application processes the audio with all available slimmable sizes and creates separate output files in the output/ directory:
output/output-1.wav- Processed with size 1 (smallest/fastest)output/output-2.wav- Processed with size 2output/output-3.wav- Processed with size 3- ...
output/output-N.wav- Processed with size N (largest/best quality)
The output/ directory is created automatically if it doesn't exist.
Run with defaults:
./build/slimmable-demoThis uses data/pop-punk.wav, data/slimmable-model.nam, and creates output/output-*.wav files.
Specify custom files:
./build/slimmable-demo input.wav my_model.nam outputThis will:
- Load
input.wav - Load
my_model.namas a slimmable model - Detect all available slimmable sizes
- Process the audio with each available size
- Save results to
output/output-1.wav,output/output-2.wav,output/output-3.wav, etc.