Friendly greetings !
The context is a VST audio plugin.
I’m dealing with an algorithm that, in an ideal world, edit block in the future.
It goes with saying that i cause a “little” problem at the end of a buffer
Soo… i store N sample in N registers, and instead of modifying future data depending of current data, i modify current data depending ot old data stored in the N registers.
And when the next buffer come, i have the last N sample of the previous buffer in my N register and everyone can live happily ever after !
It create latency, it seems to be the way to go but it create a new kind of problem.
- The very first block need special care (as the registers contain undefined data). How do you handle this “first buffer special case” ?
- how to deal with pause, seek, restart or anything that make the N registers obsolete ?
- i came up with this idea of storing data in registers to avoid editing future sample all by myself, i maybe be totally wrong about it ! If so… what’s the way to go please ?
i have trouble finding vst source code that include algorithm that need to access more than the current sample.
Bonus question : the basic template deal with the entire buffer of 1st channel, then process the 2nd channel.
Is there any inconvenient in editing both channel at the same time ?
- channel1 sample 1, channel1 sample2, …, channel1 sample N ;
- channel2 sample 1, channel2 sample 2 …, channel2 sample N. ;
both at the same time :
- channel1 sample 1, channel2 sample1;
- channel1 sample 2, channel2 sample2;
- channel1 sample N, channel2 sample N.
thank you <3