[fixed 2.1 final] LineInDevice + Ext MIDI PDC Issues

Hi,

I am having some problems using Plugin Delay Compensation feature. The problem is
it is not working as expected for me.
What I was expecting is that any plugin would be delay compensated when needed but
in pratice timing issues arise under various circumstances (example below).

Also, when PDC is activated, delays are applied even when the song is not playing.
This is an odd behaviour and while almost not noticeable when small delays are
involved, it becomes annoying with bigger delays.
Since it is not possible to play different instruments at once in Renoise as of yet (to my knowledge at least),
I see little or no interest in compensating instruments when not playing the song. There is an exception, though, is
when using samples with VSTis. Would’nt it be possible to have an option to ativate/deactivate PDC when song is playing/stopped?

Now here is the test I have done and the problems that arised:

Setup:
Track 1 - External synth (LineRet)
Track 2 - Drum sample + FX: Waldorf AFB over USB (Delay has to be compensated)
Track 3 - Native VST bass synth
(Track 4 - PPG Red VSTi on Waldorf AFB over USB (Delay has to be compensated))

I am using a simple pattern with notes on lines 01/08/16 …

Everything is playing fine until I add Track 2, with a compensated plugin.
Track 1 is now played too early. Adding a delay of +21.25ms (max delay in PDC window / 4, don’t ask me why…)
on Track 1 makes the timing tight again. PDC, though, worked for track 2 and 3.
Please note that adding that same FX on track 1 instead needs no manual compensation.

Next step, I add a synth (Track 4) from Waldorf AFB over USB (Delay has to be compensated).
I have to increase the delay to +85.03 on Track 1 in order to have a correct timing.

Now I add a new compensated FX on track 4. Timing is still right. Note that
I have been using always the same FX (multiple instances)

Now I add another instance of the same FX on Track 4 (now there are two compensated
plugins chained). I have to put a delay of -21.25 on Track 4 to correct the
timing.

I am now adding a third instance of the same plugin on Track 4. The timing is
right between Track 2 - 3 - 4 but not track 1 (external synth). This one is too
early again. To make it sound right again I have to add another 85.03 delay on
Track 1. Since the delay on track 1 is already at 85.03 (and max is 100), I have to put a negative
delay on every other track. This won’t work for Track 4 since it already has a -21.25 delay so I am
reaching the limits (well, I could add ~15 to track one and thus would be able to fully compensate
but this is an example).

Ok, now I am reverting to the original state of the Track 4, ie. only the PPG Red compensated plugin
with no FX and reseted delays (only 85.06 on Track 1, all other tracks 0).

I have been using the same FX up to now. I am adding a new FX on Track 3, for example.
The timing is wrong again. I have to put a delay of -85.03 on track 3 and then the
tracks 2-3-4 are correct again. Though track 1 is not playing on time with them.
Lowering the delay to 42.5 on track 1 solves the timing problem.

Please note that I am correcting the delay by guessing what the value could be and
by ear so the values might not be the best for exact timing.

Ok, I don’t know why this is happening but it is happening.
As a comparison, I tested this on both Cubase 5 and Cockos Reaper 3 and encountered none
of the problems above.

Anybody experienced these same problems?

Thanks

I’m not quite sure I did understand all this.
But what is the setup with the external synth?
Do you trigger the synth from renoise?
If you do, then you have to specify the correct ‘Midi Instrument Type’ in the ‘Midi Properties’ for that instrument.
This setting have to match the LineIn Latency mode for the external synth.
Then you should not have to adjust anything more then once.

Please try changing those two settings, and see if that helps.

I have done a little video to show how the Line In goes offbeat with no apparent reason and when it should not:

Video

More precisions on the hardware Waldorf AFB: it is not a DSP box, it is an analog filter bank. The audio goes through and comes back over USB. For the host, this should not change anything in the way PDC is handled.

I tried to reproduce the scenario found above but it is not exactly the same.

The first timing issue that I correct by a delay of 21.25 is not obvious to hear in the video but it is here. It is more obvious when the PPG Red is added later.

So to summarize, the PDC is not working when an external synth is used, the following problems arise:

  • timing issues when adding different PDCed plugins
  • timing issues when chaining various PDCed plugins

Though, as far as I can tell, when working with native plugins, there is not problem chaining or using such plugins. I even tried using Creamware XTC plugins and they worked flawlessly with PDCed plugins (well they are sort of native despite them being DSP powered).

I hope this helps

Thanks

Your midi instrument is set to Ext. Midi…? (can’t tell because your movie does not show this)
What happens if you set this to “Line-in ret” ?

It is always hard to guess latency from external material, this is not something Renoise cvan anticipate on, you can only tell Renoise how much it should incorporate delay from an external device by manually changing the track-delay.
Once you have done that, it should work out but you have to make sure to change the track-delay of the track that matters (in your case i would have expected you would change the trackdelay of your external instrument track, not the track where you use the discovery plugin)
edit:Sorry, didn’t looked too carefully: you did changed the track-delay of your external device, so in that case you acted correctly:there is no real way to let Renoise figure this part out by itself

