Audio Unit wrong sample rate in NI Maschine


#1

I’m using JUCE 4.3. Some users reported that the Audio Unit of our plug-in instruments are detuned in Machine 2.6. I think that they work with the wrong sample rate, because the users work with 48000Hz and the pitch is around a semitone higher, but not exactly.
The VST works fine. We update the sample rate in the process block (getSampleRate()) and we don’t have any issues in other hosts.

Anyone noticed the same?


#2

We’ve not had any similar reports.

I’m curious why you’re updating the sample rate in your process block, rather than using the sample rate provided to prepareToPlay. Have you found situations where this was required?


#3

Thanks for the fast response. I do this the last 10 years :slight_smile: It was recommended a few years back. Always thought that getSampleRate() returns the actual used sample rate. I will try to use the sample rate from prepareToPlay.


#4

Getting the sample rate in processBlock should work correctly; I just wanted to find out if you were working around a specific problem that we might be unaware of.


#5

I don’t have a machine 2.6 installed, so i can’t reproduce it at the moment. Not sure if all users are affected, but it seems that it wasn’t an issue the last years. Maybe it has to do with the latest Maschine update.
Does JUCE always have the same sample rate reported in prepareToPlay or do they have different sources and can they be different?


#6

It’s possible that they could be different, but I’m fairly confident that JUCE users would have reported that before now.


#7

Not sure, maybe most users set the sample rate in prepareToPlay… i will try to find out more about it.


#8

Moving the sample rate code into prepareToPlay didn’t help. The AU tuning is still off. I just wonder how it can be that in two user reports the Audio Unit is detuned and the VST not… i have to get maschine and test it by myself.


#9

I had time to reproduce the issue by myself installing the maschine 2 demo.
The JUCE framework delivers the wrong sample rate with the AU instruments. It’s always 44100Hz. The debugger shows that

GetOutput(0)->GetStreamFormat().mSampleRate

always returns 44100Hz in my AU instrument plugins. Didn’t check the FX. The bus configuration of my plugins is the simple {2, 2} config. It works in other hosts. Any help is welcome!


#10

Maybe Machine 2 is reporting the wrong (fixed 44.1kHz) sample rate to AU plugins. IIRC NI Reaktor is a non-JUCE based plugin that reports the sample rate provided by the host. Use Reaktor to figure out if Machine 2 reports the correct sample rate.

Audacity is a host that reports the wrong sample rate to plugins, by the way. https://www.klangfreund.com/support/lufsmeter/manual/#troubleshooting_audacity_sample_rate


#11

Hi Samuel

Thanks for pointing me into the right direction, I already have an open bug report at NI since a few weeks.
Don’t have reactor to test it, but what could be better than using apples AU plugins and AUSampler also have the same issue, while DLSMusicDevice works and changes the sample rate. I have reported this new infos and hope NI will fix that.