mcpField
L
lyrics-generation

lyrics-generation

github.com/awesome-genmedia创意与媒体4542 次安装32 周前更新
代码仓库

关于 lyrics-generation

lyrics-generation 通过 each::sense 创作原创歌词,并根据请求选择模型。它支持指定流派、结构、情绪、押韵和参考图像,并提供脚本与应用的 API 示例。

主要功能

  1. 01按流派创作原创歌词
  2. 02指定歌曲结构与押韵
  3. 03接受参考图像
  4. 04支持流式响应
  5. 05由 each::sense 选择模型

适用场景

  1. 01按指定情绪与形式起草歌词
  2. 02根据图像创作歌曲
  3. 03创作主歌、Hook 或广告歌

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/awesome-genmedia/skills --skill lyrics-generation

安装后在 Claude Code 中输入/lyrics-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": "Write lyrics for an indie folk song about leaving a small town to chase your dreams. Bittersweet tone, 3 verses, a chorus, and a bridge. Use vivid imagery of back roads, train stations, and open skies."}],
    "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": "Write lyrics for an indie folk song about leaving a small town to chase your dreams. Bittersweet tone, 3 verses, a chorus, and a bridge. Use vivid imagery of back roads, train stations, and open skies."}]
)

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": "Write song lyrics inspired by the mood and scene in this image. Capture the emotion, colors, and atmosphere as poetic lyrics with a verse-chorus structure."},
              {"type": "image_url", "image_url": {"url": "https://example.com/inspiration-photo.jpg"}}
            ]
          }
    ],
    "stream": false
  }'

图片通过 OpenAI 多模态内容格式在消息中发送。每个请求最多可包含 4 张图片。

流式传输

设置 "stream": true 可获取实时 SSE 响应,设置 "stream": false 可在单个响应中获取完整结果。流式传输适合在 UI 中显示进度;非流式传输则更适用于脚本和自动化。

歌曲结构参考

结构标记

在提示词中使用这些标签,并预期它们会出现在输出中:

标记用途常见行数
[Intro]口白或简短开场1-2 行
[Verse 1/2/3]情节推进、讲述故事4-8 行
[Pre-Chorus]在副歌前营造张力2-4 行
[Chorus]主要记忆点、核心信息4-8 行
[Bridge]对比、新视角、转调4-6 行
[Outro]收尾、最终陈述2-4 行
[Hook]嘻哈歌曲中相当于副歌的部分2-4 行
[Ad-lib]背景人声、感叹1-2 行
常见曲风结构
曲风推荐结构
Pop主歌 - 预副歌 - 副歌 - 主歌 - 预副歌 - 副歌 - 桥段 - 副歌
Rock主歌 - 副歌 - 主歌 - 副歌 - 独奏 - 副歌
Hip-Hop主歌 - Hook - 主歌 - Hook - 主歌 - Hook
Country主歌 - 副歌 - 主歌 - 副歌 - 桥段 - 副歌
Ballad主歌 - 主歌 - 副歌 - 主歌 - 副歌 - 尾声
EDM前奏 - 渐强 - Drop - 主歌 - 渐强 - Drop - 尾声

提示词技巧

指定重要细节

提供的背景信息越多,歌词就越贴合需求:

"Write pop lyrics about long-distance love.
Rhyme scheme: ABAB in verses, AABB in chorus.
Mood: hopeful but aching.
Perspective: first person.
Include a metaphor about lighthouses."
控制押韵格式
格式模式示例
ABAB交替押韵第 1、3 行押韵,第 2、4 行押韵
AABB对句押韵相邻两行押韵
ABCB简单民谣只有第 2、4 行押韵
Free不严格押韵富有诗意、口语化
Internal行内押韵"I'm pacing, chasing, facing the dawn"
情绪关键词
joyful, melancholic, defiant, tender, aggressive, whimsical,
haunting, anthemic, intimate, rebellious, nostalgic, empowering,
brooding, playful, ethereal, raw, triumphant, wistful

示例

流行爱情歌曲
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": "Write lyrics for an upbeat pop love song about meeting someone at a concert and feeling an instant connection. Structure: Verse 1, Pre-Chorus, Chorus, Verse 2, Pre-Chorus, Chorus, Bridge, Chorus. ABAB rhyme scheme in verses, catchy repetitive chorus. Include references to neon lights, bass drops, and heartbeats."}],
    "stream": false
  }'
Rap 主歌
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": "Write 3 rap verses and a hook about rising from nothing and building success through hard work. Internal rhyme schemes, clever wordplay, and multisyllabic rhymes. Confident but not arrogant tone. Reference late nights, hustle, doubters, and breakthrough moments. Hip-hop style, think Kendrick Lamar meets J. Cole."}],
    "stream": false
  }'
Country 叙事歌曲
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": "Write country song lyrics telling the story of a grandfather teaching his grandson to fish at their favorite lake. Warm and nostalgic. 3 verses, chorus, and bridge. Each verse covers a different life lesson learned by the water. Simple ABCB rhyme scheme. Imagery of sunrise, red bobbers, old tackle boxes, and quiet mornings."}],
    "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": "Write brooding indie rock lyrics about insomnia and overthinking at 3 AM. Moody and introspective. Verse-Chorus-Verse-Chorus-Bridge-Chorus structure. Use metaphors of static, empty rooms, and flickering screens. Free verse style with occasional rhymes. Short punchy lines in the chorus."}],
    "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": "Write a short, catchy jingle lyric for an organic juice brand called Fresh Squeeze. 4-6 lines total. Must be upbeat, memorable, and include the brand name twice. Rhyming couplets. Focus on freshness, energy, and natural ingredients. Think earworm melody."}],
    "stream": false
  }'

歌词转歌曲工作流

先生成歌词,再制作完整歌曲:

# Step 1: Generate lyrics
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": "Write pop song lyrics about chasing dreams in a big city. Verse-Chorus-Verse-Chorus-Bridge-Chorus. Uplifting and determined."}],
    "stream": false
  }'

# Step 2: Use the generated lyrics to create a full song
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, 122 BPM, with the following lyrics:\n\n[Verse 1]\n(paste generated lyrics here)\n\n[Chorus]\n(paste generated chorus here)"}],
    "stream": false
  }'

常见问题

  • 没有指定曲风或风格方向会生成泛泛的歌词。请指定曲风和用于确定基调的参考艺人。
  • 忘记添加结构标记会导致主歌和副歌的起止位置不清楚。
  • 过于抽象可能生成听起来很有诗意、却不适合演唱的歌词。如有需要,请要求生成“适合演唱的歌词”。
  • 没有考虑音节可能导致歌词无法配合旋律。请注明“每行保持 8-10 个音节”,以保持一致。
  • 缺少情绪曲线会让歌曲显得平淡。请说明情绪应如何在各段落中逐步发展。

相关技能

文档

评论

支持 Markdown