Lyria 3.5 是 Google 的音樂生成模型系列,可透過 Gemini API 使用。使用 Lyria 3.5,你可以根據文字提示或圖片生成高品質的 44.1 kHz 立體聲音訊。這些模型可提供結構一致的音樂,包括人聲、歌詞時間碼和完整樂器編曲。
Lyria 系列包含以下模型:
| 模型 | 模型 ID | 適用情境 | 時間長度 | 輸出內容 |
|---|---|---|---|---|
| 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 秒片段。如要生成短片,請使用文字提示詞呼叫 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,您也可以設定 response_format,要求以 WAV 格式輸出。
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 支援多模態輸入內容,您可以在 input 清單中提供最多 10 張圖片和文字提示詞,模型就會根據視覺內容創作音樂。
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 會分析提示程序,模型會根據提示,透過音樂結構 (前奏、主歌、副歌、橋段等) 推論。這項程序會在生成音訊前執行,確保結構一致性和音樂性。
提示指南
提示可以很簡單,例如「一首關於可愛貓咪躲避水窪的民謠,女聲演唱,並加入雨聲」,也可以詳細且有結構,例如:
這首 1980 年代風格的合成器流行樂曲,節奏強勁、合成器音色閃耀,副歌洗腦又充滿力量。這首歌應帶有復古未來主義的感覺,讓人想起 80 年代的經典流行金曲,並經過現代製作技術的潤飾。節奏應歡快且適合跳舞,大約 120 BPM,並有清晰的主歌-副歌結構和令人難忘的樂器旋律。歌詞描述的是準備參加派對的心情。
簡單和複雜的提示都能產生良好的輸出內容。不妨試試這些訣竅,找出最適合自己的做法。
類型
在提示詞開頭輸入想要的音樂類型,例如嘻哈、搖滾和饒舌。你可以指定多種曲風:
- 融合金屬樂和饒舌
- 結合死亡金屬和歌劇
- 含有電子無人機元素的古典樂
- 現代電子舞曲 (EDM) 混合歐洲流行音樂
你也可以加入年代:
- 90 年代初期的嘻哈
- 60 年代法國 ye-ye 流行樂
- 80 年代的電子實驗
- 2000 年代主流流行樂
如果提示模型生成特定類型或地區變體,例如「柏林鐵克諾」或「灣區 hyphy」,模型會嘗試捕捉該本質,但可能不一定能正確生成。
樂器
預設情況下,Lyria 3.5 會使用該曲風的樂器和工具製作歌曲。不必過於嚴格。
不過,除非你要求,否則舞曲不會包含薩克斯風。因此,如要生成薩克斯風獨奏,請輸入以下提示:
這首舞曲節奏強勁、合成器閃閃發光,副歌琅琅上口,橋段應加入薩克斯風獨奏。
提示可包含特定樂器、樂器音效,以及樂器間的互動方式。您可以運用這種組合營造特定情緒或質感:
- 失真低音線與清脆的 Hi-Hat 相互抗衡
- 溫暖的類比合成器墊音在乾淨親切的木吉他下方膨脹
- 多層破音吉他堆疊出音牆,人聲則埋在其中, 聽起來很遙遠
歌曲結構
你可以在提示中列出歌曲的進展。使用箭頭或清單定義流程:
[Intro]->[Verse 1]->[Chorus]->[Verse 2]->[Chorus]->[Bridge]->[Outro]- 先以輕柔的鋼琴前奏開場,接著進入激昂的段落,然後突然靜音,再爆發進入副歌。
你也可以指定這些區段之間的能量變化:
- 在副歌前營造緊張感,然後在爆發力十足的副歌前歸於寂靜
- 整首歌曲的音量逐漸變大,一次加入一種樂器,直到形成混亂的音牆
- 在橋段後突然停止,接著是無伴奏合唱
你也可以提示要執行動作的確切時間:
- 在 12 秒時建構至低點
- 每隔 2 秒說一次「什麼」
- 副歌從 22 秒開始
歌詞
系統預設會生成人聲和歌詞。你可以提供自己的歌詞、要求不要歌詞 (或純音樂),或引導歌詞生成朝你想要的方向發展。
歌詞會以您輸入提示的語言顯示。你也可以要求以其他語言撰寫歌詞,例如「用法文撰寫歌詞」。
使用自訂歌詞
如要讓模型使用你提供的歌詞,請在提示中加入歌詞,並加上「Lyrics:」前置字元:
Lyrics:
[Intro]
Oooh, oooh
[Verse 1]
Let's go
Let's go
Go with the flow
[Chorus]
...
你可以在歌曲的各個部分加上前置字串,例如 [Intro]、[Verse 1]、[Pre-chorus]、[Chorus] 和 [Outro]。
如要重複某個字或一行,例如回音或和聲,可以將其放在括號中:「Let's go (go)」。
提示模型撰寫歌詞
如要讓 Lyria 3.5 為你創作歌詞,建議在提示詞中加入歌詞內容的詳細資訊。否則模型必須從音樂提示推斷主題,結果可能不符合你的需求。
歌詞描述失去愛情的痛苦,這位歌手回憶起過去的戀情,以及隨之湧現的記憶。
如要重複播放副歌,請在提示中要求:
歌詞描述失去愛情的痛苦,這位歌手回憶起過去的戀情,以及隨之湧現的回憶。副歌氣勢磅礴,著重於擺脫痛苦,繼續前進。
Lyria 3.5 會根據你要求的音樂類型,自動調整歌詞結構,但你也可以在提示中再次強調。例如:
EDM 歌曲,不斷重複相同的活力四射詞組。
你也可以提示加入非歌詞的聲音效果,例如:
- 電影中的重複樣本在整首歌曲中說著「我不敢相信!」
- 在音樂節奏放緩前,所有聲音都會停止,然後會聽到小聲音說「我不知道我在這裡做什麼」,接著音樂就會放緩。
- 這首歌曲的開頭是關於 90 年代電影比現今更出色的對話。接著,這首曲目會轉場至流行歌曲。
人聲
你可以提示歌詞的呈現方式,為獲得最佳效果,請詳細指定歌手的性別、音色和音域。
- 女高音:音色清澈如水晶,音質靈活高亢。能以輕柔的氣音唱出高音。
- 女中音:低音域豐富、溫暖且沙啞,帶有煙燻感,略帶聲帶緊縮音,充滿靈魂且共鳴感十足。
- 男高音:明亮、高亢、充滿活力。音色年輕,略帶鼻音,高音爆發力十足,能穿透混音。
- 男中音:深沉、醇厚、如天鵝絨般柔滑。以低沉的胸腔共鳴聲,輕柔地哼唱。
- 飽經風霜的搖滾歌手 (男):嗓音沙啞粗獷,音色低沉,讓人想起 90 年代的垃圾搖滾。情緒強度處於高點。
其他提示參數
您也可以加入下列參數,進一步修正提示:
- BPM:設定節奏 (例如「120 BPM」、「70 BPM 左右的慢節奏」)。
- 調性/音階:指定調性 (例如「G 大調」、「D 小調」)。
- 情緒和氛圍:使用描述性形容詞 (例如「懷舊」、「激進」、「空靈」、「夢幻」)。
- 長度:短片模型一律會生成 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."
最佳做法
- 先使用 Clip 進行疊代。使用速度較快的
lyria-3-clip-preview模型實驗提示詞,再使用lyria-3.5生成完整長度的影片。 - 提供清楚明確的說明,籠統的提示詞只會產出一般結果。提及樂器、BPM、調性、情境和結構,以獲得最佳輸出內容。
- 語言相符。以所需語言輸入提示。
- 使用章節標記。
[Verse]、[Chorus]、[Bridge]標記可為模型提供清楚的結構,方便遵循。 - 歌詞和指示分開。提供自訂歌詞時,請清楚區分歌詞和音樂方向指示。
限制
- 安全性:所有提示都會經過安全篩選器檢查。系統會封鎖觸發篩選器的提示。包括要求特定藝人聲音的提示,或是生成受著作權保護的歌詞。
- 浮水印:所有生成的音訊都會加上 SynthID 音訊浮水印,以利識別。這種浮水印人耳無法辨識,也不會影響聆聽體驗。
- 多輪遞進編輯:音樂生成是單輪程序。目前版本的 Lyria 3.5 不支援透過多個提示,反覆編輯或修正生成的片段。
- 長度:片段模型一律會生成 30 秒的片段。Pro 模型會生成幾分鐘的歌曲,確切時長取決於提示。
- 決定性:即使使用相同提示,每次通話的結果也可能不同。