{“content”:”---\nname: minimax-music-gen\ndescription: MiniMax music generation via mmx CLI — correct commands, lyrics formatting, and output options for generating songs with lyrics\ntriggers:\n - generate music via minimax\n - minimax music generation CLI\n - mmx music generate\n - generate song with lyrics minimax\n---\n\n# MiniMax Music Generation\n\n## Quick Start\n\nbash\n# Generate song with lyrics file\nmmx music generate \\\n --prompt \"Warm acoustic ballad, mandopop, male vocalist, gentle guitar\" \\\n --lyrics-file song.txt \\\n --out output.mp3\n\n# Instrumental only\nmmx music generate --prompt \"Cinematic orchestral\" --instrumental --out bgm.mp3\n\n\n## Key Learnings (2026-05-04 verified)\n\n❌ Direct API calls to /v1/music_generation FAIL — the API parameters are complex and model naming is inconsistent:\n- music-01 model → error “cannot use music-02 params on music-01 model”\n- music-02 model → error “invalid model”\n- Various endpoint variations → 404 or param errors\n\n✅ Use the mmx CLI instead — it handles all the parameter complexity:\nbash\nmmx music generate --help\n\n\n## Lyrics File Format\n\nLyrics must use structured tags on separate lines. Supported tags:\n- [Intro], [Verse], [Pre Chorus], [Chorus], [Interlude], [Bridge], [Outro], [Post Chorus], [Transition], [Break], [Hook], [Build Up], [Inst], [Solo]\n\nImportant: Tags must be clean — no descriptions inside brackets. The text in brackets will be interpreted as a section marker, not sung.\n\nExample song.txt:\n\n[Verse 1]\n太阳每天照样升起\n你已经很努力\n不必跟别人比较\n\n[Chorus]\n尽力就好 尽力就好\n你已经尽力了 够了\n\n\n## Output Options\n\n| Flag | Description |\n|------|-------------|\n| --out file.mp3 | Save to file (hex encoding, default) |\n| --output-format url | Return 24h expiry URL — NOTE: may fail with “API did not return audio_url” → use --out instead |\n| --output-format hex | Return hex encoded (for --out) |\n| --format mp3 | Audio format (default: mp3) |\n| --sample-rate 44100 | Sample rate in Hz |\n| --bitrate 256000 | Bitrate in bps |\n| --vocals \"text\" | Vocal style (e.g. “warm male baritone”, “bright female soprano”) |\n| --genre \"folk\" | Genre (e.g. folk, pop, jazz, electronic) |\n| --mood \"warm\" | Mood/emotion (e.g. warm, melancholic, uplifting) |\n| --instruments \"acoustic guitar, piano\" | Instruments to feature |\n| --bpm 95 | Exact tempo in BPM |\n| --key \"C major\" | Musical key |\n| --avoid \"drums\" | Elements to avoid |\n| --model music-2.6 | Model (music-2.6/2.6-free/2.5+/2.5, default: music-2.6-free) |\n\n## Lyric Video Production with FFmpeg\n\nAfter generating the MP3, create a lyric video using a still image + SRT subtitles:\n\n### Step 1: Create SRT subtitle file\nsrt\n1\n00:00:00,000 --> 00:00:07,000\n第一句歌词\n\n2\n00:00:07,000 --> 00:00:14,000\n第二句歌词\n\n3\n00:00:14,000 --> 00:00:21,000\n\n4\n00:00:21,000 --> 00:00:28,000\n(空行 = 纯器乐/间奏)\n\n...\n\n\n### Step 2: Generate album cover (optional)\nbash\nmmx image generate \\\n --prompt \"Warm minimalist album cover art, soft sunrise gradient, single silhouette in open field, contemplative mood, no text\" \\\n --out cover.png\n\n\n### Step 3: Build video with ffmpeg\nbash\nffmpeg -y -loop 1 -framerate 1 \\\n -i cover.png -i song.mp3 \\\n -vf \"subtitles=song.srt:force_style='FontName=Arial,FontSize=28,PrimaryColour=&H00FFFFFF&,OutlineColour=&H00000000&,Bold=1,Alignment=10,MarginV=120'\" \\\n -c:v libx264 -preset ultrafast -tune stillimage -pix_fmt yuv420p \\\n -c:a aac -b:a 192k \\\n -shortest \\\n song_video.mp4\n\n\nKey flags:\n- -framerate 1 = 1fps still image (fast encode, small file)\n- Alignment=10 = centered bottom (subtitle position)\n- PrimaryColour=&H00FFFFFF& = white text\n- OutlineColour=&H00000000& = no outline (clean look)\n- MarginV=120 = 120px from bottom\n\nQuick duration check:\nbash\nffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 song.mp3\n\n\n## Recommended Flags for Quality Output\n\nbash\nmmx music generate \\\n --prompt \"Warm acoustic ballad, mandopop, male vocalist, gentle fingerpicked guitar with soft strings, intimate and reassuring\" \\\n --lyrics-file song.txt \\\n --vocals \"warm male vocal, gentle and comforting\" \\\n --genre \"folk ballad\" \\\n --mood \"warm, comforting, reassuring\" \\\n --out song.mp3\n\n\n## Model Options\n\n| Model | Description |\n|-------|-------------|\n| music-2.6 | Recommended (latest) |\n| music-2.6-free | Unlimited free tier (default) |\n| music-2.5+ | Previous generation |\n| music-2.5 | Legacy |\n\nUse --model music-2.6 to force the latest model.\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API returns “invalid model” | Use mmx CLI instead of direct API calls |\n| API returns “cannot use music-02 params” | Same — use mmx CLI |\n| Lyrics not being sung | Make sure tags are on separate lines with no extra text inside brackets |\n| URL output fails | The API may not support URL mode for music — use --out instead |\n\n## File Location\n\nGenerated files save to current working directory. Use absolute paths:\nbash\nmmx music generate ... --out /data/data/com.termux/files/home/downloads/song.mp3\n\n”}