I think I need to implement a lookahead system in my VST but have never done it before. I know setInitialDelay(foo) is placed in the constructor and then you buffer audio but I'm not sure were a read from for the 'current' audio and for the 'lookahead'.....
Asked
Active
Viewed 635 times
4
-
I think I may have sussed this. I think it's just a matter of setting the delay, writing to the buffer and then reading out at different points – Forge_13 Feb 26 '11 at 10:17
-
although something must be wrong with my buffer as I have a horrible distortion for 10 seconds when I first load my plug-in that subsides to allow normal use – Forge_13 Feb 26 '11 at 10:20
-
solved my distortion my using for loop in constructor to give each array point initialization value – Forge_13 Feb 26 '11 at 10:32
1 Answers
4
So I've laid this all out in my comments but though I should answer this.
I set setInitialDelay() to 100. Then I filled a 100 sample size buffer and read from it at 2 points. The lookahead read from the 0 point where the audio was entering the system. The 'live' audio (that the user hears) was always 100 steps behind the lookahead.
This works well for my requirements. Just make sure that all the array values are initialized otherwise there will be some horrible noise coming out your speakers.

Forge_13
- 113
- 1
- 1
- 10