关于 song-generation
song-generation 通过 each::sense 生成带人声和完整伴奏制作的歌曲。创作者可指定歌词、曲风、节奏、人声和乐器,并由系统自动选择模型。
主要功能
- 01生成含人声和制作的完整歌曲
- 02生成短音频和音乐片段
- 03支持歌词与歌曲结构提示
- 04用参考图传达情绪
- 05支持流式或完整响应
适用场景
- 01根据创意制作人声歌曲
- 02生成短钩子或前奏
- 03制作受图片启发的歌曲
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ awesome-genmedia/ skills --skill song-generation安装后在 Claude Code 中输入/song-generation确认已加载。
详细介绍
歌曲生成
使用 each::sense 生成包含人声和完整器乐制作的完整歌曲——这是一款智能 AI Agent,可自动为你的请求选择最佳模型。
快速开始
需要 each::labs API 密钥。请前往 eachlabs.ai 获取。
使用 curl
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate an upbeat indie pop song about road trips and summer freedom, female vocal, 120 BPM, with acoustic guitar, claps, and a catchy whistling hook in the chorus"}],
"stream": false
}'
使用 Python(OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EACHLABS_API_KEY",
base_url="https://eachsense-agent.core.eachlabs.run/v1"
)
response = client.chat.completions.create(
model="eachsense/beta",
messages=[{"role": "user", "content": "Generate an upbeat indie pop song about road trips and summer freedom, female vocal, 120 BPM, with acoustic guitar, claps, and a catchy whistling hook in the chorus"}]
)
print(response.choices[0].message.content)
使用参考图像
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Generate a song inspired by the mood and atmosphere of this image. Match the emotion, whether it feels melancholy, joyful, or mysterious."},
{"type": "image_url", "image_url": {"url": "https://example.com/mood-photo.jpg"}}
]
}
],
"stream": false
}'
图像通过 OpenAI 多模态内容格式放在消息中发送。每个请求最多可包含 4 张图像。
流式传输
设置 "stream": true 可获取实时 SSE 响应,设置 `"stream": false" 可在单个响应中获取完整结果。流式传输适用于在 UI 中显示进度;非流式传输则更适合脚本和自动化。
可用模型
| 模型 | 优势 | 最适合 |
|---|---|---|
| mureka-generate-music | 生成带有人声、歌词和制作的完整歌曲 | 各种流派的完整歌曲 |
| stable-audio-2-5 | 高质量短音频生成 | 短音乐片段、抓耳段落、前奏 |
each::sense 会自动选择合适的模型。对于带人声的完整歌曲,主要使用 mureka-generate-music。
歌曲结构指南
常见歌曲结构
| 结构 | 模式 | 时长 |
|---|---|---|
| 流行标准结构 | 主歌 - 副歌 - 主歌 - 副歌 - 桥段 - 副歌 | 3-4 分钟 |
| 简单结构 | 主歌 - 副歌 - 主歌 - 副歌 | 2-3 分钟 |
| 扩展结构 | 前奏 - 主歌 - 预副歌 - 副歌 - 主歌 - 预副歌 - 副歌 - 桥段 - 副歌 - 尾奏 | 4-5 分钟 |
| 嘻哈 | 前奏 - 主歌 - Hook - 主歌 - Hook - 主歌 - Hook - 尾奏 | 3-4 分钟 |
| 抒情曲 | 前奏 - 主歌 - 主歌 - 副歌 - 主歌 - 副歌 - 尾奏 | 3-5 分钟 |
提供歌词
在提示词中直接加入歌词,并使用结构标记:
Generate a pop rock song, male vocal, 110 BPM:
[Verse 1]
Walking down these empty streets at dawn
Shadows fading as the night moves on
Every step I take leads back to you
Underneath this sky of fading blue
[Chorus]
We were golden, we were fire
Burning brighter, climbing higher
Now I'm standing in the rain
Chasing echoes of your name
流派指南
| 流派 | 常见 BPM | 主要描述词 | 人声风格 |
|---|---|---|---|
| 流行 | 100-130 | 抓耳的 Hook、精致的制作 | 清澈、明亮、有和声 |
| 摇滚 | 110-140 | 电吉他、强劲的鼓点 | 有力、粗犷、富有变化 |
| 嘻哈 | 80-100 | 808 低音、踩镲、Trap 节拍 | 有节奏感的流动感、说唱 |
| R&B | 60-90 | 柔和的低音、丰富的和弦 | 深情、富有旋律变化 |
| 乡村 | 90-130 | 原声吉他、小提琴、钢棒吉他 | 温暖、叙事性强 |
| 电子 | 120-150 | 合成器、Drop、渐强段落 | 经过处理、Vocoded、切片 |
| 独立 | 100-130 | Lo-fi 质感、清脆的吉他 | 亲密、对话式 |
| 爵士 | 80-140 | 摇摆、即兴、铜管乐器 | 流畅、拟声哼唱 |
提示词技巧
人声设定
明确描述人声特征:
"female vocal, alto range, smooth and breathy tone"
"male vocal, deep baritone, raspy rock voice"
"duet with male and female vocals trading verses"
"choir-style harmonies in the chorus"
氛围与情绪
叠加情绪描述词,生成细腻丰富的效果:
"bittersweet and nostalgic, like remembering a perfect day you can never return to"
"triumphant and empowering, building from quiet determination to explosive confidence"
乐器细节
列出具体乐器以便精准控制:
"acoustic guitar, brush drums, upright bass, warm Rhodes piano, subtle strings"
"heavy distorted electric guitar, double kick drums, bass guitar, screaming lead solo"
示例
自定义歌词的流行歌曲
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate an upbeat pop song, female vocal, 118 BPM, with synth bass and claps:\n\n[Verse 1]\nWoke up to the golden light\nEverything is feeling right\nGot my coffee, got my song\nNothing here can go wrong\n\n[Chorus]\nThis is our summer, this is our time\nDancing in the sunshine, feeling so alive\nWe are unstoppable, we are on fire\nTaking it higher and higher"}],
"stream": false
}'
摇滚颂歌
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate an arena rock anthem about never giving up. Male vocal with a gritty, powerful voice. 130 BPM. Driving electric guitar riff, pounding drums, bass guitar, and a massive singalong chorus. Think Foo Fighters meets Queen. 3 minutes long."}],
"stream": false
}'
嘻哈曲目
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate a chill hip-hop track about city nights and ambition. Male rap vocal with a smooth flow. 88 BPM. Dark trap beat with 808 bass, hi-hats, ambient synth pads, and a soulful R&B female vocal hook on the chorus. Moody and atmospheric."}],
"stream": false
}'
原声抒情曲
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate a tender acoustic ballad about saying goodbye to a childhood home. Female vocal, intimate and emotional. 72 BPM. Fingerpicked acoustic guitar, soft cello, and gentle piano. Build to a fuller arrangement in the final chorus with strings. Bittersweet and moving."}],
"stream": false
}'
广告歌 / 短歌曲
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": "Generate a 15-second catchy jingle for a coffee brand called Morning Brew. Upbeat and cheerful, male and female vocals harmonizing, ukulele and handclaps, with the tagline: Rise and brew, the best in you. Earworm melody that sticks."}],
"stream": false
}'
常见问题
- 没有人声指导会生成千篇一律的人声。请务必指定性别、风格和能量水平。
- 未指定速度会让模型自行猜测 BPM,可能与你的设想不符。请指定 BPM。
- 歌词没有结构标记会让模型难以正确区分主歌和副歌。
- 混合过多流派(例如“爵士-金属-乡村-电子融合”)会削弱效果。最多融合 2 种流派。
- 忽略歌曲时长可能会生成过短或过长的片段,不符合你的需求。
相关技能
文档
评论
支持 Markdown