#audio #dsl #sampler #livecoding

app megra_rs

A live-coding language with Markov chains

5 releases

Uses new Rust 2021

0.0.5 Aug 1, 2022
0.0.4 Mar 22, 2022
0.0.3 Jan 16, 2022
0.0.2 Jan 9, 2022
0.0.1 Jan 9, 2022

#97 in Audio

Download history 1/week @ 2022-04-18 24/week @ 2022-04-25 28/week @ 2022-05-02 4/week @ 2022-05-09 68/week @ 2022-05-16 18/week @ 2022-05-23 31/week @ 2022-05-30 12/week @ 2022-06-06 2/week @ 2022-06-20 4/week @ 2022-07-04 4/week @ 2022-07-11 8/week @ 2022-07-18 11/week @ 2022-07-25 34/week @ 2022-08-01

57 downloads per month


15K 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. Its predecessor was implemented in Common Lisp, this one is implemented in pure Rust !

This readme should contain all the necessary information to get Mégra up and running.

Table Of Contents


This is still in a relatively early development stage and has some limitations! It hasn't been excessively tested on all platforms.

It's also heavily guided by the author's artistic practice, so some design decsisions might seem odd if you're familiar with other live coding systems.


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


  • It isn't a turing-complete programming language. In fact it's mostly a bunch of hard-coded methods at this point.
  • It loads all your samples to memory, so if you have a lot of samples, make sure you have enough RAM.
  • It's focused on samples. Synthesis is pretty primitive and limited to some basic waveforms at this point.
  • It currently doesn't allow you to create fancy synths unless you want to code them in Rust.
  • Except for some basic note names, Mégra doesn't reflect (traditional) music theory. 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


~516K SLoC