Lyria music generation prompt guide

This guide provides examples of the types of music and audio soundscapes that you can create using Lyria and shows you how to modify specific parts of a prompt to produce different results.

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 must provide a prompt which is a text description of what you want your generative AI model to generate. Lyria produces instrumental music.

Safety filters

Lyria applies safety filters across Vertex AI to help ensure that generated audio doesn't contain offensive content or violate 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 get your generated music closer to what you want, start with identifying your core musical idea and then refine your idea by adding keywords and modifiers.

The following elements should be considered for your prompt:

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

Examples of prompts and generated output

This section presents prompts and how the level of detail can affect the 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 revising 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.