## Ambisonic and cartopol simple math question

Mar 10, 2009 at 3:42pm

# Ambisonic and cartopol simple math question

Hello,

I’ve build a simple visual aid with an lcd to set the position of my channels with ambiencode~ from ICST, but i can’t find out how to match their coordinate system where full left, f.e, is -90 and full right is 90 degrees (as shown in the picture in the patch).

Could someone help me a little bit with simple math trick ?

Here’s the patch. Double-click in the [draw_tool] subpatch to find the cartopol thing.

– Pasted Max Patch, click to expand. –
#42767
Mar 10, 2009 at 4:49pm

f.e wrote on Tue, 10 March 2009 08:42Hello,

I’ve build a simple visual aid with an lcd to set the position of my channels with ambiencode~ from ICST, but i can’t find out how to match their coordinate system where full left, f.e, is -90 and full right is 90 degrees (as shown in the picture in the patch).

Could someone help me a little bit with simple math trick ?

Put a swap object between your pack and cartopol objects. See below.

mz

– Pasted Max Patch, click to expand. –
#153113
Mar 10, 2009 at 7:07pm

The ‘ambimonitor’ that works in Max4 is awesome. Is there a reason you have to do it in Max5?

#153114
Mar 11, 2009 at 7:50am

@mzed : there’s a swap.

@dodgeroo : ambimonitor is an ui object that has to be re-wrote with the new api.

best

f.e

#153115
Mar 11, 2009 at 5:11pm
 f.e wrote on Wed, 11 March 2009 00:50 @mzed : there’s a swap.

open the patch I posted. you need one before cartopol.

#153116
Mar 11, 2009 at 8:19pm

but there are now beta releases that are mostly complete:

#153117
Mar 12, 2009 at 8:49am

@mzed, thank you a lot. Sorry i thought you just quote my patch (still kinda confused reading posts since list died). It works perfectly

@tim : as usual, Mac only betas :-/

f.e

#153118
Mar 13, 2009 at 3:48pm

@f.e

ambimonitor is out in beta, but not ambiencode…

I felt free to further modify your draw_tool to draw_tool_waj.
So it works for me.

Note my speaker setup as

1 2
3 4

I also have my own color palette.
I can send it to you by private mail.

