The Patchbay_

Train Your Own RAVE Model

RAVE learns the timbre of a sound corpus and lets you play through it in real time. Dataset preparation, every training config, the export flag everyone forgets, and what to do with the latent once you have it.

Last updated 2026-09-12

RAVE is not a text-to-music model, and that is the point. It is a variational autoencoder from IRCAM that learns the timbre of a sound corpus — a violin, a voice, a room full of percussion, your own modular rig — and then lets you play through it in real time, inside Max/MSP or Pure Data, at low enough latency to perform with.

You feed it audio, it re-synthesises that audio in the voice of whatever it was trained on. Sing into a model trained on darbouka and you get drums that follow your phrasing. That is a fundamentally different creative proposition from prompting for a finished track, and it is the reason RAVE has quietly become a fixture in live electronic performance.

How RAVE works, and why latency is the whole story

RAVE is an autoencoder: an encoder compresses audio into a small latent representation, a decoder reconstructs audio from it. Training makes that round trip faithful for one particular corpus.

Two things follow:

Everything about the workflow below exists to keep that round trip fast enough to play.

Two ways in

 Pretrained modelsTrain your own
EffortDownload and loadDays of GPU time
Audio neededNoneHours of a coherent corpus
HardwareA laptop8–32 GB VRAM depending on config
ResultSomeone else's timbreYour own instrument

Start with the pretrained streaming models from the ACIDS collection to learn the patching side. Train your own when you know what you want the latent to sound like.

There is also a RAVE VST in beta from Forum IRCAM, for Windows, Mac and Linux, if you want this in a DAW without patching anything.

Install

python -m venv .venv && source .venv/bin/activate

# torch FIRST, matched to your CUDA version — see pytorch.org
pip install torch torchaudio

pip install acids-rave

# ffmpeg is required
conda install ffmpeg        # or brew install ffmpeg / apt-get install ffmpeg
Install torch first. The project is explicit about this — pick the build that matches your CUDA version from pytorch.org before installing acids-rave. Recent versions no longer pin torch==1.13, so modern Python environments work, but letting pip resolve torch for you is still how installs go wrong.

Using a pretrained model offline

Before touching Max, hear what the model does to your audio. The batch script processes files or whole directories:

rave generate /path/to/model.ts input_folder/ another_file.wav --out out_path/

This is also the fastest way to audition several models against the same source material and decide which one is worth building a patch around.

Training your own: dataset preparation

Three steps — preprocess, train, export. The first one decides most of your result.

rave preprocess --input_path /audio/folder \
                --output_path /dataset/path \
                --channels 1

# large corpus of compressed files you cannot afford to expand
rave preprocess --input_path /audio/folder \
                --output_path /dataset/path \
                --channels 1 --lazy
FlagDefaultWhat it does
--input_pathrequiredDirectory of audio. Can be given more than once
--output_pathrequiredWhere the prepared dataset goes
--channels11 for mono, 2 for stereo. Must match what you pass to train
--sampling_rate44100Training sample rate
--num_signal131072Samples per training example — about 3 s at 44.1 kHz. Lower it for short source files
--lazyoffTrain directly on mp3/ogg without converting. Saves enormous disk, costs a lot of CPU during training — badly on Windows
--max_db_size100Dataset cap in GB
--extaif, aiff, wav, opus, mp3, aac, flac, oggExtensions to search for

What to feed it matters more than any flag. RAVE learns one coherent timbre; it does not learn variety. A few hours of solo cello gives a usable cello model. A few hours of "assorted music" gives mush. The rules of thumb that hold up:

Training

rave train --config v2 \
           --db_path /dataset/path \
           --out_path /model/out \
           --name my_instrument \
           --channels 1
FlagDefaultWhat it does
--configv2Architecture. Repeatable — configs combine
--db_pathrequiredThe preprocessed dataset
--out_pathrequiredWhere checkpoints and logs go
--namerequiredRun name
--channels0Must match preprocessing
--batch8Lower it if you run out of VRAM
--max_steps6000000Effectively "until you stop it" — see below
--val_every10000Checkpoint interval
--save_every500000Keep a numbered checkpoint this often
--n_signal131072Samples per example. Match preprocessing
--ckptnoneResume from a checkpoint
--gpuautoWhich GPU(s)
--augmentnoneData augmentation, repeatable

Choosing a configuration

ConfigMin GPUWhat it's for
v216 GBThe default. Faster and higher quality than v1. Start here
v2_small8 GBSmaller receptive field, noise generator — tuned for timbre transfer on stationary signals, and the practical choice on consumer GPUs
v18 GBThe original continuous model
v332 GBSnake activation, Descript discriminator, Adaptive Instance Normalization for real style transfer
discrete18 GBToken-based, like SoundStream or EnCodec. Needed if you want a prior
v2_nopqmf16 GBExperimental; more efficient for network bending
onnx6 GBNoiseless v1 for ONNX export
raspberry5 GBLightweight enough for real-time Raspberry Pi 4 inference

Configs combine, which is how you get a causal model for lower latency:

# lower latency for live playing
rave train --config v2_small --config causal \
           --db_path /dataset/path --out_path /model/out \
           --name my_instrument_live --channels 1

