Latency compensation not being triggered in daw
-
I have a pitch change plugin which I have added the following line to the interface onit
Engine.setLatencySamples(164)
When I use the plugin in my daw (Mixcraft 10), there's latency.
Did I put the code in the wrong area? -
@pcs800 Where did you get 164 from?
-
@dannytaurus The scrip fx network

-
@pcs800 That looks like it's in ms.
-
@pcs800 If this is Hise's stock Pitch Shift node, AFAIK, this node doesn't have a fixed delay compensation value. The delay amount changes depending on the pitch change.
-
@pcs800
Try getting a value fromEngine.getLatencySamples()EDIT: don't do that. Looks like that call just returns the value set by
Engine.setLatencySamples().Use Tools > Check latency of signal chain to give you a real value.

-
@David-Healey Yeah, good call. It should probably be the
smpvalue, not themsvalue.EDIT: see above

-
@dannytaurus Ok, so put 7232 in instead of 164?

-
@pcs800 Yep, see if it sounds right.
Sanity check: 7232 samples at 44.1kHz = 163.9909297052ms
-
@dannytaurus After adding it, this is what I get with the plugin in a daw.
https://drive.google.com/file/d/1ZrUZcTNQj-GVh9GH7mndqMQTyzoaA_FO/view?usp=sharing
-
@pcs800 As I previously mentioned, the delay is not a fixed value, it depends how much pitch change applied
-
@pcs800 Yep, it's probably like @resonant said - each pitch shift will cause a different latency value. The lower octaves must have less latency and the higher octaves are giving the max 7232 latency. Therefore the lower octaves will come in too early.
Just an idea...
Find the latency of each one by putting it alone in a project. Then when you have all 4 latency values you can compensate.
Example numbers:
Pitch -2 = 4000
Pitch -1 = 5000
Pitch +1 = 6000
Pitch +2 = 7000So the max latency is 7000 samples. Now you know how much fixed delay to add after each pitch node
Pitch -2 needs 3000 delay
Pitch -1 needs 2000 delay
Pitch +1 needs 1000 delay
Pitch +2 needs zero delay
Original needs 7000 delayThat should align all the outputs and as long as you report 7000 (or whatever) to the host, everything should be in time.
That might be all nonsense, but it's worth a try.