Under Linux, you can also use sched_setscheduler() to set soft-realtime, and
then use nanosleep, which will use a busy loop, and should be able to get 1ms
timing out of it.
Well, to be honest, as long as I can send 10ms worth of events to the
various ports every 10ms…thats all that I need. A 10ms lag time isn’t
hardly noticable by humans…I believe its somewhere in the neighborhood of
50ms lag is noticable…thats what…1/20th of a second? Most humans wont
pick up that. Hell…our eyes see fluid motion at 30 frames per second and
light travles much faster than sound…and since musical events = sound
output, my main concern is not accurately 1ms timing…but more so that
there is no lag between the audio output. I could care less if it was 1
second timing…as long as the resulting audio output is not a noticable
lag. If every 10ms 300 events are sent off to a few midi synthesis plugins
that reproduce those events into audio output…as long as the audio is
smooth and not jacked up due to the timer being too slow…thats fine with me.
The fact is, that if you want high-res timing, it isn’t going to be friendly
with the other processes running on your system.
True. But…I would think most people using my program, if they read my
start up screen(s), etc…will learn that timing is not very precise on
computers…and the better deal is an external timer source via MIDI (which
cant get better than 1ms timing anyways due to the bandwidth of MIDI cables
(31.25Kbps = max 1ms per midi message) ), or to just render the output if
its not a live performance.