Midi AU Fx plugin. Sample Rate from Logic is always 44100



I’m writing a Midi Fx AU plugin. I’m running it in Logic Pro X 10.4.4.
It runs fine when Logic sample rate is 44100. When I change Logic project sample rate to 88200 or 96000 PrepareToPlay() is called but the provided sample rate is always 44100. It is also 44100 in ProcessBlock() even though host runs at 88200.
Since I’m generating midi based on sample rate and bpm (samplesPerTick) my plugin winds up playing at double rate.

i’m currently using Juce 5.3.2 but I also tried 5.4.3.

Any ideas how to get the correct sample rate from Logic?

Any help will be highly appreciated!!



I’m sure someone will correct me if I’m wrong, but I believe Logic resamples that way it never changes the same rate of your device and it’s limited by the sample rates of the device. Therefore you would expect to keep getting called with the sample rate of the device not the project.



Thank you for your reply Anthony!
If I understand you correctly the external device SR stays 44100 but Logic internally works at 88200. This makes sense. However the buffers sent to ProcessBlock() are in the project SR i.e 88200. So if ProcessBlock() runs some SR based calculations they will be incorrect (as it happens in my case). Any idea how to work around this problem?



I’m still struggling with this :frowning:
Am I the only one who encountered this issue?