Multichannel Panning in ChucK
From CCRMA Wiki
ChucK has two chugins for panning, reflecting two different common strategies. PanN provides 4, 8, and 16 channel panners for equal power 2D panning between speaker arrays. AmbPan provides a 3rd order ambisonics encoder, allowing panning in 3D space. However, you need to route the audio to a proper ambisonics decoder, such as in the CCRMA Listening Room.
Linux ChuGins + ChucK examples
Using the Listening Room
The Listening Room allows you to use either strategy; however PanN/Pan8 only works in 2D, and therefore you will be limited to using the middle speakers, and not the speakers on the ceiling or underneath the floor.
Basic Equal-Power Panning (PanN/Pan8)
To use Pan8, first configure the mixer. Assuming you are running chuck from the Listening Room Linux computer, hit the "Linux" button on the left mixer controller, and make sure that "Ambisonics Decoder Mode" is "Off" on the right mixer controller. Hit the "-15dB" preset on the left mixer controller to set volume levels for each channel to -15dB.
Log in to the Linux computer, and start of course by opening qjackctl and hitting "Start". Open a terminal window and download the panning chugins + examples like so:
Decompress the resulting file:
$ tar xzf 220b-panning.tgz
and then navigate to the new directory that has been created:
$ cd 220b-panning/
To run the Pan8 example, run chuck like this:
$ chuck -c16 -g./PanN.chug Pan8.ck
To configure the mixer for ambisonics mode, hit the "On/Off" switch in the "Ambisonics Decoder Mode" so that it lights up, and make sure that the "3D" button is also on. Now, in your Linux terminal, assuming you have already started jack and downloaded the chugins and examples, run chuck like this to play the example:
$ chuck -c16 -g./AmbPan.chug AmbPan.ck
You can also run Colin's demo if you like:
$ chuck -c16 -g./AmbPan.chug AmbPan3-demosauce.ck