Midi Input, Audio Buffer Size And Plugin Latencies

I’ve been having trouble with the timing of midi input for some time now, so I decided to do some tests to see if it was due to myself, my hardware, or Renoise. I suspect the main problem is Renoise. Here’s why:

First, I used an empty song and played notes on my mpd24 along with the metronome as best as I could (in all tests, it made no difference if I used the metronome or a quantized part). My audio interface’s buffer size was 5 ms, the tempo was 60, the lpb value was 4, and quantize was off. This went reasonably well, all notes were recorded at around lines 0, 4, 8, etc., some slightly earlier, others later. So far, so good.

Then I tested whether it made any difference if I had the “compensate latencies” option in the midi preferences enabled or not. I didn’t notice any difference, but I figured that’s probably because my own timing errors were greater than the latency involved.

Next, I set my audio interface’s buffer size to a very high value (500 ms) and played along with the metronome again (I used an empty instrument to prevent myself for compensating for the latency). This time the notes were recorded about 500 ms later than the beat: around lines 2,6, 10, etc. I kind of expected this behavior with Compensate Latencies disabled. However, when I enabled it, it seemed to make no difference.

For the last test I set the buffer size back to 5 ms, and put a bunch of effects that introduce a delay on the master channel, so that the total delay was about 200 ms. I again played along with the metronome. As in the previous test, the notes were recorded with a delay, this time of about 200 ms. And again, Compensate Latencies didn’t make a noticeable difference. (Automatic plugin delay compensation was enabled in this test)

This raises two questions:

1)I always assumed that when recording live, Renoise would automatically compensate for the audio buffer size and delays caused by plugins, so that the recording is synced to what I hear. I find it very surprising that as far as I can tell, this does not seem to be the case. So, is this true, or did I overlook something?

2)What exactly does the “compensate latencies” option do? In my tests it didn’t seem to make any difference. It is not mentioned in the manual and I find the description “record what you hear, not played” a bit confusing. What I’d expect such an option to do, is to shift recorded notes backward in time by (audio buffer size + total delay caused by plugins) milliseconds.

I suspect the compensate latencies should compensate for the audio buffer latency of your audio card, but i can image this only works if the buffer is known by Renoise.
In my audiocard preferences i see the audiobuffer settings below to how much latency it is set. If you don’t see any audiobuffer value or it is set to 0, i guess that could be your answer to why changing the checkmark doesn’t make any difference.

Other than that this is something Taktik can provide further information for as this specific option isn’t described in the manual.
I also don’t know if the PDC has an extra influence on this.

I didn’t realize that the audiobuffer size is not necessarily known by Renoise, I just assumed it was. I’ll try it with directsound and asio4all drivers to see if that makes a difference.

If Renoise doesn’t automatically know of the audiobuffer size, then maybe it would be useful to have an option to manually specify it? Something like the ‘extra latency’ setting in the audio recorder.

I have currently no idea how the buffer size is displayed for every card, the preferences screenshot shows the one for my card and the drivers for my card specify the buffersize as such :

If yours is saying 0 then perhaps allowing to fill in the field manually as soon as no delay is given perhaps could resolve it. Still that’s only guesswork from my side, Taktik knows this better for sure.

It says 220 samples (5 ms), so it seems Renoise is aware of the latency.

I get the same results with directsound and asio4all drivers, by the way. Again, Compensate Latencies makes no noticable difference, even at high buffer sizes.

So am I the only one who has this problem? I just did the same test in Reaper and had no problems there: even if I use a 500 ms buffer, midi notes that I play when I hear a metronome click are recorded on each count, not 500 ms later. It seems to me that this is how a sequencer should work and I find it strange that Renoise doesn’t behave this way (unless I’m missing something).

For now, I’m using a script to correct for the timing errors after each recording, but this is far from ideal.

We’ve skipped compensating the raw audio latency, because this seemed to be more counterproductive than being helpful. A good player usually compensates such latencies while playing, by presses keys slightly ahead of time. When compensating this latency, you end up in a wrong recorded time.

Plugin latencies from other tracks, should be correctly compensated with the option set though. Will check if I can replicate this here - if there’s something fishy going on that we need to fix.

I figured the Compensate Latencies option in the midi preferences would let you choose whether or not to compensate for the audio buffer, seeing that there is something to be said for either option. So if that’s not what that option does, then what does it do?

I find that I can only compensate up to certain amount - 10 ms or so. With my not-so-great audio interface I get just below that, but when pdc is involved, the latency quickly gets too high to properly compensate. So I guess I need to start saving for a better audio interface or become a better player.

Regarding pdc, I only tested it with plugins on the master channel, so it’s probably okay. My main problem was with the audio buffer anyway.

It right now only compensates (shifts back, when the option is enabled) the song’s latency caused by plugin delays, but not the audio latency.

Try the following to see/hear the difference: Add a bunch of effects which cause a delay on “Track 01” and make sure PDC is enabled. Then try recording some notes on “Track 01” which will play back all samples delayed when live playing, and “Track 02” which will, while live playing, not delay notes.

It does not really make sense to NOT compensate the audio latency. I think the main reason we left that out, was that the latency reported by the driver is not always reliable. But this mainly is a problem with DirectSound and not ASIO. And also is no problem on OSX or Linux. I’ll get the audio compensation back again for the next release.

Good to hear that, thanks for the info.