Latent Granular Resynthesis using Neural Audio Codecs

2025

Read Latent Granular Resynthesis using Neural Audio Codecs (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-19202.txt.

Introduction

Nao Tokui and Tom Baker remix sound inside the hidden codes of neural audio models in a 2025 paper. Classic granular synthesis chops audio into tiny grains and replays them in new orders, but the cuts leave clicks and seams.

Their method works one level up. A source recording is encoded into short code segments, forming a grain library. Each grain of a target sound is then swapped for its closest match from that library. Decoding the hybrid keeps the target's timing and shape while borrowing the source's tone. No training is needed, and the decoder smooths over the joins that plague older methods. A public demo lets users try their own sounds.

Catalog record

YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE9 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-19202

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Latent Granular Resynthesis using Neural Audio Codecs


Abstract
We introduce a novel technique for creative audio resynthesis that operates by reworking the concept of granular synthesis at the latent vector level. Our approach creates a "granular codebook" by encoding a source audio corpus into latent vector segments, then matches each latent grain of a target audio signal to its closest counterpart in the codebook. The resulting hybrid sequence is decoded to produce audio that preserves the target’s temporal structure while adopting the source’s timbral characteristics. This technique requires no model training, works with diverse audio materials, and naturally avoids the discontinuities typical of traditional concatenative synthesis through the codec’s implicit interpolation during decoding. We include supplementary material 1 1 1 github.com/naotokui/latentgranular/ , as well as a proof-of-concept implementation to allow users to experiment with their own sounds. 2 2 2 huggingface.co/spaces/naotokui/latentgranular/



Figure 1
:
A process overview. A source audio corpus is encoded to create a codebook of latent vectors. A target audio is encoded, and for each of its vectors, the closest match from the codebook is found to create a new latent sequence, which is then decoded to create the output audio.

1
Background

Classical granular synthesis
[
1
]
, pioneered in the 1970s, operates by decomposing audio into small fragments or "grains" (typically 1-100ms) which can then be manipulated and recombined to create new textures. Concatenative synthesis (musical mosaicing)
[
2
]
extends this concept to longer segments, focusing on intelligent selection and concatenation of audio units based on acoustic similarity. While these classical techniques have proven valuable for timbre matching and creative sound design, they often suffer from audible discontinuities at grain boundaries due to the discrete nature of audio concatenation.

Recent machine learning approaches have developed upon the foundations of these classical techniques. Autoencoder (AE) based timbre transfer techniques
[
3
,
4
]
offer compelling approaches to generating hybrid sounds by transferring timbral characteristics from one audio source onto another’s structure. Similarly, Bitton et al.’s Neural Granular Synthesis
[
5
]
trains a Variational Autoencoder (VAE) on sound corpora and instead uses granular latent space sampling to generate novel outputs. However, these training-based methods require substantial time and datasets for each corpus, limiting accessibility, and immediate experimentation. Alternatively, "The Concatenator"
[
6
]
optimises the concatenative synthesis approach using Bayesian inference with particle filtering for real-time corpus window selection, but still maintains the characteristic granular sound of waveform-domain concatenation.

Neural audio codecs have emerged as powerful tools for high-fidelity audio compression and generation, often employing AE architectures with Residual Vector Quantization (RVQ) to encode audio into compact latent representations while preserving perceptual quality
[
7
,
8
,
9
]
. Originally designed for efficient audio encoding, adaptations of these codec models have found themselves utilised within latent diffusion models, such as Stable Audio’s proprietary VAE
[
10
,
11
,
12
]
and Diff-a-Riff’s Consistency Autoencoder (CAE) Music2Latent
[
13
,
14
,
15
,
16
]
. The resulting latent vectors from these pre-trained models provide a far more tractable and computationally efficient medium for audio generation and manipulation compared to raw waveforms.

2
Methodology

Our method, illustrated in figure
1
, addresses the key limitations of existing approaches by leveraging the compact representations of pre-trained neural audio codecs to create a training-free latent granular framework. By operating in the latent space of these codecs, we eliminate the need for corpus-specific model training while gaining access to high-quality audio representations that naturally interpolate during decoding. This approach combines the modularity and creative flexibility of classical granular/concatenative synthesis with the seamless audio quality achievable through neural compression, enabling immediate experimentation with any source material.

The method consists of three main stages: codebook generation from source audio, target matching through latent similarity, and reconstruction via decoding.

2.1
Codebook Generation

Our approach begins by creating a granular codebook from a source audio corpus through systematic encoding and segmentation. We encode the entire corpus using a pre-trained codec model, then segment the resulting latent representations into "grains" - collections of neighbouring latent vectors that form the basic units of our codebook.

The segmentation process offers two key parameters for creative control.
Grain size
determines how many consecutive latent vectors form each grain (typically 1-5), with the optimal length depending on the source material and desired effect: percussive sounds benefit from smaller grains to capture transient details, while harmonic sounds work better with larger, more consistent windows.
Stride
controls the overlap between consecutive grains - smaller strides provide greater coverage through overlapping segments, while larger strides force more diversity between grains.

The codebook generation process can accommodate diverse source materials, from single instruments to multi-instrumental compositions and non-musical sounds. Multiple codebooks can be created and combined later for modular sound design approaches, allowing artists to blend characteristics from different sources or create layered timbral palettes.

To expand codebook coverage, we can augment the source data by applying audio effects such as pitch shifting, time stretching, or gain before encoding, effectively broadening the codebook’s representation of pitch and timbral space. This augmentation strategy is particularly valuable when working with more limited source material, as it can generate variants that fill gaps in the timbral space.

2.2
Target Matching

For any given target audio signal, we apply the same encoding and segmentation process, ensuring we mirror the grains size of the codebook. Each target grain is then matched against the source codebook using cosine similarity as our distance metric.

The sampling strategy for selecting codebook vectors provides key creative control. We sample based on a softmax over negative cosine distances, controlled by a temperature parameter
\tau
:

P(\text{select }B_{i})=\frac{\exp(-D_{\cos}(A,B_{i})/\tau)}{\sum_{j}\exp(-D_{\cos}(A,B_{j})/\tau)}

where
D_{\cos}(A,B_{i})
represents the cosine distance between target grain
A
and codebook grain
B_{i}
. Lower temperatures provide more faithful timbral matches while closely preserving target structure, whereas higher temperatures introduce randomness and diversity.

Similar to codebook generation, audio effects can be applied to the target signal before encoding to influence the selection process. For example, formant shifting the target can alter which grains are selected from the codebook, creating different timbral mappings while maintaining the target’s temporal structure.

We are also exploring alternative matching strategies, such as training a lightweight MLP to extract high-level features from the latent such as pitch, loudness, and timbral descriptors. This approach could enable more nuanced control over which aspects of the source material influence the matching process.

2.3
Reconstruction

The final step involves concatenating the selected grain sequence and passing it through the neural audio codec’s decoder to generate continuous audio output. This final upsampling performed by the codecs decoder implicitly interpolates between the grains, ensuring a consistent quality of audio output.

2.3.1
Realtime Capabilities

Note that the entire grain matching process is completely non-autoregressive. Therefore with an appropriate fast, causal neural audio codec, this whole process can be completely streamable, with latency determined by the codec’s inference itself and the grain size.

3
Conclusion

We have presented a novel technique that leverages neural audio codecs for creative granular resynthesis, enabling high fidelity, versatile, no-training timbre transfer. By operating in the latent space of pre-trained codecs, our approach achieves smooth timbral blending while preserving the structural characteristics of target audio signals.

Read the complete text