# convolution with two channels

Hello all,

maybe you can kindly help me with one little problem I can't solve and can't find anywhere.

I need to apply convolution in the final stage of my instrument, but the opcode pcovolve, or convolve doesn't accept two separeted channels.

I end my instrument with two out channels, aL and aR, but the convolve opcode only accept one ain argument.

My question is: How can I convert my two separated channels, aL and aR, to only one stereo signal, similar to that that could be used as argument in pconvolve ou convolve?

I appreciate any help very much.
Best Regards
P.W.

### Hi Mr. PeterAndTheWolf, i'm

Hi Mr. PeterAndTheWolf,

i'm only a beginner like You, but i think You have at least this two simple way:

make a single ain with ain = aL + aR, that is simple sum, or

You could use two convolve opcode, each for aL and aR, with same parameters, and then You have two single out signal.
But manual says that is more efficient to use only one instance of convolve, and maybe the first way is better.

But i don't know about convolution.

Not so much, but all i know.
ciao,

fran.

### I didn't know that

Hello Mr. Francesco

I used two convolve opcodes, but as the impulses were stereo already, I would have to split them too. That's why I was searching a way to convert my 2 outputs to one stereo signal.

I didn't know that sum (+) had that effect.
I tried and it worked perfectly.

Thank you very much
Best Regards
tchau

### one more thing on that matter please

Mr Francesco,

your answer worked, but raised a little doubt. I understand that the sum of two signals (aL + aR) is the same as mixing them together right? Well, if I have two independent final mono signals, aL and aR, how could (aL + aR) be a stereo signal? How CSound "knows" that the two signals are supposed to go to Left and Right channels of my "ain" signal, and not being mixed in one mono signal?

By the way, I found one example in the manual exactely doing what you've said, but I can't understand it completely.

here is a piece of my code, simplified (without dry and wet stuff)
``` aL, aR soundin "stereoSound.wav", 0 ; two mono signals acvL, acvR pconvolve (aL + aR), "stereoImpulse.wav" outs acvL, acvR ```
I don't get it how the sum in the 2nd line gives us a stereo and not a mono mix of the aL and aR signals. My only explanation is: when you use soundin like in the first line, the aL and aR signals are not mono signals, but stereo signals with just one channel used and the other empty. Is it right?

Thank you all for any help.
peterAndTheWolf

### Dear Mr. PeterAndTheWolf,i

Dear Mr. PeterAndTheWolf,
i think that a sum give us a mono file, i.e. (aL + aR) is mono and not stereo. In Your last example, by me, there is a stereo file to mono and then stereo again outs. I know that when You have a stereo file in one table there are alternated samples, i.e. table has 1 sample left, 1 sample right, and again, but csound can not automatically read this table like stereo (if You read this table with oscil/poscil You will play at half frequency). I think that if You have aL and aR and aout = aL+aR, is different to have outs aL, aR or outs aout, aout , 'cause first is really stereo, and the second is a stereo made with two same mono files.(hope i'm clear enought with my custom language). I'm not so sure but i think that convolve opcode work with mono input files and then output a mono/stereo/.. file.
A little advice: go to http://www.nabble.com/Csound-f480.html, (is community list). There You will find a better help (respect of my micro help!), and You can also search for specific questions (like convolution).

have a good day and work,
ciao,
fran.

### thank you again

Mr. Francesco,

I appreciate your help, things are becoming clear. The point is that the code I put above work, and all the panning of my original "stereoSound.wav" is preserved after convolution. That's why I'm curious about it.

Thank you very much for your help. Don't worry about language. As we both seem to speak neo-latin languages, the structures are alike.

I'm going to check the link you posted.

Best Regards
P.W.
(Brazil)

cheap generic viagra viagra uk zpack Canadian pharmacy viagra kamagra uk buy viagra uk staxyn pharmacy uk z pak Canadian pharmacy cialis online cialis uk viagra online ed pills avanafil ed drugs buy zithromax z pack generic cialis z-pak zpak generic viagra z-pack