Sandbox
@emicklei/melrose

Melody programming tool for MIDI playback

Melrōse is a command-line music tool that lets you write melody expressions, loop them, and play them through MIDI devices. The repo also includes a custom DSL, playback and timing logic, and a MIDI server entry point.

213 stars17 forksGoUpdated 6d ago
Who it's for

People who want to write melodies in code and hear them through MIDI devices.

What it delivers

You can edit musical patterns while they are playing and hear the changes immediately.

What it does

Custom music language

Lets you describe note sequences, scales, chords, loops, and tracks in a small DSL.

Live sequence changes

Updates note sequences while playback is running for immediate audible feedback.

MIDI playback

Sends programmed music to MIDI output devices and MIDI files.

Command-line tools

Provides `melrose`, `melrose_midi`, and a VS Code-related command under `cmd/`.

MCP server support

Includes a Melrōse MCP server mentioned in the README for receiving expressions to play.

README

Melrōse - programming of music melodies

Build GoDoc

Introduction

melrōse is a tool to create and play music by programming melodies. It uses a custom language to compose notes and create loops and tracks to play. This is an example of a simple major scale C.

sequence('c d e f g a b c5')

Note sequences in your program can be changed while playing giving you direct audible feedback. For the best experience, use the melrōse tool together with the Visual Studio Code Plugin for Melrōse.

See also Blog post

Web

See Melrōse Playground to start writing programs directly in the browser and connect to a local running MIDI receiver, e.g. Apple Garageband.

Install

To have a full experience of the tool in which you can work with multiple devices and files, you can install it locally on our machine. See Build instructions.

Usage

melrōse is a tool to create music by programming melodies and uses a custom language to compose notes that are played with MIDI. Note sequences in your program can be changed while playing which makes it possible to even use it for live performance. For the best experience, use the melrōse together with the Visual Studio Code Plugin for Melrōse.

Read the documentation on how to use melrōse.

Status

The language has reached version 1.0 since tool version v1.0.0 and therefore future changes will only extend it (1.x) and not introduce breaking changes.

Programming music

riboluta-melrose

System setup

melrose-port-daw.png

Melrōse MCP Server

melrose-mcp is a (server) tool that uses the MCP protocol to receive expressions to play. See melrose-mcp for details how to install and use it.

Contributions

Fixes, suggestions, documentation improvements are all welcome. Fork this project and submit small Pull requests. Discuss larger ones in the Issues list. You can also sponsor Melrōse via Github Sponsors.

Software is licensed under MIT. © 2026 ernestmicklei.com

Files in the repo

Repository payload21 top-level entries
  • .github
  • api
  • cmd
  • control
  • core
  • docs
  • dsl
  • midi
  • notify
  • op
  • server
  • system
  • ui
  • .gitignore
  • CHANGES.md
  • go.mod
  • go.sum
  • LICENSE
  • Makefile
  • README.md
  • staticcheck.conf

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More other

🎨 Best DeepSeek Harness Design Plugin. The open-source Claude Design alternative. 🖥️ Local-first desktop app. 🖼️ Your coding agent becomes the design engine: prototypes, landing pages, dashboards, slides, images & video — real files, HTML/PDF/PPTX/MP4 export. 🤖 Claude Code / Codex / Cursor / DeepSeek Harness / OpenCode & 20+ CLIs via BYOK.

95k
tinyhumansai/
openhuman

OpenHuman is an open source personal AI for Mac, Windows and Linux — local-first memory, agent orchestration, and deep research.

40k

Your Personal AI Assistant; easy to install, deploy on your own machine or on the cloud; supports multiple chat apps with easily extensible capabilities.

35k

AIPOCH Open-Science is an open-source, local-first, model-agnostic AI research workbench for macOS, Windows, and Linux, with scientific agents, Python/R notebooks, data connectors, and reproducible provenance.

4k

🤯 LobeHub is your Chief Agent Operator, organizing your agents into 7×24 operations by hiring, scheduling, and reporting on your entire AI team.

82k