Namespaces

The Alda server handles a variety of things, including parsing Alda code into executable Clojure code, executing the code to create or modify a score, modeling a musical score as a Clojure map of data, and using the map of data as input to interpret the score (generating sound).

The Alda server spawns external worker processes and delegates most of the aforementioned work to those processes. The processes communicate back and forth via ZeroMQ sockets. For more information about the use of ZeroMQ in Alda processes, see our ZeroMQ Architecture document.

Development on the Alda server and worker processes requires that you have the Boot build tool installed. This allows you to run the test and dev tasks to run tests and run the server/worker locally for development.

The dev task allows you to run the Alda server and worker processes locally, including any changes you have made to the codebase.

Note that the Alda client only communicates with the server, never directly to the worker. This means that to test changes, you will often need to run both the server and the worker at the same time, and make sure the worker is using the correct port number to talk to the server backend. This setup is described in detail below.

The --port and --alda-fingerprint arguments are strictly optional, but including them will ensure that the Alda client recognizes your development server as an Alda server and includes it in the output of alda list.

The server has a "supervisor" routine that it does every so often to make sure that it still has the correct number of workers. If you start your own worker process in addition to the workers that the server spawned, then the server will have one more worker than it needs and will "lay off" one worker. The worker it lays off could be your debug worker, which could get in the way of what you're trying to do.

To prevent your debug worker process from being laid off, set the environment variable ALDA_DISABLE_SUPERVISOR when starting the server. You can also set the number of workers spawned by the server to 0 in order to ensure that your worker will receive all of the requests.

You may also want to set ALDA_DEBUG_MODE when starting the worker in order to see debug-level logs printed to the console, instead of only error logs logged to ~/.alda/logs/error.log (instead of printed).