bformdec1
Prev | Orchestra Opcodes and Operators | Next

## bformdec1

bformdec1 — Decodes an ambisonic B format signal

## Description

Decodes an ambisonic B format signal into loudspeaker specific signals.

## Syntax

    ao1, ao2 bformdec1 isetup, aw, ax, ay, az [, ar, as, at, au, av \
          [, abk, al, am, an, ao, ap, aq]]

    ao1, ao2, ao3, ao4 bformdec1 isetup, aw, ax, ay, az [, ar, as, at, \
          au, av [, abk, al, am, an, ao, ap, aq]]

    ao1, ao2, ao3, ao4, ao5 bformdec1 isetup, aw, ax, ay, az [, ar, as, \
          at, au, av [, abk, al, am, an, ao, ap, aq]]

    ao1, ao2, ao3, ao4, ao5, ao6, ao7, ao8 bformdec1 isetup, aw, ax, ay, az \
          [, ar, as, at, au, av [, abk, al, am, an, ao, ap, aq]]]

## Initialization

Note that horizontal angles are measured anticlockwise in this description.

isetup –- loudspeaker setup. There are five supported setups:

- 1. Stereo - L(90), R(-90); this is an M+S style stereo decode.
- 2. Quad - FL(45), BL(135), BR(-135), FR(-45). This is a first-order `in-phase' decode.
- 3. 5.0 - L(30),R(-30),C(0),BL(110),BR(-110). Note that many people do not actually use the angles above for their speaker arrays and a good decode for DVD etc can be achieved using the Quad configuration to feed L, R, BL and BR (leaving C silent).
- 4. Octagon - FFL(22.5),FLL(67.5),BLL(112.5),BBL(157.5),BBR(-157.5),BRR(-112.5),FRR(-67.5),FFR(-22.5). This is a first-, second- or third-order `in-phase' decode, depending on the number of input channels.
- 5. Cube - FLD(45,-35.26),FLU(45,35.26),BLD(135,-35.26),BLU(135,35.26),BRD(-135,-35.26),BRU(-135,35.26),FRD(-45,-35.26),FRU(-45,35.26). This is a first-order `in-phase' decode.

## Performance

aw, ax, ay, ... -- input signal in the B format.

ao1 .. ao8 -– loudspeaker specific output signals.

## Example

Here is an example of the bformdec1 opcode. It uses the file bformenc1.csd.

Example 59. Example of the bformdec1 opcode.

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
    ; Audio out   Audio in    No messages
    ;-odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
     -o bformenc.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 8

    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 bformenc1 anoise, kalpha, kbeta, kord0, kord1, kord2

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

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

    </CsInstruments>
    <CsScore>

    ; Play Instrument #1 for 20 seconds.
    i 1 0 20
    e

    </CsScore>
    </CsoundSynthesizer>

## See Also

bformenc1

## Credits

Author: Richard Furse, Bruce Wiggins and Fons Adriaensen, following code by Samuel Groner
2008

New in version 5.09

Prev | Up | Next
bformdec | Home | binit