6. Creating Custom Panner
Remember that to use an abstract panner in Asset Manager, we use project.panner~
object and specify the panner patch in the project config file (see the patch
variable under the Panner section). Panner patch is simply a wrapper around a panner and a custom panner can easily brought inside Asset Manager. This section shows how that work.
First part shows the simple cookbook in bullet points. Details of each point is covered later.
6.1 Overview
- Create an object
project.panner.in~ #1 #2
. If the panner expects custom arguments, offset the hash number appropriately. Left outlet goes to the signal input, center outlet goes to the control input and right outlet goes to the coordinate input. - Create an object
project.panner.out~
with arguments starting from1
up to appropriate number of outputs that your panner expects. - Connect the outlets of your panner to
project.panner.out~
. - To create a custom panner with variable output channel count, see the example panners in
_common/Projects/_lib/abs/panner.3d
.
6.2 project.panner.in~
project.panner.in~
provides the mechanism for getting audio from project.panner~
to your custom panner. It expects two arguments, which is typically #1 #2
if your panner does not expect any arguments. If your panner does expect any arguments (e.g. to dynamically set the number of outputs), then the hash number should be offset by the number of arguments you expect. In other words, if you expect two arguments, project.panner.in~
should be instantiated with arguments #3 #4
and you can use #1 and #2 to customize your panner.
By convention, left outlet contains the signal and right outlet contains the coordinate. What exactly happen is that the left and right inlets of proejct.panner~
are mapped one-to-one to the left and right outlets of project.panner.in~
. Therefore, the right outlet for the coordinate is project dependent and the project and panner must agree on the same convention.
Center outlet, however, is specifically used to customize the panner for each project when it is instantiated. In other words, messages from the center outlet are outputted only once per panner object that is created. Remember that you can set msg
variables in the Panner section of project config file? These msg
s are parsed and sent through this center outlet. This allows each project to have a unique panner setup. For example, the following defines a 8 channel equidistant speaker setup using panner.3d.vbap
patch.
msg = define\_loudspeakers 2 0 45 90 135 180 225 270 315
If you're familiar with Dr. Ville Pulkki's vbap
object, define\_loudspeakers
is a message that vbap
object expects to setup loudspeaker setup. Not so surprisingly, panner.3d.vbap
is a simple wrapper around vbap
.
6.3 project.panner.out~
Once you process the signal coming from project.panner.in~
, you need to output the signal to the speakers. At this stage, Asset Manager does not recommend using something like dac~
because Asset Manager provides layers of abstraction that help organize the project's signal flow. Simply use project.panner.out~
just like how you would use dac~
with the channel index starting from 1
.