- Start a server in the foreground:
$ ALDA_DISABLE_SUPERVISOR=yes alda -v -p 27714 -w 0 server
You should see output like the following:
19-04-13 00:32:31 moondog INFO [alda.server:243] - Binding frontend socket on port 27714...
19-04-13 00:32:31 moondog INFO [alda.server:256] - Binding backend socket on port 34205...
19-04-13 00:32:31 moondog INFO [alda.server:270] - Spawning 0 workers...
-
Take note of the backend port from the server's output. It will be different each time you run the server. In the case of the example output above, the backend port is 34205.
-
Start a worker in the foreground that will talk to the server you just started:
# use the backend port number from the previous step $ alda -v -p 34205 worker
You should see output like the following:
19-04-13 00:37:21 moondog DEBUG [alda.worker:28] - Requiring alda.lisp...
19-04-13 00:37:21 moondog INFO [alda.worker:230] - Worker reporting for duty!
19-04-13 00:37:21 moondog INFO [alda.worker:231] - Connecting to socket on port 34205...
19-04-13 00:37:21 moondog INFO [alda.worker:242] - Sending READY signal.
19-04-13 00:37:21 moondog DEBUG [alda.worker:260] - Got HEARTBEAT from server.
19-04-13 00:37:22 moondog DEBUG [alda.worker:260] - Got HEARTBEAT from server.
19-04-13 00:37:23 moondog DEBUG [alda.worker:260] - Got HEARTBEAT from server.
19-04-13 00:37:24 moondog DEBUG [alda.worker:260] - Got HEARTBEAT from server.
19-04-13 00:37:25 moondog DEBUG [alda.worker:260] - Got HEARTBEAT from server.
- Send a
play
request to the server:
$ alda -v -p 27714 play -c 'piano: c'
In the server output, you should see something like this, indicating that the server is brokering messages between the client and the worker:
19-04-13 00:43:39 moondog DEBUG [alda.server:326] - Forwarding message to worker 09785-110-92...
19-04-13 00:43:39 moondog DEBUG [alda.server:285] - Forwarding backend response to frontend...
19-04-13 00:43:39 moondog DEBUG [alda.server:297] - Forwarding message to worker 09785-110-92...
19-04-13 00:43:39 moondog DEBUG [alda.server:285] - Forwarding backend response to frontend...
19-04-13 00:43:39 moondog DEBUG [alda.server:297] - Forwarding message to worker 09785-110-92...
19-04-13 00:43:39 moondog DEBUG [alda.server:285] - Forwarding backend response to frontend...
In the worker output, you should see something like this, indicating that the
worker processed the play
message and any subsequent play-status
messages
from the client:
19-04-13 00:43:39 moondog DEBUG [alda.worker:278] - Processing message... (command: play)
19-04-13 00:43:39 moondog DEBUG [alda.worker:89] - Starting job b24a2554-73ec-4102-a16c-0e8a38b91972...
19-04-13 00:43:39 moondog DEBUG [alda.worker:281] - Sending response...
19-04-13 00:43:39 moondog DEBUG [alda.worker:91] - Parsing body...
19-04-13 00:43:39 moondog DEBUG [alda.worker:283] - Response sent.
19-04-13 00:43:39 moondog DEBUG [alda.worker:278] - Processing message... (command: play-status)
19-04-13 00:43:39 moondog DEBUG [alda.worker:281] - Sending response...
19-04-13 00:43:39 moondog DEBUG [alda.worker:283] - Response sent.
19-04-13 00:43:39 moondog DEBUG [alda.worker:93] - Parsing history...
19-04-13 00:43:39 moondog DEBUG [alda.lisp.score:9] - Starting new score.
19-04-13 00:43:39 moondog DEBUG [alda.worker:95] - Playing score...
19-04-13 00:43:39 moondog DEBUG [alda.lisp.events.note:58] - piano-znm6U plays at :start + 0 for 450 ms, at 261.63 Hz.
19-04-13 00:43:39 moondog DEBUG [alda.sound:216] - Determining audio types...
19-04-13 00:43:39 moondog DEBUG [alda.sound:218] - Creating sequence...
19-04-13 00:43:39 moondog DEBUG [alda.sound:220] - Creating sequence...
19-04-13 00:43:39 moondog DEBUG [alda.sound:171] - Setting up audio types...
19-04-13 00:43:39 moondog DEBUG [alda.sound:27] - Setting up MIDI...
19-04-13 00:43:39 moondog DEBUG [alda.sound.midi:92] - Using the global *midi-synth*
19-04-13 00:43:39 moondog DEBUG [alda.sound.midi:105] - Using the global *midi-sequencer*
19-04-13 00:43:39 moondog DEBUG [alda.sound:173] - Determining events to schedule...
19-04-13 00:43:39 moondog DEBUG [alda.sound:174] - *play-opts*: {:from nil, :to nil, :async? true, :one-off? false}
19-04-13 00:43:39 moondog DEBUG [alda.sound:146] - from: nil => nil to: nil => nil
19-04-13 00:43:39 moondog DEBUG [alda.sound:157] - Keeping events between 0 and nil.
19-04-13 00:43:39 moondog DEBUG [alda.sound:222] - Playing sequence...
19-04-13 00:43:39 moondog DEBUG [alda.worker:278] - Processing message... (command: play-status)
19-04-13 00:43:39 moondog DEBUG [alda.worker:281] - Sending response...
19-04-13 00:43:39 moondog DEBUG [alda.worker:283] - Response sent.
19-04-13 00:43:39 moondog DEBUG [alda.sound.midi:292] - Handling MIDI-END-OF-TRACK metamessage.
19-04-13 00:43:39 moondog DEBUG [alda.worker:107] - Done playing score.
You should also hear a "C" note played on a piano.