Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Thread Tools Display Modes
Old 06-01-2019, 10:38 AM   #1
Human being with feelings
Join Date: Jun 2019
Posts: 1
Default Latency compensation when bypass (AAX and other)

Hi wdl people !

I think I've found a problem and the solution.

Steps to reproduce:
Using Protools (on Mac OS)
- open Protools and bounce without plugin inserted
- insert a plugin that makes a latency of 3072 samples
- bypass the plugin and bounce
=> the two bounces are shifted in time

In the class NChanDelayLine, in the method ProcessBlock(), replace

signed long readAddress = mWriteAddress - mDTSamples;


signed long readAddress = mWriteAddress + 1;

The problem should be here for other formats that use a delay line when the plugin is bypassed.
It seems that if the plugin latency is 2048 samples for example, there is no such problem.

Hope this helps

Niko-Sound is offline   Reply With Quote
Old 06-05-2019, 07:52 AM   #2
Human being with feelings
Join Date: Apr 2018
Posts: 248

Originally Posted by Niko-Sound View Post
Hi wdl people !

I think I've found a problem and the solution.
I found an issue with this function as well. It did not pass a signal due to the array being written to before being read from. It was also more complicated and confusing than it needed to be. It's a simple rotating buffer - read then write then increment. The corrected code is below:
  void ProcessBlock(double** inputs, double** outputs, int nFrames)
    double* buffer = mBuffer.Get();
    for (int s = 0 ; s < nFrames; ++s)

      for (int chan = 0; chan < mNumInChans; chan++) 
        if (chan < mNumOutChans)
		  double input = inputs[chan][s];
		  int offset = chan * mDTSamples;
		  outputs[chan][s] = buffer[offset + mWriteAddress];
		  buffer[offset + mWriteAddress] = input;
      mWriteAddress %= mDTSamples;
Nonlinear is offline   Reply With Quote
Old 07-09-2019, 09:54 PM   #3
Human being with feelings
Join Date: Jul 2006
Location: Cowtown
Posts: 1,555

Where's the "like" button in this darn thing? Thanks, I just ran into that quite literally today when I changed a plugin's latency from 2048 to 2047 and couldn't figure out why bypass was suddenly screwed up.
sstillwell is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 05:31 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.