parse
Asks the server to parse a string of Alda code.
Options include as
, which can be one of lisp
or map
, indicating whether the score should be parsed into alda.lisp
code or the final map of score data. When omitted, the default behavior is to parse as lisp
code.
{
"command": "parse",
"body": "piano: c8 d e f g2",
"options": {
"as": "map"
}
}
ping
Pings the server to see if it's up.
{"command": "ping"}
play
Asks the server to play a string of Alda code.
Options include from
and to
strings, representing minute/second markings or score marker names directing the server where in the score to start/end. (When omitted, the score will default to the beginning and end of the score.)
{
"command": "play",
"body": "piano: c8 d e f g2",
"options": {
"from": "chorus",
"to": "5:55"
}
}
play-status
Asks a worker for its current status, e.g. parsing a score, playing a score, done.
Note that this message is sent not to the server, but to a specific worker. To do this, you add an extra frame with the worker's address. For more details, see ZeroMQ Architecture#Message Structure.
{"command": "play-status"}
stop-server
Tells the server to shut down.
{"command": "stop-server"}
status
Asks the server for its current status.
The response from the server is a string like Server up (2/2 workers available)
.
{"command": "status"}
version
Asks the server for its Alda version number.
{"command": "version"}
The server sends 3 kinds of messages:
- Messages forwarded to/from clients and workers.
- One-frame worker control messages like
KILL
andHEARTBEAT
.- Direct JSON responses to client requests that don't need to be handled by workers.
Only the last type is covered here.
{"success": true, "body": "1.0.0-rc42", "noWorker": true}
{"success": true, "pending": false, "body": "playing"}
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close