max v2;
#N vpatcher -1275 146 -442 935;
#P origin 0 -16;
#P setbglock 1;
#P user meter~ 144 607 157 702 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 114 607 127 702 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 84 607 97 702 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 54 607 67 702 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 144 256 157 351 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 114 256 127 351 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 84 256 97 351 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P user meter~ 54 256 67 351 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P window setfont Monaco 10.;
#N vpatcher -440 145 -100 871;
#P origin -36 -7;
#P window setfont Monaco 10.;
#P window linecount 2;
#P user com 182 524 132 262154 17;
#K set 0 25705 29556 24942 25445 8301 24952 3389 8294 24946 8294 29295 27936 29800 25888 25445 28276 25970;
#K end;
#P window linecount 1;
#P newex 37 610 40 262154 t b l;
#P window setfont Helvetica 10.;
#P user com 0 21 14 1376266 1;
#K set 0 24444;
#K end;
#P window setfont Monaco 10.;
#P newex 37 582 232 262154 sprintf \; quad_pos azi %f \, dist %f;
#P newex 37 387 58 262154 swap;
#P message 149 639 26 262154 set;
#P window linecount 2;
#P message 67 669 167 262154 ; quad_pos azi 179. , dist 6.;
#P window linecount 1;
#P newex 67 639 76 262154 prepend set;
#P newex 37 554 148 262154 swap;
#P newex 37 524 130 262154 scale 0. 100. 0. 10.;
#P comment 84 501 34 262154 dist;
#P flonum 37 500 47 10 0 0 0 4 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 175 495 47 10 0 0 0 4 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 37 416 58 262154 cartopol;
#P newex 175 469 46 262154 * 180.;
#P newex 175 442 70 262154 / 3.141593;
#P newex 37 354 54 262154 pack;
#P newex 81 328 34 262154 * -1;
#P newex 81 301 40 262154 – 100;
#P newex 37 301 40 262154 – 100;
#P newex 37 271 54 262154 unpack;
#P user lcd 37 56 200 200 0 1 1 0 1;
#N vpatcher 20 74 357 461;
#P outlet 38 281 15 0;
#P window setfont Monaco 10.;
#P message 87 247 202 262154 enablesprites 1 , local 0 , idle 1;
#P newex 87 216 58 262154 loadbang;
#B color 8;
#P message 38 168 238 262154 recordsprite , paintoval \$1 \$2 \$3 \$4 9 , closesprite dtc , drawsprite dtc 0 0;
#P newex 38 136 109 262154 pack 0 0 0 0;
#P window linecount 1;
#P newex 137 106 27 262154 + 7;
#P newex 104 106 27 262154 + 7;
#P newex 71 106 27 262154 – 7;
#P window linecount 0;
#P newex 38 106 27 262154 – 7;
#P newex 38 59 109 262154 unpack 0 0;
#P inlet 38 32 15 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P connect 9 0 10 0;
#P connect 1 1 3 0;
#P connect 3 0 6 1;
#P connect 8 0 9 0;
#P connect 1 0 4 0;
#P connect 4 0 6 2;
#P connect 1 1 5 0;
#P connect 5 0 6 3;
#P pop;
#P newobj 37 32 46 262154 p draw;
#B color 6;
#P comment 223 497 52 262154 degrees;
#P fasten 2 0 1 0 42 262 18 262 18 27 42 27;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 19 0;
#P connect 19 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 20 0;
#P connect 20 0 22 0;
#P connect 22 1 16 0;
#P fasten 22 0 17 0 42 663 72 663;
#P connect 18 0 17 0;
#P connect 16 0 17 0;
#P connect 3 1 5 0;
#P connect 5 0 6 0;
#P connect 6 0 7 1;
#P connect 19 1 10 1;
#P connect 10 1 8 0;
#P connect 8 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 15 1;
#P connect 15 1 20 1;
#P pop 1;
#P newobj 287 582 100 262154 p draw_tool_waj;
#B color 6;
#P newex 395 712 70 262154 s quad_pos;
#B color 8;
#P message 395 685 46 262154 azi \$1;
#P user multiSlider 395 662 264 15 -180. 180. 1 2680 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#N counter 0 -180 180;
#X flags 0 0;
#P newobj 395 634 118 262154 counter 0 -180 180;
#P newex 395 606 58 262154 metro 10;
#P toggle 395 582 15 0;
#P newex 167 487 70 262154 s quad_pos;
#B color 8;
#P comment 249 453 70 262154 Full Rear;
#P comment 249 430 70 262154 Left Rear;
#P comment 249 407 70 262154 Right Rear;
#P comment 249 384 70 262154 Full Right;
#P comment 249 361 76 262154 Right Front;
#P comment 249 338 70 262154 Left Front;
#P comment 249 315 70 262154 Full Left;
#P message 186 451 58 262154 azi 180.;
#P message 186 428 64 262154 azi -135.;
#P message 186 405 58 262154 azi 135.;
#P message 186 382 58 262154 azi -90.;
#P message 186 359 52 262154 azi 45.;
#P message 186 336 58 262154 azi -45.;
#P message 186 313 58 262154 azi -90.;
#P message 186 290 46 262154 azi 0.;
#P comment 249 292 70 262154 Full Front;
#P comment 535 234 256 262154 aizimuth is 360 degrees around the circle;
#P comment 535 213 214 262154 distance max = far from the center;
#P comment 535 192 208 262154 distance 0 = center of the circle;
#P comment 375 446 14 262154 4;
#B color 1;
#P comment 499 446 14 262154 3;
#B color 1;
#P comment 499 329 14 262154 2;
#B color 1;
#P comment 375 329 14 262154 1;
#B color 1;
#P comment 430 481 34 262154 180º;
#P comment 439 496 14 262154 |;
#P comment 343 389 34 262154 -90º;
#P newex 254 230 100 262154 ambiencode~ 1 2;
#P window linecount 2;
#P comment 363 230 144 262154 this works with two channels input , also…;
#P window linecount 1;
#P message 462 196 46 262154 ele 0.;
#P message 406 196 52 262154 dist \$1;
#P flonum 406 169 35 10 0 0 0 4 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 327 169 70 262154 r quad_pos;
#B color 8;
#P message 155 543 250 262154 speakers -45. 0. 45. 0. 135. 0. -135. 0.;
#P newex 155 516 40 262154 r LB1;
#B color 8;
#P newex 47 712 101 262154 dac~ 1 2 4 3;
#P newex 47 582 100 262154 ambidecode~ 1 4;
#P newex 47 230 100 262154 ambiencode~ 1 1;
#P user meter~ 57 196 137 209 50 0 168 0 0 0 0 255 153 0 255 0 0 217 217 0 153 186 0 20 3 3 3 3;
#P newex 462 169 40 262154 r LB1;
#B color 8;
#P button 166 196 15 0;
#P comment 234 127 34 262154 loop;
#P comment 200 127 34 262154 play;
#P user led 242 143 17 17 3 150;
#P user led 203 143 17 17 1 150;
#P message 164 143 34 262154 open;
#P user led 285 196 17 17 2 150;
#N vpatcher -1065 617 -225 909;
#P window setfont Monaco 10.;
#P window linecount 1;
#P newex 702 102 46 262154 *~ 0.5;
#P window linecount 2;
#P comment 714 121 34 262154 mono mix;
#P number 306 77 34 10 1 0 5 4 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 246 149 24 40 158 8 1.071519 7.94321 10.;
#P window linecount 0;
#P newex 246 101 70 262154 cycle~ 220;
#B color 9;
#P outlet 676 248 15 0;
#P inlet 638 33 15 0;
#P inlet 618 33 15 0;
#P inlet 588 33 15 0;
#P outlet 752 248 15 0;
#P outlet 18 248 15 0;
#P inlet 702 33 15 0;
#P inlet 360 33 15 0;
#P inlet 474 33 15 0;
#P inlet 18 33 15 0;
#P hidden newex 288 149 52 262154 r ini96;
#B color 8;
#P hidden newex 631 149 58 262154 r ini128;
#B color 8;
#P user gain~ 360 149 24 40 158 8 1.071519 7.94321 10.;
#P newex 360 124 43 262154 click~;
#P number 414 77 34 10 1 0 5 4 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 360 77 14 0;
#P newex 360 101 64 262154 metro 500;
#P toggle 702 55 15 0;
#P user gain~ 702 149 24 40 158 8 1.071519 7.94321 10.;
#P user gain~ 588 149 24 40 158 8 1.071519 7.94321 10.;
#P user gain~ 474 149 24 40 158 8 1.071519 7.94321 10.;
#P user gain~ 132 149 24 40 158 8 1.071519 7.94321 10.;
#P button 676 124 15 0;
#P message 638 77 52 262154 loop \$1;
#P newex 702 77 34 262154 adc~;
#P newex 18 219 694 262154 selector~ 6;
#N sfplay~ 1 120960 1 ;
#P newobj 588 101 99 262154 sfplay~ 1 0 1;
#P newex 132 101 50 262154 noise~;
#B color 9;
#P toggle 474 77 15 0;
#N vpatcher 40 55 469 377;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 86 34 107 196617 © 2001 Tristan Jehan;
#P outlet 191 279 15 0;
#P button 49 67 15 0;
#P toggle 67 67 15 0;
#P window setfont Monaco 10.;
#P window linecount 0;
#P newex 67 100 34 262154 gate;
#P inlet 67 32 15 0;
#P newex 191 196 29 262154 mtof;
#P newex 331 146 62 262154 delay 200;
#P newex 191 251 46 262154 *~ 0.5;
#P message 257 170 62 262154 0 , 0.5 10;
#P message 331 170 70 262154 0.5 , 0 200;
#P newex 257 223 37 262154 line~;
#P newex 191 223 50 262154 phasor~;
#P newex 191 170 29 262154 + 60;
#P newex 191 146 61 262154 random 24;
#P newex 117 170 35 262154 + 150;
#P newex 117 146 67 262154 random 400;
#P newex 67 196 60 262154 delay 500;
#P fasten 0 0 15 0 72 223 36 223 36 56 54 56;
#P fasten 12 0 15 0 72 60 54 60;
#P connect 12 0 14 0;
#P connect 14 0 13 0;
#P fasten 13 0 0 0 72 156 72 156;
#P fasten 15 0 13 1 54 91 96 91;
#P fasten 13 0 1 0 72 134 122 134;
#P connect 1 0 2 0;
#P connect 2 0 0 1;
#P fasten 13 0 3 0 72 131 196 131;
#P connect 3 0 4 0;
#P connect 4 0 11 0;
#P connect 11 0 5 0;
#P connect 5 0 9 0;
#P connect 9 0 16 0;
#P fasten 6 0 9 1 262 246 232 246;
#P fasten 13 0 8 0 72 128 262 128;
#P fasten 7 0 6 0 336 192 262 192;
#P connect 8 0 6 0;
#P fasten 13 0 10 0 72 125 336 125;
#P connect 10 0 7 0;
#P pop;
#P newobj 474 101 82 262154 p randphasor;
#B color 6;
#P connect 20 0 4 0;
#P connect 4 0 24 0;
#P hidden connect 19 0 8 0;
#P connect 2 0 8 0;
#P connect 8 0 4 1;
#P hidden connect 19 0 31 0;
#P connect 30 0 31 0;
#P connect 31 0 4 2;
#P connect 32 0 30 1;
#P connect 22 0 14 0;
#P connect 14 0 13 0;
#P connect 13 0 16 0;
#P hidden connect 19 0 17 0;
#P connect 16 0 17 0;
#P connect 17 0 4 3;
#P connect 15 0 13 1;
#P connect 21 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 9 0;
#P hidden connect 19 0 9 0;
#P connect 9 0 4 4;
#P connect 27 0 3 0;
#P connect 26 0 3 0;
#P connect 6 0 3 0;
#P hidden connect 18 0 10 0;
#P connect 3 0 10 0;
#P connect 10 0 4 5;
#P connect 28 0 6 0;
#P connect 3 2 7 0;
#P connect 7 0 29 0;
#P connect 23 0 12 0;
#P connect 12 0 5 0;
#P connect 5 0 34 0;
#P connect 5 1 34 0;
#P connect 34 0 11 0;
#P hidden connect 18 0 11 0;
#P connect 11 0 4 6;
#P fasten 12 0 25 0 707 73 757 73;
#P pop;
#P newobj 47 169 249 262154 p InputSelector;
#B color 6;
#P message 164 76 40 262154 reset;
#B color 10;
#N vpatcher 520 175 1256 392;
#P origin 0 -35;
#P window setfont Monaco 10.;
#P window linecount 1;
#P newex 286 170 40 262154 s LB1;
#B color 8;
#P newex 286 70 46 262154 del 10;
#P newex 461 170 58 262154 s ini100;
#B color 8;
#P newex 196 70 46 262154 del 10;
#P newex 650 170 58 262154 s ini128;
#B color 8;
#P newex 587 170 52 262154 s ini1;
#B color 8;
#P newex 524 170 52 262154 s ini0;
#B color 8;
#P newex 398 170 52 262154 s ini96;
#B color 8;
#P newex 335 170 52 262154 s ini64;
#B color 8;
#P message 335 97 112 262154 64 96 100 0 1 128;
#P newex 335 126 325 262154 unpack i i i i i i;
#P button 335 47 15 0;
#P inlet 421 21 15 0;
#P newex 335 21 64 262154 loadbang;
#B color 8;
#P window linecount 2;
#P comment 435 21 111 262154 reinit (message oder bang);
#P comment 538 97 61 262154 kein bang als arg!;
#B color 10;
#P outlet 147 170 15 0;
#P window linecount 1;
#P newex 102 70 34 262154 == 4;
#P newex 57 70 34 262154 == 3;
#P outlet 26 170 15 0;
#P outlet 102 170 15 0;
#P outlet 57 170 15 0;
#P inlet 26 21 15 0;
#P toggle 102 97 14 0;
#P window linecount 2;
#P message 196 97 76 262154 ; dsp status;
#B color 8;
#P comment 190 128 91 262154 öffnet DSP Status-Fenster;
#P toggle 57 97 15 0;
#P connect 4 0 7 0;
#P connect 4 0 8 0;
#P connect 8 0 0 0;
#P connect 0 0 5 0;
#P connect 4 0 9 0;
#P connect 9 0 3 0;
#P connect 3 0 6 0;
#P fasten 4 0 10 0 31 59 152 59;
#P connect 25 0 23 0;
#P connect 23 0 2 0;
#P connect 15 0 25 0;
#P connect 25 0 26 0;
#P connect 13 0 15 0;
#P connect 14 0 15 0;
#P connect 15 0 17 0;
#P connect 17 0 16 0;
#P connect 16 0 18 0;
#P connect 16 1 19 0;
#P connect 16 2 24 0;
#P connect 16 3 20 0;
#P connect 16 4 21 0;
#P connect 16 5 22 0;
#P pop;
#P newobj 47 100 127 262154 p LB|init;
#B color 6;
#P user ubumenu 47 76 100 262154 0 1 1 0;
#X prefix_set 0 0 0;
#P comment 136 127 64 262154 soundfile;
#P window setfont Monaco 20.;
#P comment 388 36 46 262164 f.e;
#P comment 48 35 334 262164 EXIT2009 | Ambisonic Helper;
#P window setfont Monaco 10.;
#P comment 436 296 20 262154 0º;
#P comment 541 387 58 262154 — x-axis;
#P comment 330 389 14 262154 –;
#P comment 513 387 34 262154 +90º;
#P comment 439 281 14 262154 |;
#P comment 423 266 46 262154 y-axis;
#P comment 535 171 106 262154 about encoding :;
#P window linecount 2;
#P comment 406 539 148 262154 N azimuth , elevation pairs for all speakers;
#P window linecount 1;
#P comment 148 582 130 262154 1st order 4 speakers;
#P window linecount 4;
#P user com 163 677 181 262154 20;
#K set 0 29552 25953 27493 29216 29541 29813 28704 26990 8301 31008 29556 30052 26991 8297 29453 3377 8224 12813 13088 8244;
#K end;
#P user panel 371 443 20 20;
#X brgb 100 100 100;
#X frgb 0 0 0;
#X border 1;
#X rounded 11;
#X done;
#P background;
#P user panel 495 443 20 20;
#X brgb 100 100 100;
#X frgb 0 0 0;
#X border 1;
#X rounded 11;
#X done;
#P background;
#P user panel 495 326 20 20;
#X brgb 100 100 100;
#X frgb 0 0 0;
#X border 1;
#X rounded 11;
#X done;
#P background;
#P user panel 371 326 20 20;
#X brgb 100 100 100;
#X frgb 0 0 0;
#X border 1;
#X rounded 11;
#X done;
#P background;
#P user panel 343 295 200 200;
#X brgb 240 240 255;
#X frgb 0 0 0;
#X border 1;
#X rounded 200;
#X done;
#P background;
#P user panel 338 290 210 210;
#X brgb 240 240 240;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X done;
#P background;
#P window linecount 1;
#P comment 148 234 82 262154 1st order 3D;
#P comment 227 197 58 262154 AUDIO on;
#P connect 21 0 22 0;
#P connect 22 0 24 0;
#P fasten 39 0 34 0 332 218 52 218;
#P connect 24 0 34 0;
#P fasten 41 0 34 0 411 221 52 221;
#P fasten 42 0 34 0 467 225 52 225;
#P connect 34 0 35 0;
#P fasten 38 0 35 0 160 574 52 574;
#P connect 35 0 36 0;
#P connect 34 0 79 0;
#P connect 35 0 83 0;
#P connect 24 0 33 0;
#P connect 34 1 35 1;
#P connect 35 1 36 1;
#P connect 34 1 80 0;
#P connect 35 1 84 0;
#P connect 22 1 24 1;
#P connect 34 2 35 2;
#P connect 35 2 36 2;
#P connect 34 2 81 0;
#P connect 35 2 85 0;
#P connect 22 2 24 2;
#P connect 34 3 35 3;
#P connect 35 3 36 3;
#P connect 34 3 82 0;
#P connect 35 3 86 0;
#P connect 37 0 38 0;
#P connect 23 0 22 1;
#P connect 26 0 24 3;
#P connect 24 1 31 0;
#P fasten 56 0 71 0 191 310 172 310;
#P fasten 57 0 71 0 191 333 172 333;
#P fasten 58 0 71 0 191 356 172 356;
#P fasten 59 0 71 0 191 379 172 379;
#P fasten 60 0 71 0 191 401 172 401;
#P fasten 61 0 71 0 191 425 172 425;
#P fasten 62 0 71 0 191 448 172 448;
#P fasten 63 0 71 0 191 473 172 473;
#P connect 27 0 24 4;
#P connect 28 0 24 5;
#P fasten 22 3 24 6 169 124 286 124;
#P connect 24 2 25 0;
#P connect 72 0 73 0;
#P connect 73 0 74 0;
#P connect 74 0 75 0;
#P connect 75 0 76 0;
#P connect 76 0 77 0;
#P connect 40 0 41 0;
#P connect 32 0 42 0;
#P pop;

Gruesse von der Cannstatter Altenburg:
Klangwerkstatt Werner Funk Stuttgart

#153119

You must be logged in to reply to this topic.