Lookahead function
Hey all,
I'm building a sidechain-esque plugin that doesn't utilize a compressor. It's essentially just fading the audio on a trigger, but when viewing the audio in an oscilloscope or render it's clear that it's still blocking some of the transients. I've been trying to figure out how to make a lookahead function and I've looked at the komp.maxpatch, etc examples and it doesn't seem to be working or doing anything. I'm sure I'm missing something, I just don't know what. Is it not as simple as just delaying final audio out and reporting the latency to thispatcher?
I hope someone can assist. Thank you!
"Is it not as simple as just delaying final audio out and reporting the latency to thispatcher?"
it is basically that, but not exactly.
you would delay the audio in for the music, while _not delaying the audio in for analysis/creating the control signal of whatever modulator. (or in your case, delay the channel input but not the sidechain input)
by the delay you kind of create a big buffer, which lets you pre-delay the analysis/control signal relative to the audio.
btw, if automatic latency compensation will be useful in any situation is another question.
however, while you build your effect, first leave that part aside until your audio algorithm works, or it can get very confusing.
-110
So the sidechaining and all functions work perfect, it’s just the look ahead is the last part I’m trying to get right.
So I’m building a 10ms look ahead, I’d delay the signal at 44100 and then have a float at 10 and then send the 10 to report the latenct to thispatcher? Ive tried that, but it didn’t have any change whatsoever in the audio processing. I feel like I’m still missing something.
Actually I figured it out! I was being dumb and looking at the ms of latency and not registering that the amount of samples is a different number!
...and use dspstate instead of 44100, then it works in every situation. :)
Yep! On the same page!