MCPcopy Index your code
hub / github.com/alda-lang/alda

github.com/alda-lang/alda @release-2.4.3 sqlite

repository ↗ · DeepWiki ↗ · release release-2.4.3 ↗
987 symbols 2,735 edges 105 files 505 documented · 51%
README

alda logo

Installation | Docs | Changelog | Contributing

Join us on Slack!

Alda is a text-based programming language for music composition. It allows you to compose and play back music using only your text editor and the command line.

piano:
  o3
  g8 a b > c d e f+ g | a b > c d e f+ g4
  g8 f+ e d c < b a g | f+ e d c < b a g4
  << g1/>g/>g/b/>d/g

For more examples, see these example scores.

The language's design equally favors aesthetics, flexibility and ease of use.

(Why compose music this way instead of in a graphical sheet music notation program? See this blog post for a brief history and rationale.)

Features

  • Easy to understand, markup-like syntax.
  • Designed for musicians who don't know how to program, as well as programmers who don't know how to music.
  • A score is a text file that can be played using the alda command-line tool.
  • Interactive REPL lets you enter Alda code and hear the results in real time.
  • Supports writing music programmatically (for algorithmic composition, live coding, etc.)
  • Create MIDI music using any of the instruments in the General MIDI Sound Set

Planned

If you'd like to help, come on in -- the water's fine!

Installation

See the official website for instructions to install the latest release of Alda.

Building from source

Another option is to build Alda from source. Alda consists of two components: the client (written in Go) and the player (written in Kotlin/Java).

# Clone the repo
git clone https://github.com/alda-lang/alda.git
cd alda

# Build the client and player executables
client/bin/build
player/bin/build

The executables are built in client/target and player/target, and the output of the build commands shows you the path to the built executables, which include builds for various OS/arch combinations.

For more details, see the READMEs in the client and player directories.

Demo

For an overview of available commands and options:

alda --help

To play a file containing Alda code:

alda play --file examples/bach_cello_suite_no_1.alda

To play arbitrary code at the command line:

alda play --code "piano: c6 d12 e6 g12~4"

To start an interactive Alda REPL session:

alda repl

Documentation

Alda's documentation can be found here.

Contributing

We'd love your help -- Pull Requests welcome!

For more details on how you can contribute to Alda, see CONTRIBUTING.md.

Another way you can contribute is by sponsoring Dave in the future development of Alda.

Support, Discussion, Camaraderie

Slack: Joining the Alda Slack group is quick and painless. Come say hi!

Reddit: Subscribe to the /r/alda subreddit, where you can discuss all things Alda and share your Alda scores!

License

Copyright © 2012-2026 Dave Yarwood et al

Distributed under the Eclipse Public License version 2.0.

Extension points exported contracts — how you extend this code

ScoreUpdate (Interface)
The ScoreUpdate interface is implemented by events that update a score. [19 implementers]
client/model/score.go
RepresentableAsJSON (Interface)
RepresentableAsJSON is an interface implemented by types that can be represented as JSON data. [57 implementers]
client/json/interface.go
Transmitter (Interface)
A Transmitter sends score data somewhere for performance, visualization, etc. [2 implementers]
client/transmitter/transmitter.go
PartUpdate (Interface)
The PartUpdate interface defines how something updates a part. [15 implementers]
client/model/part.go
TransmissionOption (FuncType)
TransmissionOption is a function that customizes a TransmissionContext instance.
client/transmitter/transmitter.go
LispForm (Interface)
Alda includes a minimal Lisp implementation as a subset of the language, in order to facilitate adding new features to t [13 …
client/model/lisp.go
DurationComponent (Interface)
DurationComponent instances are added together and the sum is the total duration of the Duration. [6 implementers]
client/model/duration.go
HasSourceContext (Interface)
HasSourceContext is an interface implemented by types that can be linked to a particular place (e.g. line and column) in [30 …
client/model/source_context.go

Core symbols most depended-on inside this repo

mi
called by 129
client/model/instruments.go
expectNodeType
called by 45
client/parser/ast.go
sourceContext
called by 45
client/parser/parser.go
match
called by 41
client/parser/parser.go
Error
called by 41
client/model/source_context.go
Error
called by 39
client/help/errors.go
JSON
called by 36
client/json/interface.go
addToken
called by 32
client/parser/scanner.go

Shape

Method 433
Function 423
Struct 104
Interface 12
TypeAlias 9
FuncType 6

Languages

Go100%

Modules by API surface

client/model/lisp.go105 symbols
client/model/attributes.go64 symbols
client/parser/scanner.go49 symbols
client/parser/parser.go47 symbols
client/model/duration.go31 symbols
client/dev/osc/main.go30 symbols
client/interop/musicxml/importer/importer.go29 symbols
client/repl/server.go27 symbols
client/repl/client.go26 symbols
client/transmitter/osc.go23 symbols
client/model/part.go21 symbols
client/model/attributes_test.go19 symbols

Dependencies from manifests, versioned

github.com/AlecAivazis/survey/v2v2.3.7 · 1×
github.com/OpenPeeDeeP/xdgv0.2.0 · 1×
github.com/VividCortex/ewmav1.1.1 · 1×
github.com/acarl005/stripansiv0.0.0-2018011610285 · 1×
github.com/beevik/etreev1.1.0 · 1×
github.com/chzyer/logexv1.1.10 · 1×
github.com/chzyer/readlinev0.0.0-2018060313265 · 1×
github.com/chzyer/testv0.0.0-2018021303581 · 1×
github.com/daveyarwood/go-oscv0.0.0-2020022901340 · 1×

For agents

$ claude mcp add alda \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact