1TITLE:: FMHEncode2 2summary:: Second Order Ambisonic encoder 3categories:: Libraries>JoshUGens, UGens>Multichannel>Ambisonics 4related:: Classes/FMHDecode1, Classes/FMHEncode1 5 6DESCRIPTION:: 7 8 9CLASSMETHODS:: 10 11METHOD:: ar 12 13ARGUMENT:: in 14Input signal. 15 16ARGUMENT:: point_x 17A point on the x-axis. 18 19ARGUMENT:: point_y 20A point on the y-axis. 21 22ARGUMENT:: elevation 23In radians, -0.5pi to +0.5pi. 24 25ARGUMENT:: gain 26A control rate level input. 27 28ARGUMENT:: wComp 29Chooses how the W channels is scaled. If 0, a scaler of 0.707 is used. If 1, W is varied according to the scaling of the X, Y, Z, R, S, T, U, and V channels. 1 is the default. 30 31x, y positions: 32 list:: 33 ## 0 -1 behind 34 ## 0 1 in front 35 ## -1 0 right 36 ## 1 0 left 37 :: 38 39note:: 40Output channels are in order W,X,Y,Z, R, S, T, U, V. 41Because of the way the W component is scaled, it is recommended that you only decode with FMHDecode1 and it's methods. 42:: 43 44 45INSTANCEMETHODS:: 46 47METHOD:: init 48 49EXAMPLES:: 50 51code:: 52s.boot; 53 54// You'll only hear the first two channels on a stereo setup. 55( 56{ 57 var w, x, y, z, r, s, t, u, v; 58 #w, x, y, z, r, s, t, u, v = FMHEncode2.ar(WhiteNoise.ar,MouseX.kr(-1, 1), 59 MouseY.kr(-1.0, 1.0), 0); 60}.scope(9)); 61:: 62