Geert mentioned on this week's hangout that the CV solution with the OSC agent must be introducing unacceptable latency into the system.
I definitely follow his reasoning. The flow is raw OSC out of EigenD over udp network protocol going into MAX where it is sanitized and processed, then going back out of OSC via udp to ExpertSleepers plugin running in Ableton Live, then the expert sleepers plugins convert the OSC messages to CV audio inside of Live.
Stands to reason that this might be unacceptable, but I was saying to him that I had noticed no undue latency at all while playing. So this morning, I decided to try to measure it.
The setup is to measure it at the DAW. Now I know that this is not the same as measuring it at the audio interface which is where the cv ends up, however, it still is revealing.
The biggest surprise is regarding midi. The EigenD patch I'm using is sending both midi and OSC. Midi is going to an IAC internal midi port on OS X and then directly being recorded in Live. You'd expect the midi signal to have less latency than the multi-hop OSC flow, but this is not the case. I thought maybe that Live was doing delay compensation on the audio stream, however changing the audio buffer size in Live does NOT change the difference between the recording of the midi event and the OSC event.
The midi note is arriving 8 ms after the OSC converted cv audio in Live as shown below.
Midi vs OSC cv latency
This was surprising, so I decided to also record a piano sound coming from EigenD into Live via Soundflower. NOTE that there are two buffers involved here. EigenDs sample buffer size AND Live's buffer size. So buffer size is indeed a big factor. If EigenD was sending CV directly to an audio interface then it would involve only EigenDs buffer + the audio interface's buffer. And sending Expert Sleepers CV would add Live's buffer + the audio interface's buffer. So indeed direct out of EigenD would be faster by a buffer size just because of the audio routing involved.
Still, the double hop OSC signal is quite impressive. The midi timing is all over the place. The first OSC signal seems to come at a reliable offset. I don't know if it lags behind later when there is a lot of traffic. I do know that in playing with this a lot. I have yet to lose a note off message, which is something that happens often with midi.
Here are the audio latency differences with OSC CV audio on top and the recorded EigenD piano sound at the bottom with different buffer sizes.
64 sample buffer both sides
256 buffer both sides
512 Buffer Both Sides
The other interesting thing is that Expert Sleepers does seem to be decimating the data conversion. So we are seeing conversions at 10 ms intervals which is much slower than the 2000 events per sec flowing through the network and MAX. Meaning as well, that I can probable start decimating before sending OSC out of MAX.
Now the other big caveat is that someone is going to correct me here on the actual measurements as Live may be doing some delay compensation in recording that I don't understand the ramifications of.