The python wrapper on top of the new C astrid instruments is still acting weirdly. I’m not handling keyboard interrupts properly and messages are getting passed to python in surprising ways sometimes…
Back and forth for a while but I settled on a basic pattern of:
- Handling all messages internally in a C thread, and relaying the appropriate ones to a new external message queue for python
-
Python only handles the messages it really needs to handle:
-
LPMSG_PLAYwhich signals a python render (or also a C render if an async callback is defined on the instrument) -
LPMSG_TRIGGERwhich signals a python trigger callback: this is the main sequencer abstraction in astrid at the moment. this callback schedules future events. -
LPMSG_LOADthis message forces a load/reload of an instrument… but they always get reloaded if the source file changes so this maybe doesn’t really need to exist anymore, it’s a leftover from when astrid had a global reload toggle which if enabled would reload instruments on every new render, or wouldn’t…
-
Something goofy is still happening in the python layer, and I got a plain C instrument to crash on shutdown once! I’m feeling more encouraged about this though, it’s already fun to be able to play with the python instruments a little bit again.
Makes reaching for a python interface to the new unit generator graph feel possible, maybe, too.