Lyria music generation prompt guide

This guide shows you how to write effective text prompts for music generation with Lyria. It covers the following topics:

Prompt guide overview

Lyria is a foundation model for high-quality audio generation, capable of creating diverse soundscapes and musical pieces from text prompts. To use Lyria, you provide a prompt, which is a text description of the music you want to generate. Lyria produces instrumental music.

Safety filters

Lyria applies safety filters to help prevent the generation of audio that contains offensive content or violates usage guidelines. For example, prompts that violate responsible AI guidelines are blocked. Lyria also includes recitation checking and artist intent checks.

If you suspect abuse of Lyria or any generated output that contains inappropriate material or inaccurate information, use the Report suspected abuse on Google Cloud form.

Basics for writing prompts

Good prompts are descriptive and clear. To generate music that aligns with your vision, start by identifying your core musical idea. You can then refine your prompt by adding keywords and modifiers.

Consider the following elements for your prompt:

  • Genre & Style: The primary musical category (for example, electronic dance, classical, jazz, ambient) and stylistic characteristics (for example, 8-bit, cinematic, lo-fi).
  • Mood & Emotion: The desired feeling the music should evoke (for example, energetic, melancholy, peaceful, tense).
  • Instrumentation: Key instruments you want to hear (for example, piano, synthesizer, acoustic guitar, string orchestra, electronic drums).
  • Tempo & Rhythm: The pace (for example, fast tempo, slow ballad, 120 BPM) and rhythmic character (for example, driving beat, syncopated rhythm, gentle waltz).
  • Arrangement/Structure (Optional): How the music progresses or layers (for example, starts with a solo piano, then strings enter, crescendo into a powerful chorus).
  • Soundscape/Ambiance (Optional): Background sounds or overall sonic environment (for example, rain falling, city nightlife, spacious reverb, underwater feel).
  • Production Quality (Optional): Desired audio fidelity or recording style (for example, high-quality production, clean mix, vintage recording, raw demo feel).

Examples of prompts and generated output

This section provides examples of prompts and shows how the level of detail can affect the generated music.

Energetic electronic track

This example demonstrates using several elements in your prompt.

Prompt Generated output
An energetic (mood) electronic dance track (genre) with a fast tempo (tempo) and a driving beat (rhythm), featuring prominent synthesizers (instrumentation) and electronic drums (instrumentation). High-quality production (production quality).

Description: A 30-second instrumental track with a clear, punchy electronic sound, upbeat rhythm, and a focus on synth melodies and a strong drum presence.

Evolving ambient soundscape

These examples demonstrate how to revise your prompt for more specific results.

Prompt Generated output Analysis
Ambient music with synthesizers.

Description: A basic ambient piece primarily using synth pads. The mood and structure are very general.

This is the first generated audio based on a minimal prompt.
A calm and dreamy (mood) ambient soundscape (genre/style) featuring layered synthesizers (instrumentation) and soft, evolving pads (instrumentation/arrangement). Slow tempo (tempo) with a spacious reverb (ambiance/production). Starts with a simple synth melody, then adds layers of atmospheric pads (arrangement).

Description: A more developed ambient track. The audio evokes a peaceful, dreamy state with clear synth layers building slowly. The spacious reverb enhances the atmospheric quality.

A more detailed prompt results in music that is more focused, with a richer sonic environment and clear progression.

More tips for writing prompts

The following tips help you write effective prompts for Lyria:

  • Be descriptive and specific: Use adjectives and adverbs to paint a clear sonic picture. The more detail, the better Lyria can understand your intent.
  • Reference genres, moods, and styles: Clearly state the musical category, desired feeling, and any stylistic characteristics.
  • Specify key instruments and rhythms: Mention important instruments and describe the desired pace and rhythmic feel.
  • Iterate and experiment: If the first result isn't perfect, modify your prompt by adding, removing, or changing keywords. See Introduction to prompting for general strategies.

Add more details to prompts

These examples show how to refine prompts by focusing on specific musical elements.

Genre & style

Element Focus Prompt Generated output
Genre and Style A cinematic orchestral piece in a heroic, fantasy adventure style, with a grand, sweeping melody.

Description: Expect a full-sounding orchestral track with dramatic swells and a strong, memorable theme, reminiscent of a film score.

Mood & Instrumentation

Element Focus Prompt Generated output
Mood and Instrumentation A peaceful and serene acoustic guitar piece, featuring a fingerpicked style, perfect for meditation.

Description: A gentle, calming instrumental track featuring a solo acoustic guitar playing a simple, soothing melody.

Tempo & Rhythm

Element Focus Prompt Generated output
Tempo and Rhythm A tense, suspenseful underscore with a very slow, creeping tempo and a sparse, irregular rhythm. Primarily uses low strings and subtle percussion.

Description: An atmospheric piece designed to build tension, characterized by its slow pace, unsettling rhythmic elements, and dark string textures.

Negative prompts

Negative prompts help specify elements to exclude from the music. Describe what you want to discourage the model from generating.

  • The API parameter is negative_prompt.
  • List elements to exclude, e.g., negative_prompt: "vocals, excessive cymbal crashes, distorted guitar".
Prompt Scenario Generated output
Prompt: "A calm, relaxing piano piece for studying."

(Without negative prompt)

Description: The piano piece is generally calm, but might include some unexpected louder dynamics or complex runs that could be distracting for study.

Prompt: "A calm, relaxing piano piece for studying."
Negative Prompt: "complex melodies, loud dynamics, sudden changes, drums, vocals"

Description: The resulting piano piece is consistently calm and simple, avoiding distracting elements. The mood is more even and suitable for background focus.