I'm not sure, if this is an issue with JUCE or with Ableton Live. But here's what happens: Imagine you want to code a bpm synced tremolo effect that simply multiplies a square-wave (1,1,1,1,0,0,0,0,1,1,1,1,…) to the input signal. For that you'll need the beat position of each sample.
Here's the sample code:
So far so good.
When I now play a long sustained note inside Live and put the Plugin on that track, the tremolo effect is applied in querter notes. E.g. a eighth note on followed by an eighth note off.
But if I set the Buffer Size of the host to the maximum value (2048 samples) and copy the Plugin several times, the Audio that comes through gets shorter and shorter until it completely disapears at eight instances.
The reason for that might be, that Live increases the playhead for each plugin instance in the signal chain. Or maybe there's a Bug on how the PlayHead is updated via JUCE? Never the less, the ppqPos that I get does not represent position in the edit, but shifts from plugin instance to plugin instance by an amount related to the buffer size.
btw. I'm on OSX 10.10 and I am using master (15ddb6699eece43f06d7fde151284fac664026a8).
Has anyone experienced something simmilar? Can anyone spot a bug in my code? The effect is so obvious, that I cannot imagine, that nobody had this problem before - any bmp synced effect should have this problem.
I also tried it in reaper and there it works perfectly - I can add as manny instances as I want and the output stays EXACTLY the same - as I'd expect it to.
Thanks for having a look at it
Edit: I tried it in Live 8 and Live 9.
Another edit: I'm necessarily asuming, that this a bug in JUCE, just curious, if someone else experienced this problem or if I am doing something wrong. Also this is contrived example to illustrate the issue. I stubled upon this issue in a more complex setup.