#live-coding #dsl #sampler

app megra_rs

A live-coding language with Markov chains

12 releases

0.0.12 Mar 17, 2024
0.0.11 Nov 30, 2023
0.0.10 Sep 30, 2023
0.0.9 May 31, 2023
0.0.4 Mar 22, 2022

#84 in Audio

Download history 1/week @ 2024-02-15 8/week @ 2024-02-22 7/week @ 2024-02-29 8/week @ 2024-03-07 131/week @ 2024-03-14 17/week @ 2024-03-21 52/week @ 2024-03-28 26/week @ 2024-04-04

379 downloads per month


20K SLoC


(Versión español: LEAME.md)

Mégra is a domain-specific programming language (DSL for short) designed for live-coding music with stochastic elements. It's implemented in pure Rust. It's development is heavily influenced by the author's own artistic practice, yet it should be fairly easy to learn for anybody else.

The Documentation contains all infos to get Mégra up and running.

Table Of Contents


  • It lets you make music with Markov chains!
  • It follows a sequencing paradigm rather than a modular synth paradigm.
  • It iss a standalone program that comes with its own (simple) editor and synthesizer/sampler.
  • It works with Linux (JACK or PipeWire), Windows 10/11 (WASAPI), and macOS.


  • While it recently feels more like a "real" programming language, it's still far from being "turing-complete".
  • It loads all your samples to memory, so if you have a lot of samples, make sure you have enough RAM.
  • While some work has been done on more complex synthesis, it's still primarily focused on using samples.
  • Except for some basic note names, Mégra doesn't reflect music theory, western or otherwise. There's no scales, scale completions, chords, chord completions or tunings, nor any helpers to work with functional harmony. Maybe there never will be.
  • The editor is fairly primitive (you can use it in REPL mode and integrate in other editors if you want).

These issues are being addressed in no particular order ...


The (english) documentation can be found here:


It contains:

  • Installation & Configuration Info
  • Tutorial
  • Reference

Questions & Feedback

If you have questions, suggestions, or think the documentation could be improved, please open a ticket in the documentation repository:


If you found a bug, or have comments or suggestions regarding Mégra itself, please open a ticket in the main repository:


Don't hesitate to ask any question or post any comment, there's no threshold!

You can also ping me on Mastodon: https://social.toplap.org/@megra

If you made a track with Mégra, you can also post it in a ticket on Github, and I'll collect them in a meta-ticket :). Or you can mention/tag Mégra on Mastodon (see above).

If you want to ask something non-publicly, write me an email! You can find the address in the Cargo.toml file!


~1.5M SLoC