איך יוצרים מוזיקה באמצעות Lyria 3.5

‫Lyria 3.5 היא משפחת המודלים של Google ליצירת מוזיקה, שזמינה דרך Gemini API. עם Lyria 3.5, אתם יכולים ליצור אודיו סטריאו באיכות גבוהה של 44.1 kHz מפרומפטים טקסטואליים או מתמונות. המודלים האלה מספקים קוהרנטיות מבנית, כולל שירה, מילים מתוזמנות ועיבודים מלאים לכלי נגינה.

משפחת Lyria כוללת את המודלים:

מודל מזהה דגם הכי טוב עבור משך פלט
Lyria 3 Clip lyria-3-clip-preview סרטונים קצרים, סרטונים שמופעלים בלופ, קטעים מקדימים ‫30 שניות MP3
Lyria 3.5 lyria-3.5 שירים באורך מלא עם בתים, פזמונים וגשרים כמה דקות (אפשר לשלוט בזה באמצעות הנחיה) MP3

אפשר להשתמש בשני המודלים באמצעות Interactions API החדש, שתומך בקלט רב-אופני (טקסט ותמונות) ומפיק אודיו סטריאו באיכות גבוהה של 44.1‎ kHz.

יצירת קליפ מוזיקה

מודל Lyria 3 Clip תמיד יוצר קליפ באורך 30 שניות. כדי ליצור קליפ, מפעילים את method‏ interactions.create עם פרומפט טקסטואלי. התשובה תמיד כוללת את המילים שנוצרו ואת מבנה השיר לצד האודיו בסכימה של steps.

Python

import base64
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="lyria-3-clip-preview",
    input="A short instrumental acoustic guitar piece.",
)

generated_audio = interaction.output_audio
if generated_audio:
    with open("music.mp3", "wb") as f:
        f.write(base64.b64decode(generated_audio.data))

lyrics = interaction.output_text
if lyrics:
    print(f"Lyrics:\n{lyrics}")

JavaScript

import { GoogleGenAI } from '@google/genai';
import * as fs from 'fs';

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    model: 'lyria-3-clip-preview',
    input: 'A short instrumental acoustic guitar piece.',
});

const generatedAudio = interaction.output_audio;
if (generatedAudio) {
  fs.writeFileSync('music.mp3', Buffer.from(generatedAudio.data, 'base64'));
}

const lyrics = interaction.output_text;
if (lyrics) {
  console.log(`Lyrics:\n${lyrics}`);
}

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
    "model": "lyria-3-clip-preview",
    "input": "A short instrumental acoustic guitar piece."
}'

אפשר לאחזר נתוני מוזיקה שנוצרו באמצעות המאפיין interaction.output_audio שמחזיר את בלוק האודיו האחרון שנוצר. אפשר גם לאחזר את המילים והמבנה של השיר באמצעות המאפיין interaction.output_text. מידע נוסף על מאפייני נוחות מופיע במאמר סקירה כללית על אינטראקציות.

יצירת שיר באורך מלא

אפשר להשתמש במודל lyria-3.5 כדי ליצור שירים באורך מלא שנמשכים כמה דקות. המודל Pro מבין את המבנה המוזיקלי ויכול ליצור קומפוזיציות עם בתים, פזמונים וגשרים מובחנים. אפשר להשפיע על משך השיר על ידי ציון משך הזמן בהנחיה (לדוגמה, "צור שיר באורך 2 דקות") או על ידי שימוש בחותמות זמן כדי להגדיר את המבנה.

Python

interaction = client.interactions.create(
    model="lyria-3.5",
    input="An epic cinematic orchestral piece about a journey home. Starts with a solo piano intro, builds through sweeping strings, and climaxes with a massive wall of sound.",
)

JavaScript

