XIAODUOLU

XIAODUOLU / Midra

Public

Midra is an agentic prompt-to-code MIDI composition framework for editable and controllable music generation.

16
1
85% credibility
Found May 25, 2026 at 16 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Python
AI Summary

Midra is an open-source music generation tool that transforms plain English descriptions into complete songs. Instead of producing opaque audio files like typical AI music tools, it creates editable MIDI files that you can modify and reuse. The system works by breaking down your music request into a structured plan - figuring out tempo, key, chord progression, and instrument arrangements - then generating the actual notes for each track (drums, bass, chords, lead). It offers two generation modes: one using AI for creative variation, and another using deterministic rules for reproducible outputs. Users can interact through a web interface or command line, and the tool saves checkpoints at each stage so you can review and modify the composition process. The output includes MIDI, WAV, and MP3 files ready for use.

How It Works

1
💡 You discover Midra

You hear about a tool that turns your music ideas into actual songs - no music theory required, just describe what you want.

2
🖥️ You access the web interface

Open the app in your browser where you see a simple form to describe your music and a list of your past creations.

3
🎵 You describe your music idea

Type something like 'generate a 30-second cyberpunk boss battle background music with drums, bass, chords, and lead' - plain English, no technical terms.

4
⚙️ The system plans your song

Watch as the tool figures out the tempo, key, chord progression, and how to arrange each instrument part to match your description.

5
Choose your generation style
🤖
AI-powered mode

Let the AI create unique, creative note sequences for maximum variety and alignment with your prompt.

📋
Rule-based mode

Use deterministic generators for stable, predictable outputs you can reproduce exactly.

6
🎼 Your music comes together

Each instrument track - drums, bass, chords, and lead - is generated and assembled into a complete composition.

🎉 You get your finished song

Download your creation as a MIDI file you can edit, a WAV file for high quality, or an MP3 for easy sharing - your music is ready to use.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 16 to 16 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is Midra?

Midra is a Python framework that turns natural language prompts into editable MIDI files. You describe the music you want -- "30 seconds cyberpunk boss battle bgm with drums bass chords and lead" -- and it generates a complete composition with checkpoints at every stage. The pipeline runs through intent parsing, song planning, arrangement, note generation, and rendering, outputting MIDI, WAV, and MP3 files you can actually open and modify. It ships with both a CLI tool and a web interface backed by a FastAPI service, all containerized with Docker Compose.

Why is it gaining traction?

Most AI music tools produce opaque audio files you can't touch. Midra takes a code-first approach -- every stage produces inspectable JSON artifacts, and the final output is transparent MIDI you can edit in any DAW. The dual note generation modes are the real hook: use the LLM mode for maximum prompt alignment, or switch to rule-based generation for stable, reproducible outputs. The checkpoint system lets you resume interrupted generations without starting over. For developers building music into applications, this debuggability is rare.

Who should use this?

Game developers building procedural soundtrack systems will find the checkpointing and resumable pipeline valuable. Music producers who want AI-assisted composition with editable output instead of baked audio. Researchers exploring controllable music generation with inspectable intermediate states. The CLI makes it scriptable for automation, while the web interface lowers the barrier for non-technical users on a team.

Verdict

This is a promising architecture for prompt-to-MIDI generation with a thoughtful multi-stage pipeline, but the 16-star count signals an early-stage project. The 0.85% credibility score reflects limited community validation -- documentation is present but test coverage and real-world usage reports are sparse. If you want to experiment with agentic music composition or need editable MIDI output for a game or application, Midra is worth a closer look. Just expect to do some exploration: the OpenAI dependency is required, and the project is young enough that APIs and behaviors may shift.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.