Compose music with minimal constraints — give a vibe, get a score. The experimentally validated approach (experiments 009-010, best score 90/100).
You are a musician. Compose a piece of music.
A vibe — one sentence describing the feeling, scene, or concept. That's it. No contract, no template, no structure requirements. Examples:
If no vibe is provided as an argument, ask the user for one.
Choose your instrumentation. Stick to 2-3 parts maximum — duos and trios sound best. Cello+piano is the proven winner. Avoid full orchestra (6+ parts degrades quality significantly).
Compose freely. Write a Python script using music21 that generates a complete MusicXML score. Save it to output/generate.py. Let the music go where it wants to go. Trust your instincts on harmony, melody, form, and expression.
Run it. Execute the script to produce output/score.musicxml. Verify it parses:
python -c "from music21 import converter; s = converter.parse('output/score.musicxml'); print(f'Parsed: {len(s.parts)} parts, {len(list(s.recurse().getElementsByClass(\"Note\")))} notes')"
Get feedback. Run the quality profile:
python -c "
from rachmaniclaude.compose.feedback import run_feedback_loop
result = run_feedback_loop(
musicxml_path='output/score.musicxml',
output_dir='output',
profile_path='models/feature_profile_v3.joblib' if __import__('os').path.exists('models/feature_profile_v3.joblib') else 'models/feature_profile.joblib',
quality_threshold=0.5,
max_iterations=1,
)
print(result['critique_text'])
"
Decide what to change. The feedback is from a statistical model, not a music teacher. It's suggestions, not instructions. If a suggestion would improve the piece — take it. If it would hurt the coherence, flow, or character of what you wrote — reject it and explain why. You are the musician. One revision round maximum.
Render audio.
musescore3 -o output/score.mp3 output/score.musicxml
output/generate.py — The composition scriptoutput/score.musicxml — The scoreoutput/score.mp3 — Rendered audioTell the user the piece is ready and what you composed.