I’ve made a simple Colorizer GUI App (I talked about it in a previous post) and now I’m making the VST and AU version.
I use OS X and Cubase 8 Element as host.
When I apply the pugin to a stereo instrument or audio track, it sound good (no noise instead of the app version that is fuzzy), but in I use a mono audio track, the plugin crashes.
A mono instance will only have one channel in buffer, so buffer.getReadPointer(1) will return a nullptr (and trigger said assertion) resulting in the crash you see.
The most important lesson to learn here is not how to fix the mistake in this specific piece of code, but the fact that when you hit an assertion, it’s whole purpose is to help you see what you’ve done wrong!
Thanks, I understood.
I’ve correct the code to have a single output and double (not stereo) output, but the sound is bad…
and if I use a stereo input, i obviously ear only one channel…
Ok, I’ve tried o create the second pointer with the if clause but if I toggle the comments, it crashes in an assert with (destChannels, numChannels);
I have to re-comment the previous comments line?
I don’t understand why i can’t have a mono input and a stereo output…
Should I change in the Processor constructor from .input ::stereo() to .input ::mono() ?
Could be is this a solution?
And the conditional in the right read pointer says in case of mono to read also from the left channel. No need to copy, except if your algorithm is destructive, then you read the modified samples on the second channel…
I do the copy and paste it into your code, maybe that makes it clearer. Note I didn’t try the rest of your code, it’s just about how to acquire the read adresses…
I’ve not tested yet but it seems to be a mono chorus (the output buffer is only one).
I need to maintain a stereo output even with a mono input…
I’ve tried to setup Introducer with {1, 2} but it crashes anyway.