Buffersize changes random, but not in prepareToPlay()

Hey there, I have a strage problem.

My Synth Plugin works well in other DAW’s as AU and VST, but in Logic Pro and GarageBand I have some Trouble.

Through debugging the AU in GarageBand (unfortunally i don’t have Logic Pro on my Mac) i found out, that while samplesPerBlock is 1024, the Buffersize in processBlock() is 128. That would be weird enough but it get’s even stranger. When I “activate the processBlock()” through hitting play, the buffersize is immediately on 128, but when i “activate” it through pressing a key on a midi Keyboard, the first and sometimes second buffer has a size of 1024, like the samplesPerBlock in prepareToPlay. But after that one or two buffers, the buffersize switches to 128. But prepareToPlay() gets never called, so all objects still expect a buffersize of 1024.

If somebody has an idea why this happens, or what i should look out for while debugging, i would really appreciate it.

I should have googled more before typing, sorry.
I found this post wich explains why prepareToPlay() is not called.

Now i just have to figure out how to deal with this^^

prepareToPlay gets told the maximum size of buffer to expect. This is so you can allocate sufficient arrays and memory etc.

It’s up to the host how many samples it wants processed and this is passed to processBlock.

2 Likes