Skip to content

tone-3000/slimmable-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slimmable NAM Demo

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.

Features

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

Requirements

  • CMake 3.15 or higher
  • C++17 compatible compiler
  • Eigen3 library
  • libsndfile library

Installing Dependencies

macOS (using Homebrew)

brew install eigen libsndfile cmake

Ubuntu/Debian

sudo apt-get install libeigen3-dev libsndfile1-dev cmake build-essential

Windows (using vcpkg)

vcpkg install eigen3 libsndfile

Quick Start

Clone the repository (including submodules):

git clone --recursive <repository-url>

Or if you've already cloned:

git submodule update --init --recursive

Build the project:

./build.sh

Run with default files:

./build/slimmable-demo

This will process data/pop-punk.wav with data/slimmable-model.nam and create output/output-1.wav, output/output-2.wav, etc.

Building

Using the build script (recommended):

./build.sh

Manual build:

# Make sure submodules are initialized
git submodule update --init --recursive

mkdir build
cd build
cmake ..
make

Windows with Visual Studio:

mkdir build
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config Release

Usage

./slimmable-demo [input.wav] [model.nam] [output_prefix]

Arguments (all optional)

  • input.wav - Input audio file (WAV format, must be mono, 24-bit, 48kHz)
    • Default: data/pop-punk.wav
  • model.nam - Slimmable NAM model file (must be a slimmable model)
    • Default: data/slimmable-model.nam
  • output_prefix - Prefix for output files
    • Default: output

Format Requirements

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

Output Files

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 2
  • output/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.

Examples

Run with defaults:

./build/slimmable-demo

This 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 output

This will:

  1. Load input.wav
  2. Load my_model.nam as a slimmable model
  3. Detect all available slimmable sizes
  4. Process the audio with each available size
  5. Save results to output/output-1.wav, output/output-2.wav, output/output-3.wav, etc.

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors