﻿# MusicGen Melody audio input: chroma conditioning is different from continuation

Distinguish melody-conditioned MusicGen generation from audio continuation, and preserve reference preparation, chroma extraction, and output evaluation accordingly.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-musicgen-melody-chroma-not-continuation/
Language: en

## Define what reference audio is supposed to do

The [MusicGen research paper](https://arxiv.org/abs/2306.05284) includes generation conditioned on melodic features as well as text descriptions. For a product interface, an upload field alone does not explain whether the file supplies a melody, a prefix to continue, or another kind of conditioning. Define this intent before validating output. Otherwise a correct melody-conditioned result can be rejected simply because a reviewer expected the original recording to remain at the start.

## Read the explicit continuation distinction

The [MusicGen Melody documentation](https://huggingface.co/docs/transformers/model_doc/musicgen_melody) distinguishes its audio conditioning signal from the audio-continuation role in the ordinary MusicGen route. It describes chroma features extracted from reference audio. Those features do not preserve every property of the source waveform. Consequently, reference timbre, noise, and exact sample-level timing should not be treated as guaranteed copied content merely because an input recording participates in the generation request.

## Make reference preparation reproducible

The documented preparation can use source-separated audio or a raw waveform for chroma extraction. These paths can produce different conditioning evidence. The [official AudioCraft guide](https://github.com/facebookresearch/audiocraft/blob/main/docs/MUSICGEN.md) demonstrates melody-conditioned generation through its chroma-aware interface. Preserve which preparation route was used, actual sampling rate, selected source segment, and text description. An upstream separation step is a model operation of its own, not a hidden lossless conversion that can be ignored in a comparison.

## Test musical guidance rather than prefix retention

Consider using a short keyboard reference to guide a differently instrumented result. Review melodic correspondence independently from the requested instrumentation and overall audio quality. Do not require an identical waveform prefix unless continuation was the selected operation. Conversely, a pleasing track that ignores the reference is not evidence that melodic conditioning works. Compare against a text-only condition and inspect the prepared chroma representation when the reference appears to have no influence.

## Keep the route visible in result records

Store the model variant, reference preparation, chroma-extraction configuration, description, random settings, codec, and output duration. Guides to [audio codec representations](/journal/audio-codec-token-generation/) and [inference comparison](/journal/inference-benchmark-method/) provide supporting concepts. Use separate result labels for continuation and melody-conditioned generation. This avoids converting a meaningful architectural distinction into a misleading single feature called audio prompt, whose expected relationship to the output cannot be assessed consistently.