const interaction = await client.interactions.create({
    model: 'lyria-3.5',
    input: 'A beautiful piano melody.',
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
    "model": "lyria-3.5",
    "input": "A beautiful piano melody."
}'

בחירת פורמט הפלט

כברירת מחדל, מודלים של Lyria 3.5 יוצרים אודיו בפורמט MP3. ב-Lyria 3.5, אפשר גם לבקש את הפלט בפורמט WAV על ידי הגדרת response_format.

Python

interaction = client.interactions.create(
    model="lyria-3.5",
    input="A beautiful piano melody.",
    response_format={"type": "audio"},
)

JavaScript

const interaction = await client.interactions.create({
    model: 'lyria-3.5',
    input: 'A beautiful piano melody.',
    response_format: {
        type: 'audio',
    },
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lyria-3.5",
    "input": "A beautiful piano melody.",
    "response_format": {
        "type": "audio"
    }
  }'

ניתוח התשובה

התשובה מ-Lyria 3.5 מכילה כמה בלוקים של תוכן בסכימה steps. האינטראקציות מחזירות רצף של שלבים, כאשר השלבים model_output מכילים את התוכן שנוצר. בלוקים של תוכן טקסט מכילים את המילים שנוצרו או תיאור של מבנה השיר בפורמט JSON. בלוקי תוכן עם סוג audio מכילים את נתוני האודיו בקידוד Base64.

Python

lyrics = []
audio_data = None

generated_audio = interaction.output_audio
if generated_audio:
    with open("output.mp3", "wb") as f:
        f.write(base64.b64decode(generated_audio.data))

lyrics = interaction.output_text
if lyrics:
    print(f"Lyrics:\n{lyrics}")

JavaScript

const lyrics = [];
let audioData = null;

const generatedAudio = interaction.output_audio;
if (generatedAudio) {
    fs.writeFileSync("output.mp3", Buffer.from(generatedAudio.data, 'base64'));
}

const lyrics = interaction.output_text;
if (lyrics) {
    console.log("Lyrics:\n" + lyrics);
}

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

# The output from the REST API is a JSON object containing base64 encoded data.
# You can extract the text or the audio data using a tool like jq.
# To extract the audio and save it to a file:
curl ... | jq -r '.steps[] | select(.type=="model_output") | .content[] | select(.type=="audio") | .data' | base64 -d > output.mp3

מילים ומוזיקה משולבות

הפלט של Lyria 3.5 מורכב – הוא כולל שלבים נפרדים ובלוקים של מילים (טקסט) שנוצרו ושל השיר עצמו (אודיו). לכן, מאפייני הנוחות מציעים קיצור דרך מהיר ומומלץ.

עם זאת, אם רוצים שליטה מלאה ותוכנתית בציר הזמן הגולמי של השלבים שמוחזרים על ידי השרת (למשל, רישום של בלוקים ספציפיים של תוכן בזמן שהם מתקבלים), אפשר לבצע איטרציה ידנית על steps במקום זאת:

Python

lyrics = []
audio_data = None

for step in interaction.steps:
    if step.type == "model_output":
        for content_block in step.content:
            if content_block.type == "audio":
                audio_data = base64.b64decode(content_block.data)
            elif content_block.type == "text":
                lyrics.append(content_block.text)

if lyrics:
    print("Lyrics:\n" + "\n".join(lyrics))

if audio_data:
    with open("output.mp3", "wb") as f:
        f.write(audio_data)

JavaScript

const lyrics = [];
let audioData = null;

for (const step of interaction.steps) {
    if (step.type === 'model_output') {
        for (const contentBlock of step.content) {
            if (contentBlock.type === 'audio') {
                audioData = Buffer.from(contentBlock.data, 'base64');
            } else if (contentBlock.type === 'text') {
                lyrics.push(contentBlock.text);
            }
        }
    }
}

if (lyrics.length) {
    console.log("Lyrics:\n" + lyrics.join("\n"));
}

if (audioData) {
    fs.writeFileSync("output.mp3", audioData);
}

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

יצירת מוזיקה מתמונות

‫Lyria 3.5 תומך בקלט מולטי-מודאלי – אפשר לספק עד 10 תמונות לצד פרומפט טקסטואלי ברשימה input, והמודל יצור מוזיקה בהשראת התוכן החזותי.

Python

import base64

with open("desert_sunset.jpg", "rb") as f:
    image_bytes = f.read()
    image_b64 = base64.b64encode(image_bytes).decode("utf-8")

response = client.interactions.create(
    model="lyria-3.5",
    input=[
        {
            "type": "text",
            "text": "An atmospheric ambient track inspired by the mood and colors in this image.",
        },
        {
            "type": "image",
            "mime_type": "image/jpeg",
            "data": image_b64,
        },
    ],
)

JavaScript

import * as fs from "fs";

const imageBytes = fs.readFileSync("desert_sunset.jpg").toString("base64");

const interaction = await client.interactions.create({
    model: "lyria-3.5",
    input: [
        {
            type: "text",
            text: "An atmospheric ambient track inspired by the mood and colors in this image.",
        },
        {
            type: "image",
            mime_type: "image/jpeg",
            data: imageBytes,
        },
    ],
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

# Pass base64 encoded image data directly:
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "lyria-3.5",
    "input": [
      {"type": "text", "text": "An atmospheric ambient track inspired by the mood and colors in this image."},
      {"type": "image", "mime_type": "image/jpeg", "data": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wgALCAABAAEBAREA/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPxA="}
    ]
  }'

ציון מילות שיר בהתאמה אישית

אתם יכולים לכתוב מילים משלכם ולכלול אותן בפרומפט. כדי לעזור למודל להבין את מבנה השיר, אפשר להשתמש בתגי קטע כמו [Verse], [Chorus] ו-[Bridge]:

Python

prompt = """
Create a dreamy indie pop song with the following lyrics:

[Verse 1]
Walking through the neon glow,
city lights reflect below,
every shadow tells a story,
every corner, fading glory.

[Chorus]
We are the echoes in the night,
burning brighter than the light,
hold on tight, don't let me go,
we are the echoes down below.

[Verse 2]
Footsteps lost on empty streets,
rhythms sync to heartbeats,
whispers carried by the breeze,
dancing through the autumn leaves.
"""

interaction = client.interactions.create(
    model="lyria-3.5",
    input=prompt,
)

JavaScript

const prompt = `
Create a dreamy indie pop song with the following lyrics:

[Verse 1]
Walking through the neon glow,
city lights reflect below,
every shadow tells a story,
every corner, fading glory.

[Chorus]
We are the echoes in the night,
burning brighter than the light,
hold on tight, don't let me go,
we are the echoes down below.

[Verse 2]
Footsteps lost on empty streets,
rhythms sync to heartbeats,
whispers carried by the breeze,
dancing through the autumn leaves.
`;

const interaction = await client.interactions.create({
    model: 'lyria-3.5',
    input: prompt,
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lyria-3.5",
    "input": "Create a dreamy indie pop song with the following lyrics: ..."
  }'

שליטה בתזמון ובמבנה

אתם יכולים לציין בדיוק מה קורה ברגעים מסוימים בשיר באמצעות חותמות זמן. התכונה הזו שימושית לשליטה במועד הכניסה של כלי הנגינה, במועד הצגת המילים ובאופן ההתקדמות של השיר:

Python

prompt = """
[0:00 - 0:10] Intro: Begin with a soft lo-fi beat and muffled
              vinyl crackle.
[0:10 - 0:30] Verse 1: Add a warm Fender Rhodes piano melody
              and gentle vocals singing about a rainy morning.
[0:30 - 0:50] Chorus: Full band with upbeat drums and soaring
              synth leads. The lyrics are hopeful and uplifting.
[0:50 - 1:00] Outro: Fade out with the piano melody alone.
"""

interaction = client.interactions.create(
    model="lyria-3.5",
    input=prompt,
)

JavaScript

const prompt = `
[0:00 - 0:10] Intro: Begin with a soft lo-fi beat and muffled
              vinyl crackle.
[0:10 - 0:30] Verse 1: Add a warm Fender Rhodes piano melody
              and gentle vocals singing about a rainy morning.
[0:30 - 0:50] Chorus: Full band with upbeat drums and soaring
              synth leads. The lyrics are hopeful and uplifting.
[0:50 - 1:00] Outro: Fade out with the piano melody alone.
`;

const interaction = await client.interactions.create({
    model: 'lyria-3.5',
    input: prompt,
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lyria-3.5",
    "input": "[0:00 - 0:10] Intro: ..."
  }'

יצירת טראקים אינסטרומנטליים

כדי ליצור מוזיקת רקע, פסקולים למשחקים או כל מקרה שימוש אחר שלא דורש שירה, אפשר להנחות את המודל ליצור טראקים אינסטרומנטליים בלבד:

Python

interaction = client.interactions.create(
    model="lyria-3-clip-preview",
    input="A bright chiptune melody in C Major, retro 8-bit video game style. Instrumental only, no vocals.",
)

JavaScript

const interaction = await client.interactions.create({
    model: 'lyria-3-clip-preview',
    input: 'A bright chiptune melody in C Major, retro 8-bit video game style. Instrumental only, no vocals.',
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lyria-3-clip-preview",
    "input": "A bright chiptune melody in C Major, retro 8-bit video game style. Instrumental only, no vocals."
  }'

יצירת מוזיקה בשפות שונות

‫Lyria 3.5 יוצר מילים בשפה של הפרומפט. כדי ליצור שיר עם מילים בצרפתית, כותבים את ההנחיה בצרפתית. המודל מתאים את סגנון הקול וההגייה שלו לשפה.

Python

interaction = client.interactions.create(
    model="lyria-3.5",
    input="Crée une chanson pop romantique en français sur un coucher de soleil à Paris. Utilise du piano et de la guitare acoustique.",
)

JavaScript

const interaction = await client.interactions.create({
    model: 'lyria-3.5',
    input: 'Crée une chanson pop romantique en français sur un coucher de soleil à Paris. Utilise du piano et de la guitare acoustique.',
});

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ResponseModality;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("lyria-3-generate-001"))
        .responseModalities(Arrays.asList(ResponseModality.AUDIO))
        .input(InteractionsInput.of("Upbeat electronic synthwave track"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println("Audio generated: " + interaction.outputAudio().isPresent());

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "lyria-3.5",
    "input": "Crée une chanson pop romantique en français sur un coucher de soleil à Paris. Utilise du piano et de la guitare acoustique."
  }'

הבינה של המודל

מודל Lyria 3.5 מנתח את תהליך ההנחיה שאתם יוצרים, שבו המודל מסיק מסקנות לגבי המבנה המוזיקלי (אינטרו, בית, פזמון, גשר וכו') על סמך ההנחיה. הפעולה הזו מתבצעת לפני יצירת האודיו, והיא מבטיחה עקביות מבנית ומוזיקליות.

מדריך לכתיבת פרומפטים

ככל שההנחיה תהיה ספציפית יותר, כך התוצאות יהיו טובות יותר. אלה ההנחיות שאתם יכולים לתת כדי להנחות את יצירת התמונה:

  • Genre: מציינים ז'אנר או שילוב של ז'אנרים (לדוגמה, lo-fi hip hop,‏ jazz fusion,‏ cinematic orchestral).
  • כלי נגינה: מציינים כלי נגינה ספציפיים (למשל, "פסנתר Fender Rhodes", "גיטרת סלייד", "מכונת תופים TR-808").
  • BPM: הגדרת הטמפו (לדוגמה, ‎120 BPM או טמפו איטי בסביבות ‎70 BPM).
  • סולם/מפתח: מציינים סולם מוזיקלי (לדוגמה, "בסולם סול מז'ור", "בסולם רה מינור").
  • מצב רוח ואווירה: השתמשו בשמות תואר תיאוריים (למשל, "נוסטלגי", "אגרסיבי", "שמימי", "חלומות").
  • מבנה: אפשר להשתמש בתגים כמו [Verse], ‏ [Chorus], ‏ [Bridge], ‏ [Intro],‏ [Outro] או בחותמות זמן כדי לשלוט בהתקדמות השיר.
  • משך: מודל הקליפים תמיד יוצר קליפים באורך 30 שניות. במודל Pro, צריך לציין את האורך הרצוי בפרומפט (לדוגמה, 'צור שיר באורך 2 דקות') או להשתמש בחותמות זמן כדי לשלוט במשך.

הנחיות לדוגמה

הנה כמה דוגמאות להנחיות יעילות:

  • "A 30-second lofi hip hop beat with dusty vinyl crackle, mellow Rhodes piano chords, a slow boom-bap drum pattern at 85 BPM, and a jazzy upright bass line. Instrumental only."
  • "An upbeat, feel-good pop song in G major at 120 BPM with bright acoustic guitar strumming, claps, and warm vocal harmonies about a summer road trip."
  • "A dark, atmospheric trap beat at 140 BPM with heavy 808 bass, eerie synth pads, sharp hi-hats, and a haunting vocal sample. In D minor."

שיטות מומלצות

  • כדאי להתחיל עם קליפ. כדאי להשתמש במודל המהיר יותר lyria-3-clip-preview כדי להתנסות בהנחיות לפני שמתחייבים ליצירה באורך מלא באמצעות lyria-3.5.
  • ספציפיות היא שם המשחק. פרומפטים לא ברורים מניבים תוצאות גנריות. כדי לקבל את התוצאה הכי טובה, כדאי לציין כלי נגינה, פעימות לדקה (BPM), סולם, מצב רוח ומבנה.
  • הגדרת השפה כותבים פרומפט בשפה שבה רוצים את המילים.
  • שימוש בתגי קטע. התגים [Verse], ‏[Chorus] ו-[Bridge] מספקים למודל מבנה ברור לפעולה.
  • מפרידים בין מילות השיר להוראות. כשמספקים מילים בהתאמה אישית, צריך להפריד אותן בבירור מההוראות לגבי המוזיקה.

מגבלות

  • בטיחות: כל ההנחיות נבדקות על ידי מסנני בטיחות. הנחיות שמפעילות את המסננים ייחסמו. זה כולל הנחיות שמבקשות קולות ספציפיים של אומנים או יצירה של מילות שירים שמוגנות בזכויות יוצרים.
  • סימון במים: כל האודיו שנוצר כולל סימן מים באודיו של SynthID לצורך זיהוי. אי אפשר לשמוע את סימן המים הזה, והוא לא משפיע על חוויית ההאזנה.
  • עריכה בכמה שלבים: יצירת מוזיקה היא תהליך חד-שלבי. בגרסה הנוכחית של Lyria 3.5 אין תמיכה בעריכה איטרטיבית או בשיפור של קליפ שנוצר באמצעות כמה הנחיות.
  • אורך: מודל הקליפים תמיד יוצר קליפים באורך 30 שניות. מודל Pro יוצר שירים באורך של כמה דקות. אפשר להשפיע על האורך המדויק באמצעות ההנחיה.
  • דטרמיניזם: התוצאות עשויות להיות שונות בין שיחות, גם אם משתמשים באותו פרומפט.

המאמרים הבאים