Disclaimer...<\/a>
29 \u00a0 desc:Pan, Binaural, v1.1.0
30 \u00a0
31 \u00a0 slider1:0<-120,120,0.1>Pan Angle [degrees]
32 \u00a0
33 \u00a0 @init
34 \u00a0 x=0;
35 \u00a0 x1=0;
36 \u00a0 x2=0;
37 \u00a0 y=0;
38 \u00a0 y1=0;
39 \u00a0 y2=0;
40 \u00a0 d=1.414;
41 \u00a0 who = 0;
42 \u00a0
43 \u00a0 buf = 0; \/\/ buffer exists at offset 0
44 \u00a0 bufposR = 0;
45 \u00a0 delay = 0;
46 \u00a0 bufposW = delay;
47 \u00a0 buflength = 72;
48 \u00a0
49 \u00a0 m = 1;
50 \u00a0 gainL = 0.707106781186547;
51 \u00a0 gainR = 0.707106781186547;
52 \u00a0
53 \u00a0
54 \u00a0 @slider
55 \u00a0 who = slider1;
56 \u00a0
57 \u00a0 \/\/ lo pass pan
58 \u00a0 f = slider1 * 60\/120; \/\/ 0 < f < 60
59 \u00a0 f > 0 ? f = f * -1; \/\/ -60 < f < 0
60 \u00a0 dd = pow(2, f\/12.0)*16000; \/\/ 16,000 -> 500 Hz
61 \u00a0 w = 2.0 * $pi * dd \/ srate;
62 \u00a0 mBeta = 0.5 * (( 1.0 - d \/ 2.0 * sin(w) ) \/ ( 1.0 + d \/ 2.0 * sin(w) ));
63 \u00a0 mGamma = ( 0.5 + mBeta ) * cos(w);
64 \u00a0 mAlpha = ( 0.5 + mBeta - mGamma ) \/ 4.0;
65 \u00a0
66 \u00a0 \/\/ delay pan
67 \u00a0 delay = slider1 * 72\/120;
68 \u00a0 d1 = delay;
69 \u00a0 d1 < 0 ? d1 = d1 * -1; \/\/ absolute value
70 \u00a0 bufposR = bufposW - d1;
71 \u00a0 bufposR < 0 ? bufposR = bufPosR + buflength;
72 \u00a0
73 \u00a0 \/\/ cos pan
74 \u00a0 m = slider1;
75 \u00a0 m = slider1 + 120;
76 \u00a0 m *= 90\/240;
77 \u00a0 gainL = cos( m * $pi \/ 180.0 );
78 \u00a0 gainR = sin( m * $pi \/ 180.0 );
79 \u00a0
80 \u00a0
81 \u00a0 @sample
82 \u00a0 who == 0 ? (
83 \u00a0 \tspl0 *= gainL;
84 \u00a0 \tspl1 *= gainR;
85 \u00a0 ) : (
86 \u00a0 who < 0 ? (
87 \u00a0 \tx = spl1;
88 \u00a0 \tspl1 = buf[bufposR];
89 \u00a0 \tbuf[bufposW] = x;
90 \u00a0 \tbufposR = bufposR + 1 ;
91 \u00a0 \tbufposR > buflength ? bufposR = 0;
92 \u00a0 \tbufposW = bufposW + 1 ;
93 \u00a0 \tbufposW > buflength ? bufposW = 0;
94 \u00a0
95 \u00a0 \tx = spl1;
96 \u00a0 \ty = 2.0 * ( mAlpha * ( x + 2.0 * x1 + x2 ) + mGamma * y1 - mBeta * y2 );
97 \u00a0 \tx2 = x1;
98 \u00a0 \tx1 = x;
99 \u00a0 \ty2 = y1;
100 \u00a0 \ty1 = y;
101 \u00a0 \tspl1 = y * gainR;
102 \u00a0 \tspl0 *= gainL;
103 \u00a0
104 \u00a0 ) : (
105 \u00a0 \tx = spl0;
106 \u00a0 \tspl0 = buf[bufposR];
107 \u00a0 \tbuf[bufposW] = x;
108 \u00a0 \tbufposR = bufposR + 1 ;
109 \u00a0 \tbufposR > buflength ? bufposR = 0;
110 \u00a0 \tbufposW = bufposW + 1 ;
111 \u00a0 \tbufposW > buflength ? bufposW = 0;
112 \u00a0
113 \u00a0 \tx = spl0;
114 \u00a0 \ty = 2.0 * ( mAlpha * ( x + 2.0 * x1 + x2 ) + mGamma * y1 - mBeta * y2 );
115 \u00a0 \tx2 = x1;
116 \u00a0 \tx1 = x;
117 \u00a0 \ty2 = y1;
118 \u00a0 \ty1 = y;
119 \u00a0 \tspl0 = y * gainL;
120 \u00a0 \tspl1 *= gainR;
121 \u00a0 );
122 \u00a0 );
123 \u00a0
<\/p><\/p>Download<\/a>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/217"}],"collection":[{"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217"}],"version-history":[{"count":4,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/217\/revisions"}],"predecessor-version":[{"id":612,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/217\/revisions\/612"}],"wp:attachment":[{"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.auriculaonline.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}