Another thing where PDC does not work correctly is if plugin delays are wrongly submitted to Renoise, Renoise can only compensate correctly if it gets the correct delay values from the plugins, if the plugin fails to, there is not much other to manually correct in that case then.

Hi,

Thanks for the hints, unfortunately I don’t think any of these reasons explain this problem.

  1. The instrument used is set to LineRet, which seems to be the most appropriate value for the setup.

  2. I understand that external hardware delay cannot be accurately calculated. Though, I don’t think it is the problem here since the timing is right before adding a plugin that needs PDC.
    Anyway, if there was a delay, it should remain the same no matter what plugins I add to the project. Here, the delay has to be compensated almost everytime a add a delay compensated plugin.

  3. For sure, the hardware has to give correct delay information. It is the case, the plugins are correctly compensated when I don’t use an external synth (actually, it is only the external synth track that is not correctly compensated). Moreover, I tried this in Cubase 5 and Reaper 3, and correct information is given to the host, why not in Renoise?
    Finally, starting from a situation where timing is right, why should I end up with a track totally off-beat simply because I added some plugins? If the timing was wrong in the first time, then I understand I would have to manually correct it.

After all these tests, it seems that PDC as no or little effect on external synths.
Because, everytime I add a plugin, I have to correct the delays. Moreover, the ext. synth always plays too early: does this not point that other plugins were compensated but not the line-in?
Another interesting thing is that if I add only one plugin on the external synth track, then the timing is still right (the track is too early by the same amount of delay added by the plugin…)

Thanks

Just a quick thought… I’ll take a closer look at the problem later…
But do you use both midi out and Line-in on the same track?
If so, could you try to split them into two tracks. Keep the Line-In on a separate track without any midi.

Looks like the real latency from the Waldorf AFB are not the ones it claims to have - reports to Renoise.

Breakthru: Looking at your video, if I understand this correctly, if you leave away the external MIDI instruments, just use sampled instruments or VSTis, you also get wrong compensated audio as soon as you use the Waldorf plugins, don’t you? Are you sure that this only happens with the LineInDevice?

Have you tried to set or unset the static buffers option for all the AFB plugins?

Oh, wait. Breakthru is right. I have no external synths anymore, but emulated his setup with soundflower on OSX and could easily replicate the problem.

External MIDI instruments which are routed back via a LineIn Device are not compensated correctly, while VSTis, samples and external MIDI instruments which are not routed back via a LineInDevice are correctly compensated.

Thanks a lot for the detailed descriptions Breakthru. This is fixed now…

To be sure that I’ve not mixed up something: Could you both, Pysj and Breakthru please verify:

The problem is that the “#LineIn Device” latency modes are flipped. “MIDI Return Mode” behaves like “Live Recording Mode” and vice versa. So “MIDI Return Mode” currently does not compensate latency while it should, and “Live Recording Mode” does compensate latencies, while it should not.

You could test this by:

  • setting all track delays to 0 first
  • then set the “#LineIn Device” that gets feed with the MIDI from Renoise to “Live Recording Mode”

Is the latency correct when using these settings?

You are right taktik, “Live Recording Mode” compensates the delay.

There are no more problems adding several plugins and chaining them.

The one thing that is still strange is that using “Live Recording Mode” the Line-In track is still played a bit early. I have to add 21.25 ms for the track to be on time.
This is strange because I don’t need to delay the track before adding compensated plugins.

But this way it is already much better because the delay is only set once.

Thanks for investigating and finding the problem!

When adding:
Track 1: LineInDevice with External MIDI notes
Track 2: Adding a VSTi or Sample Instrument with 2 Waldorf instances

Do you then have to delay the first track by 42.5 ms? Probably the 21.25 ms do come from the plugin, it uses more latency than it reports?

Moved from 2.1 forums, as this still needs some attention:

I could not replicate this here so far, but are these 21ms really only needed as soon as you add a plugin with latency into the chain?
Or are they simply always needed when playing back ext MIDI via a LineIn Device together with VSTis & Samples.

If the latter is the case: the driver or HW may have some latencies which you have to register manually then. But 21ms is quite a lot.

I will do some more test. would be great if someone else with MIDI HW could help us out here…

When working with external synths and native VSTs there is no problem. As soon as I add one plugin from the Waldorf AFB, I have to add a 21.25 delay to every track with LineIn in order to correct the timing. Then there are no more timing problems.

I don’t know if it is an hardware specific problem but I doubt it is since I don’t have this problem when working with other hosts.

I tried to do the test with my Creamware XTC plugins but the delays are much smaller, and it is difficult to tell if the timing is wrong.

I will try to find more details on this problem…

Thanks