Been busy at work and haven’t had a ton of energy for this project, but got a start this morning on getting things ready to incorporate antirez’s linenoise as a built-in command repl.
I made some revisions to the command types astrid supports:
-
q(quit) was previouslyk(kill) but does the same thing: clean shutdown. -
u(update) is still for param updates. this needs a new parameter parser which readskey=valuestyle strings and turns them into instrument or ugen param constants based on a lookup table. At the moment the message arrives empty, but triggers the update param callback in the instrument script. -
p(play) is still the command to execute an async render and schedule it for playback immediately. I was considering changing it tor(render) but play seems a little more intuitive? -
s(schedule) was previously (stop) for voice stopping, but that doesn’t make sense any more. Sequences are scheduled through the trigger callbacks now, not the older built-in looping abstractions. This is an alternate async render command which takes an onset time in the future and schedules the render so that the playback will begin as close to the requested time as possible. This also needs a new param parser in C as these things were previously parsed out in cython. -
t(trigger) executes the instrument’s trigger callback. In the cython version of this, the callback returned a list of events that were scheduled immediately. I’m still thinking about the C version. Could just be calls to the message scheduler with the samenowfrom inside the callback. -
m(message) is unimplemented, but inside the forthcoming instrument linenoise repl we could use it likem foo pto trigger a play message on the foo instrument. Needs some thinking though. The important bit here is just to provide a message type that the trigger callback can use to communicate on other instrument message queues.
For a moment I thought I had a deadlock on the message listening thread and the scheduler priority queue thread, but I was just accidently calling the shutdown routine twice, which tried to join on the same threads twice and created a deadlock.