BFEncode2 Ambisonic B format encoder


BFEncode2.ar(in, point_x, point_y, elevation, gain)


in - input signal

point_x - a point in the x axis

point_y - a point in the y axis

elevation -  in radians, -0.5pi to +0.5pi

gain - a control rate level input.



x, y positions-

0 -1 behind

0 1 in front 

-1 0 right

1 0 left



Output channels are in order W,X,Y,Z.


s=Server.local.boot;

// You'll only hear the first two channels on a stereo setup.

play({ 

#w, x, y, z = BFEncode2.ar(WhiteNoise.ar, MouseX.kr(-2, 2), MouseY.kr(2, -2), 0, 0.3);

//decode for 4 channels

DecodeB2.ar(4, w, x, y, 0.5);

});