instrument (port) number first; note-sharp-octave notation same as most trackers, but arbitrary number of a single type of parameter
[plugins receive commands more or less exactly as written; meaning is by convention more than anything, but there is a "standard" way of handling notes, handled by a library on the lua side]
- leave pitch bends to automation? or build them as per-tick messages from host? also, stepped by tick or smoothed per sample?
to static link https://stackoverflow.com/a/30235934
graph+node+port system {
dependencies are a straight ordering, worked backwards from the mix output on port hookup change (node local)
this way, we don't bother processing anything that doesn't actually contribute to output in any way
before playback starts, playback thread assembles an expanded queue (graph has a function that recursively expands queue given a ref to a pre-reserved vector)
can use the same logic to count active nodes (make sure to include the graph i/o ports unless implementing those another way? actually yeah, explicit pull operation)
... how will the worker threads tell when they've outpaced the queue, and how will they wait properly?
something something ready flags (all input nodes and containing graph; main graph and command ports always have the bit set)
can use locks on processing node-ports since they'll basically never be contended; this allows for editing during playback
^ or just double-buffer the connections
UI thread takes full responsibility for both replacement and eventual collection; atomic bool marking is enough threadsafety to deflect the collection timer
have to signal playback thread that queues have been invalidated
...or just use locks and a flag since it's probably not worth the added complexity of implementing lockfree to avoid hangups when *fiddling with connections*
though we do want a queue system for plugin parameter changes! don't want xruns from fiddling with instruments or mixing
(most built-in gadgets can avoid this by nature of aligned power-of-two types (<=8bytes) inherently atomic on modern CPUs)