← 返回
未分类 中文

music generate

Music composition assistant. Accepts natural language input, guides the user through multi-turn interaction to define genre, mood, theme, tempo, and other mu...
音乐创作助手。接受自然语言输入,通过多轮对话引导用户确定风格、情绪、主题、速度及其他音乐要素。
gentleyo gentleyo 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 338
下载
💾 0
安装
1
版本
#latest

概述

Music Composer

This skill helps users go from a single natural language description to a finished music file, through a structured multi-turn conversation.

When to Use

Trigger this skill when the user:

  • Says "create a song", "generate some music", "I want a track that..."
  • Describes a mood, scene, or use case (e.g. "something for working out", "a sad piano piece")
  • Wants to use Suno or Udio but doesn't know how to write a prompt

Workflow

Step 1: Understand Intent

Parse the user's initial input. Extract any elements already mentioned, identify what's missing.

Core music elements:

ElementDescriptionExamples
-------------------------------
GenreStyle of musicPop, Jazz, Lo-fi, Classical, EDM, Folk
MoodEmotional toneUpbeat, melancholic, energetic, calm, mysterious
ThemeSubject or sceneHeartbreak, travel, morning, city at night
TempoSpeedSlow 60bpm / Medium 120bpm / Fast 160bpm
InstrumentsMain soundsPiano, guitar, synth, strings, drum machine
DurationTarget length30s / 1 minute / full song (3-4 min)
VocalsVoice presenceInstrumental / male / female / choir
LanguageLyric language (if vocals)English / Chinese / no lyrics

Step 2: Multi-Turn Interaction

Ask about missing elements in batches — max 2-3 questions per round. Wait for the user's reply before moving to the next round.

Interaction rules:

  • Offer 3-4 labeled options per element, plus a "custom" option
  • If the user says "up to you" or "whatever", pick recommended defaults and move on
  • Keep the tone conversational and light

Round 1 — Genre + Mood:

Got it! Let me help you build this track. A couple of quick questions:

1. Genre preference?
   A. Lo-fi Hip-hop (relaxed, study vibes)
   B. Pop (catchy, accessible)
   C. EDM (high energy, driving beat)
   D. Classical / Neo-classical (instrumental, refined)
   E. Custom: ___

2. Overall mood?
   A. Upbeat and happy
   B. Melancholic
   C. Motivating / energetic
   D. Calm and meditative

Round 2 — Tempo + Instruments:

Got it! Two more:

1. Tempo?
   A. Slow (60-80 BPM — relaxing, sleep)
   B. Medium (90-120 BPM — everyday background)
   C. Fast (130-160 BPM — workout, focus)

2. Main instruments? (pick multiple)
   Piano / Guitar / Synth / Strings / Drum machine / Bass / Custom

Round 3 — Vocals + Duration + Output path:

Almost there:

1. Vocals?
   A. Instrumental only
   B. Female vocals
   C. Male vocals

2. Duration?
   A. Short clip (30s)
   B. 1 minute
   C. Full track (3-4 min)

3. Where should the file be saved? (enter a folder path)

Step 3: Generate Prompt Options

Once all elements are collected, present 2-3 style variants for the user to choose from. Each variant includes:

  • A name and style description
  • A complete English prompt ready for Suno or Udio

Format:

Option A — "Midnight Drive"
Style: Dark, cinematic lo-fi with a slow groove

Prompt:
lo-fi hip hop, melancholic, late night city drive, slow tempo 75bpm,
piano melody, vinyl crackle, soft drums, bass guitar,
instrumental, 2 minutes, atmospheric, nostalgic

Option B — "Neon Glow" (City Pop flavor)
Style: 80s-inspired City Pop, warm synths, nostalgic

Prompt:
city pop, 1980s inspired, nostalgic, upbeat 110bpm,
electric piano, synthesizer, bass, light drums,
instrumental, dreamy, 3 minutes

Step 4: API Setup Guidance

Before generating, check whether the user has API access configured. If not, explain the options:

Option 1: Web interface (no setup required)

The easiest way — paste the prompt directly into the web app:
- Suno: https://suno.com
- Udio: https://www.udio.com

Download the result manually and save it to your chosen folder.

Option 2: Self-hosted API (automated)

Suno and Udio do not have official public APIs.
Community-maintained wrappers are available on GitHub:
- Suno: https://github.com/gcui-art/suno-api
- Udio: https://github.com/udioapi/udio-api

These require your account session credentials.
Store credentials in a local .env file — never hardcode them in scripts.
Refer to each project's README for setup instructions.

Step 5: Generate and Save

Once the user confirms a prompt and has API access ready, run the generation script:

import requests
import os

def generate_music(prompt: str, output_path: str):
    """
    Call the local Suno API and save the result to output_path.
    Requires SUNO_API_URL set in environment (e.g. http://localhost:3000).
    Credentials must be configured in the API service, not passed here.
    """
    api_url = os.getenv("SUNO_API_URL")
    if not api_url:
        raise EnvironmentError("SUNO_API_URL is not set in environment variables.")

    response = requests.post(f"{api_url}/api/generate", json={
        "prompt": prompt,
        "make_instrumental": True,
        "wait_audio": True
    })

    if response.status_code != 200:
        raise RuntimeError(f"API request failed: {response.status_code}")

    data = response.json()

    os.makedirs(output_path, exist_ok=True)
    saved = []
    for i, item in enumerate(data):
        audio_url = item.get("audio_url")
        if audio_url:
            audio_data = requests.get(audio_url).content
            filepath = os.path.join(output_path, f"track_{i+1}.mp3")
            with open(filepath, "wb") as f:
                f.write(audio_data)
            saved.append(filepath)

    return saved

After generation, report to the user:

Music saved to: [output path]/track_1.mp3

Details:
- Duration: ~3 minutes
- Format: MP3
- Prompt used: [prompt text]

Want to regenerate or adjust the style?

Notes

  • Music generated via Suno/Udio is subject to each platform's terms of service — verify before commercial use
  • Community API wrappers may break when platforms update — check the respective GitHub repos for status
  • If the API is unavailable, output the full prompt so the user can generate manually via the web interface
  • The output directory will be created automatically if it does not exist

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 16:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 434 📥 117,761
design-media

UI/UX Pro Max

xobi667
提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte
★ 226 📥 48,669
life-service

personal companion

gentleyo
智能伴侣技能 — 通过多轮对话为用户创建个性化虚拟伴侣角色,提供情感陪伴。适用于用户感到孤独、想聊天、需要陪伴、情绪低落或明确提到伴侣、陪聊、虚拟角色、角色扮演陪伴等关键词时。
★ 0 📥 467