/media-os:media-musicgen [prompt] [output]from media-os
Generates AI music from text prompts using open-source models (Riffusion, YuE, Stable Audio Open). Supports full songs with vocals, continuation, and stem splitting.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
scripts/musicgen.py generate --model riffusion --prompt "lo-fi hip-hop beat" --duration 10 --out out.wav → Step 3scripts/musicgen.py generate --model yue --prompt "emotional indie rock, male vocalist, 80 bpm" --duration 90 --out song.wav → Step 3scripts/musicgen.py generate --model stable-audio-open --prompt "ambient cinematic strings" --duration 47 --out out.wav → Step 3 (read LICENSES.md first)scripts/musicgen.py continue --in sketch.wav --prompt "build into chorus" --duration 20 --out extended.wav → Step 4scripts/musicgen.py stems --in out.wav --out-dir stems/ → Step 5 (hands off to media-demucs)Do NOT use this skill for:
| Task | Recommended | License | Commercial use? | Vocals? |
|---|---|---|---|---|
| Any, lowest friction, fully permissive | Riffusion | MIT | Yes, unconditionally | No |
| Full song with vocals, best 2025 quality | YuE | Apache 2.0 | Yes, unconditionally | Yes |
| Highest audio quality, instrumental | Stable Audio Open | Stability AI Community License | Yes, up to $1M annual revenue | No |
Full license audit (including excluded models and Stable Audio's $1M ARR cap) in references/LICENSES.md.
# Riffusion (MIT, diffusers-based)
pip install diffusers transformers torch accelerate soundfile
# YuE (Apache 2.0) — HuggingFace transformers based
pip install transformers torch soundfile
# YuE models: m-a-p/YuE-s1-7B-anneal-en-cot (English, chain-of-thought)
# m-a-p/YuE-s1-7B-anneal-zh-cot (Mandarin)
# Stable Audio Open (Stability Community License)
pip install stable-audio-tools soundfile
# (HuggingFace: stabilityai/stable-audio-open-1.0)
Or let the script help:
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py install riffusion
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py install yue
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py install stable-audio-open
Check what's available:
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py check
# Riffusion — fast, MIT, spectrogram diffusion
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model riffusion \
--prompt "dreamy lo-fi hip-hop beat with mellow piano" \
--duration 10 \
--out beat.wav
# YuE — full song with vocals
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model yue \
--prompt "emotional indie rock, male vocalist, 80 bpm, acoustic guitar, simple drums" \
--duration 90 \
--out song.wav
# Stable Audio Open — 44.1 kHz stereo, instrumental
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model stable-audio-open \
--prompt "ambient cinematic strings, slow rise, film score" \
--duration 47 \
--out cue.wav
Per-model limits:
Feed an existing clip as seed; the model continues in style.
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py continue \
--in sketch.wav \
--model stable-audio-open \
--prompt "add energy, build into chorus" \
--duration 20 \
--out extended.wav
Only Stable Audio Open and Riffusion support continuation reliably; YuE's continuation API is less stable.
Delegates to the media-demucs skill.
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py stems \
--in song.wav \
--out-dir stems/
# -> stems/vocals.wav, stems/drums.wav, stems/bass.wav, stems/other.wav
media-ffmpeg-normalize (Spotify -14 LUFS, YouTube -14 LUFS, broadcast -23 LUFS).ffmpeg -i song.wav -c:a libmp3lame -b:a 320k song.mp3ffmpeg -i video.mp4 -i music.wav -map 0:v -map 1:a -c:v copy -shortest out.mp4ffmpeg-audio-filter skill (afade + concat demuxer).references/LICENSES.md."[Verse 1]\n...lyrics...\n[Chorus]\n...lyrics...". See the YuE HuggingFace model card.--seed N for reproducibility. Default is a random seed each run.~/.cache/huggingface/.-ac 2.--chain-of-thought in prompts for non-YuE models. Prompts that reference "Verse 1 / Chorus" etc. confuse Riffusion and Stable Audio Open.uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model riffusion \
--prompt "upbeat corporate bright synth pad, inspirational" \
--duration 10 \
--out intro_music.wav
ffmpeg -i intro.mp4 -i intro_music.wav \
-map 0:v -map 1:a -c:v copy -shortest intro_scored.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model yue \
--prompt "[Verse 1] acoustic guitar picking, soft male vocals about a road trip. [Chorus] full band, big drums, uplifting harmonies, 80 bpm. [Verse 2] same as verse 1 with harmony vocal." \
--duration 90 \
--seed 42 \
--out indie_song.wav
# Generate
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py generate \
--model stable-audio-open \
--prompt "ambient cinematic strings, slow build, film score, Johann Johannsson style" \
--duration 45 \
--out cue.wav
# Split stems for further work
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py stems --in cue.wav --out-dir cue_stems/
# -> cue_stems/{vocals,drums,bass,other}.wav (other will dominate for instrumental)
uv run ${CLAUDE_SKILL_DIR}/scripts/musicgen.py continue \
--in sketch_8bars.wav \
--model stable-audio-open \
--prompt "build into a climax, more energy, bigger drums" \
--duration 15 \
--out sketch_extended.wav
ModuleNotFoundError: No module named 'diffusers'Cause: Riffusion backend isn't installed.
Solution: pip install diffusers transformers torch accelerate soundfile or scripts/musicgen.py install riffusion.
CUDA out of memory on YuECause: YuE 7B needs ~16 GB VRAM in fp16.
Solution: load in int4 / bnb-4bit (--load-in-4bit flag; requires bitsandbytes), shorten duration, or generate on CPU (slow — 30+ min).
Cause: Riffusion's native window is 5 s; longer requires the crossfade-loop which the script normally handles automatically.
Solution: confirm --duration exceeds 5 and that the script version is up to date. Try --model stable-audio-open for native long-form.
Cause: prompt lacks section markers or vocal cues.
Solution: use [Verse 1] / [Chorus] tags and mention vocals explicitly ("male vocalist", "female vocalist", "harmonies").
Cause: overly specific artist / song reference in the prompt. Solution: describe the style instead of the source (e.g. "melancholic 90s grunge with distorted guitars" rather than "a Nirvana song").
Cause: Stability CC access-gated on HuggingFace.
Solution: accept the model license on https://huggingface.co/stabilityai/stable-audio-open-1.0 and huggingface-cli login.
references/LICENSES.md — strict confirmation of commercial-safety, including Stable Audio Open's $1M ARR cap and explicit exclusions of MusicGen / Suno / Udio / Jukebox.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
/audio-pipewireRoute and introspect Linux audio/video/MIDI graphs with PipeWire: pw-cli (interactive object/module control), pw-dump (full graph JSON with --monitor), pw-link (list/create/destroy port links), pw-cat / pw-play / pw-record (playback+record), pw-top (real-time DSP load + xrun viewer), pw-metadata (shared metadata store), pw-loopback (source/sink bridges), pw-midiplay/pw-midirecord, pw-jack (JACK client compat shim), pw-mon, pw-profiler. WirePlumber session manager handles routing/defaults/profiles. Replaces PulseAudio (via pipewire-pulse) and JACK (via libjack.so shim) simultaneously. Use when the user asks to route Linux audio, link two apps, list audio devices on Linux, create a loopback, record system audio, monitor the audio graph, or set up a virtual audio device on modern Linux.
/audio-wasapiManipulate Windows audio via WASAPI (learn.microsoft.com/coreaudio): SoundVolumeView + svcl.exe (NirSoft — set default device, per-app volumes, save/load profiles), AudioDeviceCmdlets PowerShell module (Get-AudioDevice, Set-AudioDevice, Get-AudioDevicePlaybackMute), nircmd setdefaultsounddevice. Shared mode (Windows engine resamples all streams to endpoint fixed format) vs Exclusive mode (bit-perfect, audiophile, ~sub-3ms latency with IAudioClient3 + event-driven callbacks). WASAPI then MMDevice then Audio Engine (audiodg.exe) then WDM/KS. ASIO is Steinberg's parallel stack bypassing Windows audio. Virtual audio devices: VB-Audio Virtual Cable, VoiceMeeter/Banana/Potato. Use when the user asks to change Windows default audio device, route app audio, use VoiceMeeter, install VB-Cable, set a specific device from PowerShell, or enable exclusive-mode low-latency output.
/cv-mediapipeGoogle MediaPipe Tasks API (current supported, NOT legacy mediapipe.solutions): Vision Tasks (Face Detector, Face Landmarker, Face Stylizer, Hand Landmarker, Gesture Recognizer, Pose Landmarker, Holistic Landmarker, Object Detector, Image Classifier, Image Segmenter, Interactive Segmenter, Image Embedder, Image Generator), Audio Tasks (Audio Classifier), Text Tasks (Text Classifier, Text Embedder, Language Detector), GenAI Tasks (LLM Inference — on-device Gemma/Phi-2/Falcon/StableLM). Three run modes: IMAGE, VIDEO, LIVE_STREAM (async). Python: mediapipe.tasks.python.vision/audio/text/genai. Docs at ai.google.dev/edge/mediapipe/solutions. Model Maker for transfer learning. Use when the user asks to detect pose/face/hand landmarks, classify an image, run a body-pose model, segment people, recognize gestures, do on-device LLM inference via MediaPipe, or build a mobile/embedded CV pipeline.
/cv-opencvComputer vision on images + video with OpenCV (docs.opencv.org/4.x/): core (Mat / ndarray, linalg), imgproc (filtering, morphology, geometric transforms, color conv, histograms, contours), imgcodecs (imread/imwrite — PNG, JPEG, TIFF, WebP, EXR), videoio (VideoCapture / VideoWriter — FFMPEG, GStreamer, V4L2, AVFoundation, MSMF backends), calib3d (camera calibration, stereo, solvePnP, homography), features2d (ORB, AKAZE, BRISK, KAZE, SIFT), objdetect (FaceDetectorYN, FaceRecognizerSF, HOG, ArUco, QRCode), dnn (ONNX/TF/Caffe/Darknet, CUDA + OpenVINO + Vulkan backends, model zoo at github.com/opencv/opencv_zoo), photo (inpainting, denoising, HDR Debevec/Robertson), stitching (panorama), video (optical flow Farneback/LK/DIS, BackgroundSubtractorMOG2/KNN, tracking KCF/CSRT/MIL/Nano/Vit/DaSiamRPN). Python-first via cv2. Use when the user asks to detect faces, track objects, run YOLO inference, capture + process webcam frames, calibrate a camera, stitch a panorama, or use OpenCV from Python/C++.
Other plugins' skills for the same job