# discrete, causal
rave train --config discrete --config causal ...
ModifierEffect
causalCausal convolutions — lower latency, slightly lower quality. Worth it for live playing
noiseEnables the v2 noise synthesiser. Helps on breathy or noisy material
hybridMel-spectrogram input
wassersteinWasserstein objective (MMD) instead of the default ELBO — v2 only
sphericalSpherical autoencoder objective — v2 only
spectral_discriminatorEnCodec's MultiScale discriminator

Augmentation

Added in 2.3, and genuinely useful when your corpus is small:

rave train --config v2 --augment mute --augment compress --augment gain \
           --db_path /dataset/path --out_path /model/out \
           --name my_instrument --channels 1

mute randomly silences batches so the model learns silence — which matters more than it sounds, because a model that has never heard silence will hallucinate sound into your rests. compress applies light non-linear amplification, and gain a random gain in roughly [-6, 3] dB.

How long training takes

The honest answer is days. The default max_steps of six million is not a target you are expected to reach — you watch the TensorBoard logs and the audio samples, and you stop when reconstructions stop improving.

Rough expectations on a single modern GPU: something recognisable within a day, something usable in two to three, diminishing returns after that. Training is resumable with --ckpt, so stopping to listen costs you nothing.

Export — and the mistake everyone makes

rave export --run /path/to/your/run --streaming
Forget --streaming and your model will click. The flag enables cached convolutions, which is what makes the model work on a continuous real-time stream rather than isolated buffers. Without it, loading the model in Max produces clicking artefacts at every buffer boundary. This is the single most common RAVE problem, it is documented, and the fix is to re-export.
FlagDefaultWhat it does
--runrequiredThe training run to export
--streamingoffCached convolutions for real-time use. You want this
--fidelity0.95Latent fidelity for inference, 0.1–0.999 (variational mode). Lower keeps fewer latent dimensions — blurrier, more "the model's own voice"
--ema_weightsoffExport exponential-moving-average weights
--priornoneScript a trained prior alongside the model
--channels / --srfrom runOverride channel count or sample rate
--output / --namerun dirWhere the .ts file goes

The output is a TorchScript .ts file. That single file is your instrument.

Playing it: nn~ in Max/MSP and Pure Data

Load the exported model in nn~. The default method is forward — encode then decode in one object, which is the fastest path and the right default:

nn~ my_instrument forward

Splitting encode and decode into separate objects does the same thing slightly slower, but hands you the latent in between. That is the whole reason to bother:

For style transfer, recent versions add Adaptive Instance Normalization, so source and target styles can be set through nn~'s attribute system directly in the patch. Other attributes — enable, gpu — toggle computation or move it to the GPU.

Priors: let it play itself

A prior is a second model trained over the latent space, so RAVE can generate without any input audio — unconditional synthesis in the voice of your corpus.

rave train_prior --model /path/to/your/run \
                 --db_path /dataset/path \
                 --out_path /prior/out

Then script the prior alongside the model at export time:

rave train_prior --model /path/to/your/run \
                 --db_path /dataset/path \
                 --out_path /prior/out
_EXPORT

For discrete models the project points at the separate msprior library, though the v1 prior has been re-integrated in 2.3.

Troubleshooting

SymptomCause and fix
Clicking artefacts in MaxExported without --streaming. Re-export
Preprocessing stuck at 0it [00:00, ?it/s]Source files are shorter than the training window. Lower --num_signal in preprocess, and pass the matching --n_signal to train
ValueError: n_components=128 must be between 0 and min(n_samples, n_features)=64Not enough data for the internal latent PCA, which needs at least 128 batches. Add more audio
Out of memory while trainingLower --batch, or move to v2_small
Output is mushCorpus isn't coherent enough. One instrument, one setup
Reverb you can't removeBaked in from the training audio. Retrain on dry material
Latency too high to playAdd the causal config and retrain; raise your audio buffer only as a last resort
Channel-count errors at training--channels must match between preprocess and train

Licensing

RAVE is CC BY-NC 4.0 — non-commercial. That covers the implementation itself, not only released weights, which makes it more restrictive than most of this section. It is fine for research, study, and personal or artistic work; it is not a licence to build a commercial product or plugin on. If you use RAVE in a performance or installation, the authors ask that you cite the repository or the paper.

A model you train on your own audio is still produced with CC BY-NC tooling, so if money is involved, read the licence rather than assuming your training data settles the question.

Where it fits

RAVE is the odd one out in this section and the most rewarding if your interest is performance rather than production. It does not write music. It gives you an instrument with a voice nothing else has, that responds to playing in real time, and that you built from a corpus you chose.

The nearest relative is DDSP, which is more explicitly physical in its modelling and better on clean monophonic instruments; RAVE handles messier material and is built for live use. If you want generation instead of transformation, go to MusicGen or ACE-Step.

For the patching side, see Max/MSP and Pure Data; for preparing a corpus, Demucs and pedalboard.

Separate stems with DemucsBuild a clean single-instrument corpus from finished recordings.DDSPThe other approach to neural timbre transfer.Open-source AI music modelsWhere RAVE sits among the models you can run yourself.

← AI music generation hub