music-generation
它能做什么
这个技能创作原创音乐,可以是有人声演唱的歌曲,也可以是纯器乐。适合需要背景音乐、短广告曲或主题曲的人。
适用场景
- ✓当用户要求创作歌曲、广告曲或主题曲的时候。
- ✓当用户需要视频的背景音乐或器乐曲的时候。
- ✓当用户已有歌词,并希望将其配上旋律演唱的时候。
技能链接
https://github.com/bytedance/deer-flow/blob/main/skills/public/music-generation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我做一段简短、轻快的器乐广告曲,用作我播客的开场。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能撰写一个小型规格文件,包含标题、风格提示和可选的歌词。然后它把这些发送给音乐生成服务,并返回一个 MP3 文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Music Generation Skill
Overview
This skill generates songs (vocal or instrumental) from a structured JSON spec using the
MiniMax music generation API (/v1/music_generation). You describe the style/mood/scene in
prompt, optionally provide lyrics, and the script returns an MP3.
Workflow
Step 1: Understand Requirements
Identify the desired style, mood, scene, language, and whether the user wants vocals or a pure instrumental track. Decide whether to supply lyrics or let the model write them.
Step 2: Create the Spec JSON
Write a JSON file in /mnt/user-data/workspace/ named {descriptive-name}.json:
{
"title": "Rainy Night Cafe",
"prompt": "indie folk, melancholic, introspective, walking alone, cafe",
"lyrics": "[verse]\nStreetlights glow the night wind sighs\n[chorus]\nPush the wooden door warm air inside"
}
Fields:
title(optional): a human-readable name.prompt(required): style, mood, and scene. Drives the musical character.lyrics(optional): song lyrics. Use\nbetween lines and structure tags such as[Intro],[Verse],[Pre Chorus],[Chorus],[Bridge],[Outro].is_instrumental(optional, bool): settruefor a pure instrumental track (no lyrics needed).
Behavior:
lyricsprovided → those lyrics are sung.is_instrumental: true→ instrumental, no vocals.- neither → the model auto-writes lyrics from
prompt(lyrics_optimizer).
Step 3: Execute Generation
python /mnt/skills/public/music-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/rainy-night-cafe.json \
--output-file /mnt/user-data/outputs/rainy-night-cafe.mp3
Parameters:
--prompt-file: Absolute path to the JSON spec (required).--output-file: Absolute path for the output MP3 (required).
[!NOTE] Do NOT read the python file, just call it with the parameters.
Environment
MINIMAX_API_KEY(required): your MiniMax interface key.MINIMAX_API_HOST(optional): defaulthttps://api.minimaxi.com.MINIMAX_MUSIC_MODEL(optional): defaultmusic-2.6-free(works for all API-key users); paid/Token-Plan users can setmusic-2.6for higher limits.
Output Handling
- Music is saved as MP3 (typically in
/mnt/user-data/outputs/). - Returned audio must decode to nonempty bytes and have an ID3 tag header or MPEG frame signature. This is a header sanity check, not complete audio decoding.
- Malformed, empty or unrecognized audio is rejected before creating the output directory or opening the output file; an existing output is preserved.
- Missing audio reports "MiniMax returned no audio data"; whitespace-only hex reports "MiniMax audio decoded to empty bytes".
- Share the generated file with the user using the present_files tool.
- Offer to iterate on style or lyrics if adjustments are needed.
Notes
- Keep
promptfocused on style/mood/scene; put the actual sung words inlyrics. - For non-English songs, write
lyricsin the target language.
常见问题
我能得到没有人声的曲子吗?
可以。将器乐选项设为 true,就会生成没有演唱的曲子。
我必须自己写歌词吗?
不必。如果你没有提供歌词,模型会自动生成。
它使用什么服务?
该技能说明,它使用 MiniMax 音乐生成 API。
详情
作者的原始描述
Use this skill when the user requests to generate, create, compose, or produce music or songs — background music, theme songs, jingles, or instrumental tracks. Generates a song from a style/mood prompt and optional lyrics via the MiniMax music API.
repo: bytedance/deer-flow
热度
- GitHub 星标
- 85k
- 排名
- #1385
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …