Alda REPL clients and servers communicate using the nREPL protocol, with bencode over TCP as the transport.
Tip
|
You can also send JSON messages via the Alda CLI. For example:
|
Returns information on the Alda REPL server.
- Required parameters
- Optional parameters
- Returns
-
-
ops
- the operations available on the Alda REPL server -
problems
if there were any -
status
-
versions
- Alda version information
-
Parses the provided input in the context of the current score, updates the score with the parse results, and plays any new events that were added to the score.
This is the operation that occurs in an Alda REPL session each time you enter a line of Alda code and press Enter.
- Required parameters
-
-
code
- a string of Alda code
-
- Optional parameters
- Returns
-
-
status
-
problems
if there were any
-
Exports the current score to MIDI and returns the binary data to be saved as a MIDI file.
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
binary-data
- exported MIDI binary data for the current score
-
Returns the list of instruments available to use in an Alda score.
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
instruments
- the list of available instruments
-
Parses the provided input as a new score and loads the score into the REPL server.
- Required parameters
-
-
code
- a string of Alda code
-
- Optional parameters
- Returns
-
-
status
-
problems
if there were any
-
Resets the REPL server state and initializes a new score.
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any
-
Plays back the score currently loaded into the REPL server.
- Required parameters
- Optional parameters
-
-
from
- a string that is either a minute-second marking (e.g.0:30
) or a marker name (e.g.verse
), representing where in the score to start playing -
to
- a string that is either a minute-second marking (e.g.1:00
) or a marker name (e.g.chorus
), representing where in the score to stop playing
-
- Returns
-
-
status
-
problems
if there were any
-
Returns the parsed AST of the current score. (This is the output that you get
when you run alda parse -o ast …
at the command line.)
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
ast
- the parsed AST of the current score, as a JSON string
-
Returns a data representation of the current score. (This is the output that you
get when you run alda parse -o data …
at the command line.)
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
data
- a data representation of the current score
-
Returns the parsed events output of the score. (This is the output that you get
when you run alda parse -o events …
at the command line.)
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
events
- the parsed events output of the current score
-
Returns the text (Alda code) of the current score.
- Required parameters
- Optional parameters
- Returns
-
-
status
-
problems
if there were any -
text
- the Alda code of the current score
-