Pretty simple question, I think. I have this code:
//create an audio block that points to the data in a buffer (4 channels)
dsp::AudioBlock<float> block(buffer);
//get a single channel
dsp::AudioBlock<float> scBlock = block.getSingleChannelBlock(channel);
//take the block and make it stereo, for conv engine.
????
The buffer has 4 channels in. Channel at this point is 0 so I am getting the first channel and turning it into a block, so I can later use the dsp::convolution engine.
My question: how can I make my single channel audio block into a stereo block where the left and right channels are actually identical (copies of the channel)?
The reason I am asking is because it seems that the convolution engine is not convolving the L and R channels since I am feeding it a mono signal. I was hoping it would get a mono signal and copy it for me.
I am obviously incredibly new at this. If you must, rip me a new one.
I am pretty old at this and still regularly confused with all the audio buffer things in JUCE. Sorry I can’t help you further right now, I’d need to do some test code to understand how to get the behavior you need.
@Xenakios No worries. Thanks for the encouragement. @daniel I will try those methods. I thought about making anew buffer with two channels too but to be honest the documentation is super confusing to me. I guess I will keep trying. My professor said he was willing to help tomorrow. I will update once I find my solution. Thanks!
You should avoid doing that in the process method. A better place to allocate is in the prepareToPlay method.
Also, WorkBuffer or similar might be a bit more descriptive name for the buffer. (I use DummyBuffer or similar if the object truly is something that isn’t really used but is required by some other part in the code.)