1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
class:: PanAz
summary:: Azimuth panner
related:: Classes/Balance2, Classes/LinPan2, Classes/Pan2, Classes/Pan4
categories:: UGens>Multichannel>Panners
Description::
Multichannel equal power panner.
classmethods::
method::ar, kr
argument::numChans
Number of output channels.
argument::in
The input signal.
argument::pos
pan position (code::kr:: or code::ar::). Channels are evenly spaced over a cyclic period of code::2.0:: in pos with code::0.0:: equal to channel zero and code::2.0/numChans:: equal to channel 1, code::4.0/numChans:: equal to channel 2, etc.
Thus all channels will be cyclically panned through if a bipolar sawtooth wave from code::-1:: to code::+1:: is used to modulate the pos.
argument::level
A control rate level input.
argument::width
The width of the panning envelope. Nominally this is code::2.0:: which pans between pairs of adjacent speakers.
Values greater than code::2:: will spread the pan over greater numbers of speakers.
Values less than code::1:: will leave silent gaps between speakers.
argument::orientation
Should be code::0:: if the front is a vertex of the spanning polygon.
The first speaker will be directly in front. Should be code::0.5:: if the front
bisects a side of the spanning polygon.
Then the first speaker will be the one left of center.
section::Comparison to Pan2
Despite a certain similarity, link::Classes/Pan2:: and link::Classes/PanAz:: with 2 channels behave differently.
code::
// one full cycle for PanAz: from -1 to 1
{ PanAz.ar(2, DC.ar(1), Line.ar(-1, 1, 0.1), orientation: 0) }.plot(0.1)
// comparing with Pan2
{ Pan2.ar(DC.ar(1), Line.ar(-1, 1, 0.1)) }.plot(0.1)
// to create one full cycle for Pan2, move from 1 to -1 and back to 1
{ Pan2.ar(DC.ar(1), EnvGen.ar(Env([1, -1, 1], [0.05, 0.05]))) }.plot(0.1)
::
The same in one plot window:
code::
(
{
[
PanAz.ar(2, DC.ar(1), Line.ar(-1, 1, 0.1), orientation: 0),
Pan2.ar(DC.ar(1), Line.ar(-1, 1, 0.1)),
Pan2.ar(DC.ar(1), EnvGen.ar(Env([1, -1, 1], [0.05, 0.05])))
].flat;
}.plot(0.1)
)
::
In other words, while code::Pan2:: needs a position change of code::2:: from channel code::0:: to code::1::
code::
{ Pan2.ar(DC.ar(1), Line.ar(-1, 1, 0.1)) }.plot(0.1)
// we need a position change of 1 in PanAz:
{ PanAz.ar(2, DC.ar(1), Line.ar(0, 1, 0.1), orientation: 0) }.plot(0.1)
::
In one plot window:
code::
(
{
[
Pan2.ar(DC.ar(1), Line.ar(-1, 1, 0.1)),
PanAz.ar(2, DC.ar(1), Line.ar(0, 1, 0.1), orientation: 0)
].flat
}.plot(0.1)
)
::
Examples::
Five channel circular panning with first channel on the left
code::
(
{
PanAz.ar(
numChans: 5,
in: ClipNoise.ar(0.1),
pos: LFSaw.kr(MouseX.kr(0.2, 8, 'exponential')),
level: 0.5,
width: 3,
orientation: 0.5
);
}.scope
)
::
|