parseAsks 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"
}
}
pingPings the server to see if it's up.
{"command": "ping"}
playAsks 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-statusAsks 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-serverTells the server to shut down.
{"command": "stop-server"}
statusAsks the server for its current status.
The response from the server is a string like Server up (2/2 workers available).
{"command": "status"}
versionAsks 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
KILLandHEARTBEAT.- 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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |