explaingit

alda-lang/alda

5,897GoAudience · generalComplexity · 2/5LicenseSetup · easy

TLDR

A programming language for writing and playing back music as plain text files, using simple note letter syntax and MIDI for instrument sounds, with an interactive live-coding mode included.

Mindmap

mindmap
  root((Alda))
    What it does
      Text-based music
      MIDI playback
      Algorithmic composition
    Syntax
      Note letters
      Duration numbers
      Octave symbols
    Modes
      File playback
      Interactive REPL
      Live coding
    Tech Stack
      Go client
      Kotlin player
      Java runtime
    Community
      Slack group
      Reddit community
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Compose and play back music by writing note sequences in a text file without a digital audio workstation or notation software

USE CASE 2

Experiment with live coding music in the interactive REPL, hearing notes play instantly as you type

USE CASE 3

Generate algorithmic compositions by using loops and variables in Alda code to produce music programmatically

USE CASE 4

Access all 128 General MIDI instruments in text-based scores without setting up any sound library

Tech stack

GoKotlinJavaMIDI

Getting it running

Difficulty · easy Time to first run · 30min

Installation packages are available on the official website, building from source requires separate build steps for the Go client and the Kotlin player.

Free to use and modify, changes to covered files must be shared under the same license, but combining with other code has relaxed terms under this weak copyleft license.

In plain English

Alda is a programming language for writing music. Instead of using a graphical notation program or a digital audio workstation, you write music as plain text in a file and then run a command to play it back. The syntax is designed to be readable even for people without a programming background. A piece of music in Alda is called a score. You specify an instrument (like "piano"), then write notes using letter names, numbers for duration, and symbols for things like octave changes and ties. The tool reads the file and plays it through MIDI, which is a standard format for computer-generated instrument sounds. Alda comes with access to all instruments in the General MIDI Sound Set. Beyond playing back static files, Alda includes an interactive mode called the REPL, where you type Alda code and hear the notes play immediately. It also supports writing music programmatically, so you can use loops, variables, and logic to generate compositions algorithmically or to experiment with live coding. Alda is built from two components: a client written in Go (which handles the command-line interface and sends instructions) and a player written in Kotlin and Java (which handles audio playback). Installation packages are available on the official website. Building from source requires cloning the repository and running build scripts for each component separately. The project is maintained by Dave Yarwood and distributed under the Eclipse Public License version 2.0. There is a Slack community and a Reddit community for users who want to share scores or get help.

Copy-paste prompts

Prompt 1
Write an Alda score for a simple piano melody of Twinkle Twinkle Little Star using the correct note letter, duration, and octave syntax.
Prompt 2
Show me how to write an Alda score with two instruments playing simultaneously: a piano chord progression and a flute melody layered together.
Prompt 3
Help me use Alda's REPL to live-code a looping bass line that changes pitch on each repetition.
Prompt 4
Generate an Alda score from a Python or Go script that creates a random 8-bar melody using only pentatonic scale notes.
Open on GitHub → Explain another repo

← alda-lang on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.