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.