pan2

pan2 — Distribute an audio signal across two channels.

Description

Distribute an audio signal across two channels with a choice of methods.

Syntax

a1, a2 pan2 asig, xp [, imode]

Initialization

imode (optional) -- mode of the stereo positioning algorithm. 0 signifies equal power (harmonic) panning, 1 means the square root method, 2 means simple linear and 3 means an alternative equal-power pan (based on an UDO). The default value is 0.

Performance

pan2 takes an input signal asig and distributes it across two outputs (essentially stereo speakers) according to the control xp which can be k- or a-rate. A zero value for xp indicates hard left, and a 1 is hard right.

Example

Here is an example of the pan2 opcodes. It uses the file pan2.csd.

Example 599. Example of the pan2 opcodes.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pan2.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

giSine ftgen 0, 0, 2^10, 10, 1

instr 1

kline	line	0, p3, 1     ; straight line
ain	oscili	.6, 440, giSine ; audio signal..
aL,aR	pan2	ain, kline   ; sent across image
	outs	aL, aR

endin
</CsInstruments>
<CsScore>
i1 0 5
e
</CsScore>
</CsoundSynthesizer>


Credits

Author: John ffitch
University of Bath, Codemist Ltd.
Bath, UK
September 2007

New in version 5.07