Synthetizer buffer?

#1

Hi I am trying to tell to a Synthetizer (clickSounds) to fill only some of the BufferToFill channels (in this case channel 1),

I tried this way, but I just get ugly noises :

void Click::getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) {

int outputChannel = 1;

bufferToFill.clearActiveBufferRegion();

MidiBuffer incomingMidi;

tempBuffer.setSize (2, bufferToFill.buffer->getNumSamples());

clickSounds.renderNextBlock(tempBuffer, incomingMidi, 0, bufferToFill.numSamples);

bufferToFill.buffer->addFrom (outputChannel, bufferToFill.startSample, tempBuffer, 0, 0, bufferToFill.numSamples);

if for example I replace te synt renderNextBlock() with this : clickSounds.renderNextBlock(tempBuffer, incomingMidi, 0, bufferToFill.numSamples);

and I remove :

bufferToFill.buffer->addFrom (0, bufferToFill.startSample, tempBuffer, 0, 0, bufferToFill.numSamples);

everything sounds good, but plays from all the channels, I want it to be limited to one channel

What I am doing wrong ? What sould I do ?

Thanks in advance