iazim -- azimuth angle of the virtual source
ielev (optional) -- elevation angle of the virtual source
ispread (optional) -- spreading of the virtual source (range 0 - 100). If value is zero, conventional amplitude panning is used. When ispread is increased, the number of loudspeakers used in panning increases. If value is 100, the sound is applied to all loudspeakers.
asig -- audio signal to be panned
vbap4 takes an input signal, asig and distributes it among 4 outputs, according to the controls iazim and ielev, and the configured loudspeaker placement. If idim = 2, ielev is set to zero. The distribution is performed using Vector Base Amplitude Panning (VBAP - See reference). VBAP distributes the signal using loudspeaker data configured with vbaplsinit. The signal is applied to, at most, two loudspeakers in 2-D loudspeaker configurations, and three loudspeakers in 3-D loudspeaker configurations. If the virtual source is panned outside the region spanned by loudspeakers, the nearest loudspeakers are used in panning.
Example 398. 2-D panning example with stationary virtual sources
sr = 4100 kr = 441 ksmps = 100 nchnls = 4 vbaplsinit 2, 6, 0, 45, 90, 135, 200, 245, 290, 315 instr 1 asig oscil 20000, 440, 1 a1,a2,a3,a4,a5,a6,a7,a8 vbap8 asig, p4, 0, 20 ;p4 = azimuth ;render twice with alternate outq statements ; to obtain two 4 channel .wav files: outq a1,a2,a3,a4 ; outq a5,a6,a7,a8 endin