To get a panning effect I know that there is a need for a Circular Matrix. The angle is can be set as a default or I can let the user to select the angle.
So if the angle is $\theta$, the circular matrix will be:
$$ \begin{pmatrix}\cos \theta & \sin \theta \\ -\sin \theta & \cos \theta\end{pmatrix} $$ and the gain is actually set in which channel (Right or Left) the audio will be.
So if I'm sampling the signal from a guitar and get the sequence $X$, all I need to do is to do is to multiply each sample value with the circular matrix?
This operation (multiply each sampled value with the circular matrix) calculates the gain right? So I will know in which channel - right or left to play the signal.
I don't understand when the signal is converted again to analog. After the calculation of the gain? Because if you play with a panning effect, you will hear the sound in the left or the right channel very fast.
I don't understand if it's a multiplication the whole signal with the circular matrix and then just playing it back on the different channels. Or is it actually a multiplication of each sampled value of the signal by the matrix, conversion to analog and then processing of other sampled values.