AFAIK the summary of the process is correct, but, in 20 years (going on 21), in practice, I havenāt experienced concrete, significant delays on the language side (at least, not more significant than hardware buffer quantization). That includes when I was using a 2002(?)-era MacBook G4 with a single core, where running 8-10 Saw UGens at the same time risked dropouts. Even then, MIDI was pretty well responsive. I never measured carefully for latency, but I could play MIDIIn ā MIDIVoicerSocket ā Voicer and it was usable on stage. At that time, when scsynth was busy, I did see delays in GUI refreshing on AppClock, but I donāt remember significant sequencing delays. (If that were happening, I would have been upset enough about it to switch to other software.)
Now I can easily hit 1000 Saws and have CPU time to burn (~35%!), and sclang is doing its work on another core, so these problems are now a couple orders of magnitude less severe.
My live coding system does the bulk of the algorithmic composition on barlines, so this is something of a worst case for practical sequencing. Based on benchmarking, if Iām running 3 or 4 complex sequencers and a few other simpler ones (like drums), Iād expect maybe 15(?) ms bursts where the interpreter is busy resolving the next barās worth of data. I havenāt been live-playing MIDI notes concurrently, so I canāt give any measurement on that. I do update controller values based on incoming OSC, and I havenāt noticed any unacceptable delays.
GC pauses are theoretically possible but Iāve never seen it in practice, not even on that old G4.
Sure, and controllers would be relatively easy to handle in the server. Note on/off polyphony would be very difficult. You could queue up a number of gate == 0 synths and round-robin distribute notenum, velocity and gates to them, and have the language queue up more of them as those are consumed. The complexity of this logic, however, IMO wouldnāt be worth it if sclangās MIDI response is faster than latency due to the hardware buffer size.
Not to say that your concerns are invalid, not at all, but I havenāt seen sclangās MIDI keyboard response to be any worse than, say, Reaperās.
hjh