bformenc
Prev | Orchestra Opcodes and Operators | Next

## bformenc

bformenc — Codes a signal into the ambisonic B format

## Description

Codes a signal into the ambisonic B format

## Syntax

    aw, ax, ay, az bformenc asig, kalpha, kbeta, kord0, kord1

    aw, ax, ay, az, ar, as, at, au, av bformenc asig, kalpha, kbeta, kord0, kord1 , kord2

    aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq bformenc asig, kalpha, kbeta, kord0, kord1, kord2, kord3

## Performance

aw, ax, ay, ... -- output cells of the B format.

asig -- input signal.

kalpha –- azimuth angle in degrees (clockwise).

kbeta -- altitude angle in degrees.

kord0 -- linear gain of the zero order B format.

kord1 -- linear gain of the first order B format.

kord2 -- linear gain of the second order B format.

kord3 -- linear gain of the third order B format.

## Example

    instr 1
    	; generate pink noise
    	anoise pinkish 1000

    	; two full turns
    	kalpha line 0, p3, 720
    	kbeta = 0

    	; fade ambisonic order from 2nd to 0th during second turn
    	kord0 = 1
    	kord1 linseg 1, p3 / 2, 1, p3 / 2, 0
    	kord2 linseg 1, p3 / 2, 1, p3 / 2, 0

    	; generate B format
    	aw, ax, ay, az, ar, as, at, au, av bformenc anoise, kalpha, kbeta, kord0, kord1, kord2

    	; decode B format for 8 channel circle loudspeaker setup
    	a1, a2, a3, a4, a5, a6, a7, a8 bformdec 4, aw, ax, ay, az, ar, as, at, au, av

    	; write audio out
    	out a1, a2, a3, a4, a5, a6, a7, a8
    endin

## Credits

Author: Samuel Groner
2005

Prev | Up | Next
bexprnd | Home | bformdec