Classes (extension) | Libraries > JoshUGens | UGens > Multichannel > Ambisonics

FMHDecode1 : BFDecoder : UGen : AbstractFunction : Object
ExtensionExtension

Decode an FMH signal for a specific speaker
 

Description

WARNING: Second-order encoding and decoding has some quirks. Decoding for arbitrary arrays will probably not result in the cleanest results. Often, components need to be discarded depending on the kind of speaker array. See: http://www.muse.demon.co.uk/ref/speakers.html for more information. Some of the more common speaker rigs are pre-done for you according to the specifications from Richard Furse's site.
NOTE: In addition, after a number of conversations with Miguel Negrao (and his contacts with Fons Adriaensen), it is fairly clear that for Second Order decoding to really work well, filtering should be done on the output... for a later date!

Class Methods

FMHDecode1.ar(w, x, y, z, r, s, t, u, v, azimuth: 0, elevation: 0, mul: 1, add: 0)

Arguments:

w

Component of a second order ambisonic signal.

x

Component of a second order ambisonic signal.

y

Component of a second order ambisonic signal.

z

Component of a second order ambisonic signal.

r

Component of a second order ambisonic signal.

s

Component of a second order ambisonic signal.

t

Component of a second order ambisonic signal.

u

Component of a second order ambisonic signal.

v

Component of a second order ambisonic signal.

azimuth

Speaker angle in radians. 0 is front, values should be anti-clockwise (-0.5pi is right, 0.5pi is left).

elevation

Speaker elevation in radians. 0 to 0.5pi is up, 0 to -0.5pi is down.

mul
add

FMHDecode1.ar1(w, x, y, z, r, s, t, u, v, azimuth: 0, elevation: 0, maxDist: 10, distance: 10, mul: 1, add: 0, scaleflag: 1)

Arguments:

w

Component of a second order ambisonic signal.

x

Component of a second order ambisonic signal.

y

Component of a second order ambisonic signal.

z

Component of a second order ambisonic signal.

r

Component of a second order ambisonic signal.

s

Component of a second order ambisonic signal.

t

Component of a second order ambisonic signal.

u

Component of a second order ambisonic signal.

v

Component of a second order ambisonic signal.

azimuth

Speaker angle in radians. 0 is front, values should be anti-clockwise (-0.5pi is right, 0.5pi is left).

elevation

Speaker elevation in radians. 0 to 0.5pi is up, 0 to -0.5pi is down.

maxDist

The distance (in meters) to the furthest speaker from center (this allocates the delay size).

distance

The distance (in meteres) to each speaker.

scaleflag

If 1, apply amplitude scaling to the closest signals to match more distant speakers.

mul
add

The following are some common speaker rigs, with the appropriate components zeroed out:

FMHDecode1.stereo(w, y, mul: 1, add: 0)

FMHDecode1.square(w, x, y, v, mul: 1, add: 0)

stereo pairs - lf, rf, lr, rr

FMHDecode1.quad(w, x, y, v, mul: 1, add: 0)

Clockwise - lf, rf, rr, lr.

FMHDecode1.pentagon(w, x, y, u, v, mul: 1, add: 0)

center front, rf, rr, lr, lf

FMHDecode1.hexagon(w, x, y, u, v, mul: 1, add: 0)

lf, rf, r, rr, lr, l

FMHDecode1.octagon1(w, x, y, u, v, mul: 1, add: 0)

lf, rf, rfs, rrs, rr, lr, lrs, lfs

FMHDecode1.octagon2(w, x, y, u, v, mul: 1, add: 0)

f, rf, r, rr, rear, lr, l, lf

FMHDecode1.cube(w, x, y, z, s, t, v, mul: 1, add: 0)

lfu, rfu, rru, lru, lfd, rfd, rrd, lrd

FMHDecode1.doubleHex(w, x, y, z, s, t, u, v, mul: 1, add: 0)

lfu, rfu, ru, rru, lru, lu, lfd, rfd, rd, rrd, lrd, ld

FMHDecode1.dodecahedron(w, x, y, z, r, s, t, u, v, mul: 1, add: 0)

top, fu, rfu, rru, lru, lfu, fd, rfd, rrd, lrd, lfd, bottom

Inherited class methods

Instance Methods

.checkInputs

Inherited instance methods

Examples

s.boot;

(
{
    var w, x, y, z, r, s, t, u, v, p, a, b, c, d;

    p = PinkNoise.ar;

    // second order B-format encode
    #w, x, y, z, r, s, t, u, v = FMHEncode1.ar(p, MouseX.kr(-pi, pi),
        MouseY.kr(0.25pi, -0.25pi), 1);

    // B-format decode to cube / quad ([lfh, rfh, rrh, lrh, lfl, rfl, rrl, lrl])
    // lfl = left front high, lfl = left front low etc...

    FMHDecode1.ar(w, x, y, z, r, s, t, u, v,
        [-0.25pi, 0.25pi, 0.75pi, 1.25pi,-0.25pi, 0.25pi, 0.75pi, 1.25pi],
        [0.25pi,0.25pi,0.25pi,0.25pi,-0.25pi,-0.25pi,-0.25pi,-0.25pi]);
}.scope(8);
)


// some common speaker rigs
(
{
    var w, x, y, z, r, s, t, u, v;
    #w, x, y, z, r, s, t, u, v =
        FMHEncode1.ar(WhiteNoise.ar,MouseX.kr(0, 2pi), MouseY.kr(-0.5pi, 0.5pi), 1, 0.3);
    FMHDecode1.stereo(w, y);
}.scope(5));

(
{
    var w, x, y, z, r, s, t, u, v;
    #w, x, y, z, r, s, t, u, v =
        FMHEncode1.ar(SinOsc.ar,MouseX.kr(0, 2pi), MouseY.kr(-0.5pi, 0.5pi), 1, 0.3);
    FMHDecode1.pentagon(w, x, y, u, v);
}.scope(5));

(
{
    var w, x, y, z, r, s, t, u, v;
    #w, x, y, z, r, s, t, u, v =
        FMHEncode1.ar(WhiteNoise.ar,MouseX.kr(0, 2pi), MouseY.kr(-0.5pi, 0.5pi), 1, 0.3);
    FMHDecode1.cube(w, x, y, z, s, t, v);
}.scope(8));


(
{
    var w, x, y, z, r, s, t, u, v;
    #w, x, y, z, r, s, t, u, v =
        FMHEncode1.ar(SinOsc.ar,MouseX.kr(0, 2pi), MouseY.kr(-0.5pi, 0.5pi), 1, 0.3);
    FMHDecode1.doubleHex(w, x, y, z, s, t, u, v);
}.scope(12));

(
{
    var w, x, y, z, r, s, t, u, v;
    #w, x, y, z, r, s, t, u, v =
        FMHEncode1.ar(WhiteNoise.ar,MouseX.kr(0, 2pi), MouseY.kr(-0.5pi, 0.5pi), 1, 0.3);
    FMHDecode1.dodecahedron(w, x, y, z, r, s, t, u, v);
}.scope(12));