max v2;
#N vpatcher 2 51 1016 771;
#P origin 128 61;
#P window setfont Times 10.;
#P comment 379 368 178 1310730 To get the left channel's amplitude \, the right channel's amplitude must be subtracted from a constant 1;
#P window setfont "Sans Serif" 9.;
#P comment 779 308 201 196617 Simple expressions that calculate values between 0 and 1in decimals. Used for Distance and Panning.;
#P comment 834 555 71 196617 Include a Reverb Object to add spatial evironment cues;
#P comment 823 539 106 196617 Reverberation Object;
#P window setfont Times 10.;
#P comment 632 468 124 1310730 To keep a constant overall intensity \, implement a square root of amplitude (makes it clearer);
#P comment 421 551 105 1310730 For intensity panning effects \, each channel's output level was scaled;
#P window setfont "Sans Serif" 18.;
#P comment 444 62 377 196626 3D Sound Spatialization with Headphones;
#P window setfont Times 10.;
#P comment 271 443 96 1310730 Extra Volume Control;
#P comment 435 419 121 1310730 Panning from Left to Right;
#P window setfont "Sans Serif" 9.;
#P comment 768 353 201 196617 DISTANCE Panning from front to back \, as Y-Coordinate gets bigger (meaning the source is getting farther) \, 1 is subtracted and the sqrt is taken to keep a constant overall intensity;
#P window setfont Times 10.;
#P comment 365 504 147 1310730 Combine Sound file with Distance Pannning multiplied by Intensity Panning;
#P window setfont "Sans Serif" 9.;
#P comment 805 210 123 196617 Intensity is loudest at 0 \, 0 and decreases the farther you are from the starting point;
#P comment 814 142 90 196617 When position is Y=20 \, there is no sound since the value has reached its threshold.;
#P comment 582 240 117 196617 Start point at X=0 \, Y=0;
#P newex 708 328 69 196617 expr $i1/20.;
#B color 5;
#P newex 564 329 130 196617 expr (($i1+100)*0.5)/100;
#B color 5;
#P toggle 303 165 15 0;
#P flonum 320 459 35 9 0. 100. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 772 439 130 196617 value of wet (effect) signal (changes as input changes;
#P comment 46 289 250 196617 Purpose of this program is to synthesize the spatial feeling of"3D" sound using techniques such as Panning \, Distance \, and Reverberation. It was very difficult to include HRTF in the program since there are so many data sets. I decided to disregard them and I tried to generalize those values. THough it may not sound perfect for everyone since we all have different shaped heads \, the program does a little bit of what its supposed to.;
#P comment 49 195 193 196617 Instructions of Implementation. 1. User opens sound file 2. Press Startwindow to start audio test 3. Press Stop to stop audio test 4. User can choose to loop file;
#P comment 603 258 85 196617 MOVE LEFT AND RIGHT;
#P comment 721 175 71 196617 MOVE UP AND DOWN;
#P comment 282 207 83 196617 LOOP SOUND FILE;
#P comment 294 136 69 196617 OPEN SOUND FILE TO TEST;
#P comment 720 225 56 196617 min 0;
#P toggle 303 187 15 0;
#P message 323 187 42 196617 loop \$1;
#P button 402 215 18 0;
#P message 500 183 27 196617 stop;
#P message 428 183 65 196617 startwindow;
#P newex 558 632 38 196617 dac~;
#P comment 430 169 73 196617 ¥ start audio;
#P user panel 417 162 119 44;
#X brgb 255 255 255;
#X frgb 100 202 30;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P flonum 564 307 35 9 -100. 100. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 720 130 56 196617 Max 19;
#P comment 511 259 56 196617 -100<-;
#P comment 718 262 56 196617 -> 100;
#P user pictslider 564 125 154 113 4 4 4 4 SliderDefaultKnob.pct 1 SliderDefaultBkgnd.pct 1 2163 0 1376156 100 1. 1.;
#P flonum 708 308 35 9 0. 20. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 717 292 55 196617 Y-COORD;
#P comment 573 290 53 196617 X-COORD;
#P comment 489 96 285 196617 -MOVE THE POSITION OF OBJECT IN WINDOW -OBJECT IS THE POSITION OF SOURCE FROM STARTING POINT;
#P newex 369 214 27 196617 *~ 1;
#P message 323 165 31 196617 open;
#N sfplay~  1 120960 0 ;
#P newobj 369 187 43 196617 sfplay~;
#P message 759 418 41 196617 wet \$1;
#P newex 708 418 24 196617 sqrt;
#P newex 530 506 31 196617 *~ 1;
#P newex 603 473 24 196617 sqrt;
#P newex 563 473 24 196617 sqrt;
#P newex 708 394 27 196617 !- 1.;
#P flonum 708 349 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 759 572 40 196617 *~ 0.1;
#P newex 759 543 55 196617 freeverb~;
#P newex 564 416 27 196617 !- 1.;
#P newex 546 554 27 196617 *~;
#P newex 586 554 27 196617 *~;
#P flonum 564 350 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user panel 41 186 212 90;
#X brgb 209 153 162;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 41 282 260 125;
#X brgb 209 153 162;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 34 0 33 0;
#P connect 16 0 15 0;
#P connect 33 0 15 0;
#P connect 44 0 15 0;
#P connect 15 0 17 0;
#P connect 15 1 32 0;
#P fasten 17 0 12 0 374 493 535 493;
#P fasten 12 0 4 0 535 545 551 545;
#P fasten 13 0 12 1 713 456 556 456;
#P fasten 7 0 29 0 764 620 563 620;
#P fasten 31 0 29 0 505 595 563 595;
#P fasten 30 0 29 0 433 605 563 605;
#P fasten 4 0 29 0 551 579 563 579;
#P connect 5 0 10 0;
#P connect 43 0 4 1;
#P connect 10 0 4 1;
#P connect 22 0 26 0;
#P connect 26 0 45 0;
#P connect 45 0 2 0;
#P connect 2 0 5 0;
#P fasten 12 0 3 0 535 533 591 533;
#P fasten 3 0 29 1 591 573 591 573;
#P fasten 7 0 29 1 764 609 591 609;
#P fasten 2 0 11 0 569 406 608 406;
#P connect 11 0 3 1;
#P connect 43 0 3 1;
#P connect 22 1 21 0;
#P connect 21 0 46 0;
#P connect 46 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 13 0;
#P fasten 8 0 14 0 713 388 764 388;
#P connect 14 0 6 0;
#P fasten 17 0 6 0 374 450 764 450;
#P connect 6 0 7 0;
#P pop;

    Source: geocities.com/rjpaho