iem_tab/0000755000175000017500000000000012527356721012722 5ustar zmoelnigzmoelnigiem_tab/tab_ne-help.pd0000644000175000017500000000647511120262740015422 0ustar zmoelnigzmoelnig#N canvas 116 92 863 568 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 62 423 musil; #X text 92 423 @; #X text 98 423 iem.at; #X text 61 445 Graz \, Austria; #X text 13 412 (c) Thomas Musil 2000 - 2006; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 208 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 195 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X text 12 3 tab_ne; #X text 90 29 compare "not equal to" the 2 src-arrays to dst-array ; #X obj 61 78 tab_ne src1 src2 dst; #X obj 59 301 tab_ne src1 src2 dst; #X connect 2 0 33 0; #X connect 5 0 34 0; #X connect 7 0 34 0; #X connect 8 0 34 0; #X connect 9 0 34 0; #X connect 33 0 3 0; #X connect 34 0 4 0; iem_tab/tab_carth2polar-help.pd0000644000175000017500000000512711141231101017220 0ustar zmoelnigzmoelnig#N canvas 132 30 866 532 10; #N canvas 0 22 450 300 (subpatch) 0; #X array real 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 451 29 graph; #X obj 61 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 40 381 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array imag 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 451 71 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array mag 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 596 29 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array arg 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 596 71 graph; #X msg 696 220 2; #X floatatom 647 276 5 0 0 0 - - -; #X floatatom 730 277 5 0 0 0 - - -; #X obj 710 131 loadbang; #X text 96 444 IEM KUG; #X text 75 432 musil; #X text 110 432 @; #X text 118 432 iem.at; #X text 79 454 Graz \, Austria; #X text 324 276 initial arguments:; #X text 81 39 invert the complex src-arrays to the complex dst-arrays ; #X text 98 113 the minimum of the 4 array lengths); #X text 85 99 (the number of samples which were inverted are:; #X text 302 288 1.arg: real_source-name; #X text 302 300 2.arg: imag_source-name; #X text 53 160 list of 5 floats:; #X msg 40 229 0 0 0 0 64; #X text 12 7 tab_carth2polar; #X obj 684 316 * 360; #X floatatom 684 341 5 0 0 0 - - -; #X text 74 179 2.) src_imag-onset; #X text 74 169 1.) src_real-onset; #X text 74 209 5.) number of samples to convert; #X msg 710 152 \; real const 0.75 \; imag const -0.75; #X msg 584 153 \; real const 0.75 \; imag const 0.75; #X text 302 312 3.arg: magnitude_destination-name; #X text 302 323 4.arg: phase_argument_destination-name; #X text 74 189 3.) dst_magnitude-onset; #X text 74 199 4.) dst_phase_argument-onset; #X obj 647 254 tabread mag; #X obj 730 253 tabread arg; #X obj 61 78 tab_carth2polar real imag mag arg; #X obj 40 360 tab_carth2polar real imag mag arg; #X msg 143 331 dst_arg arg; #X msg 110 306 dst_mag mag; #X msg 91 279 src_im imag; #X msg 74 253 src_re real; #X floatatom 743 352 5 0 0 0 - - -; #X obj 743 304 * 2; #X obj 743 327 * 3.14159; #X text 31 421 (c) Thomas Musil 2000 - 2009; #X connect 1 0 38 0; #X connect 7 0 36 0; #X connect 7 0 37 0; #X connect 9 0 25 0; #X connect 9 0 45 0; #X connect 10 0 30 0; #X connect 23 0 39 0; #X connect 25 0 26 0; #X connect 36 0 8 0; #X connect 37 0 9 0; #X connect 38 0 2 0; #X connect 39 0 3 0; #X connect 40 0 39 0; #X connect 41 0 39 0; #X connect 42 0 39 0; #X connect 43 0 39 0; #X connect 45 0 46 0; #X connect 46 0 44 0; iem_tab/tab_mul_scalar-help.pd0000644000175000017500000000473211120262740017134 0ustar zmoelnigzmoelnig#N canvas 115 92 856 560 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 527 46 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 211 336 1.arg: source-name; #X msg 197 270 dst dst; #X msg 47 36 0.5; #X msg 145 247 src src; #X msg 82 37 -0.5; #X msg 48 227 50 20 50 -0.8; #X text 211 349 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 234 322 initial arguments:; #X text 71 322 output; #X text 250 271 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 197 246 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 205 72 (the number of samples which were added are:; #X text 12 3 tab_mul_scalar; #X text 129 29 multiply the src-array with this scalar to dst-array ; #X obj 61 78 tab_mul_scalar src dst; #X obj 59 301 tab_mul_scalar src dst; #X text 42 200 3.) n samples to multiply; #X text 42 210 4.) multiplied scalar value; #X connect 5 0 29 0; #X connect 6 0 28 0; #X connect 7 0 29 0; #X connect 8 0 28 0; #X connect 9 0 29 0; #X connect 28 0 2 0; #X connect 29 0 3 0; iem_tab/tab_gt-help.pd0000644000175000017500000000647511120262740015432 0ustar zmoelnigzmoelnig#N canvas 116 92 859 564 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 62 423 musil; #X text 92 423 @; #X text 98 423 iem.at; #X text 61 445 Graz \, Austria; #X text 13 412 (c) Thomas Musil 2000 - 2006; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 208 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 195 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X text 12 3 tab_gt; #X text 90 29 compare "greater than" the 2 src-arrays to dst-array ; #X obj 61 78 tab_gt src1 src2 dst; #X obj 59 301 tab_gt src1 src2 dst; #X connect 2 0 33 0; #X connect 5 0 34 0; #X connect 7 0 34 0; #X connect 8 0 34 0; #X connect 9 0 34 0; #X connect 33 0 3 0; #X connect 34 0 4 0; iem_tab/tab_copy-help.pd0000644000175000017500000000461511141231101015752 0ustar zmoelnigzmoelnig#N canvas 116 92 784 483 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 533 14 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 533 180 graph; #X obj 60 35 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 60 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 58 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 58 215 50 20 50; #X text 194 318 1.arg: source-name; #X text 194 331 2.arg: destination-name; #X msg 115 235 src src; #X msg 165 253 dst dst; #X text 184 73 (the number of samples which are copied are:; #X text 197 87 the minimum of both array lengths); #X text 43 168 list of 3 floats:; #X text 77 419 IEM KUG; #X text 56 407 musil; #X text 91 407 @; #X text 99 407 iem.at; #X text 60 429 Graz \, Austria; #X text 55 179 1.) src onset; #X text 55 189 2.) dst onset; #X text 225 306 initial arguments:; #X text 73 323 output; #X text 172 233 xxx : change source name; #X text 218 252 xxx : change destination name; #X text 11 7 tab_copy; #X text 89 33 copy value from src to dst; #X obj 60 82 tab_copy src dst; #X text 55 198 3.) n samples to copy; #X obj 58 306 tab_copy src dst; #X text 12 396 (c) Thomas Musil 2000 - 2009; #X connect 2 0 26 0; #X connect 5 0 28 0; #X connect 8 0 28 0; #X connect 9 0 28 0; #X connect 26 0 3 0; #X connect 28 0 4 0; iem_tab/tab_rmstodb-help.pd0000644000175000017500000000457711660764625016515 0ustar zmoelnigzmoelnig#N canvas 369 22 790 417 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 0.0214324 0.0214324 0.0214324 0.0214324 0.0214324 0.0214324 0.0357179 0.0357179 0.0428607 0.0428607 0.0428607 0.0500035 0.0642891 0.0714318 0.0785746 0.0857174 0.0857174 0.100003 0.100003 0.107146 0.107146 0.114289 0.114289 0.121431 0.121431 0.128574 0.128574 0.135717 0.14286 0.14286 0.14286 0.150002 0.157145 0.157145 0.171431 0.178574 0.185716 0.192859 0.200002 0.214287 0.214287 0.22143 0.228573 0.242859 0.242859 0.257144 0.257144 0.264287 0.278573 0.292858 0.300001 0.314286 0.335715 0.35 0.357143 0.364286 0.378571 0.392857 0.407143 0.414285 0.435714 0.442857 0.449999 0.457142 0.471428 0.485713 0.492856 0.499999 0.521427 0.52857 0.542856 0.542856 0.564284 0.578569 0.599998 0.621426 0.635712 0.642854 0.649997 0.671426 0.685711 0.699997 0.707139 0.714282 0.735711 0.757139 0.764282 0.771425 0.778567 0.799996 0.807138 0.821424 0.83571 0.864281 0.885709 0.885709 0.899995 0.935709 0.949994 0.957137; #X coords 0 1 99 0 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 100 99 0 200 140 1; #X restore 534 166 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 44 154 list of 3 floats:; #X text 222 273 1.arg: source-name; #X text 222 286 2.arg: destination-name; #X msg 154 213 src src; #X msg 185 234 dst dst; #X text 78 365 IEM KUG; #X text 57 353 musil; #X text 92 353 @; #X text 100 353 iem.at; #X text 61 375 Graz \, Austria; #X text 56 165 1.) src onset; #X text 56 175 2.) dst onset; #X text 231 261 initial arguments:; #X text 68 283 output; #X text 208 213 xxx : change source name; #X text 240 233 xxx : change destination name; #X text 205 69 (the number of samples which are copied are:; #X text 218 83 the minimum of both array lengths); #X text 12 4 tab_rmstodb; #X obj 61 78 tab_rmstodb src dst; #X text 57 185 3.) n samples of rmstodb; #X obj 59 264 tab_rmstodb src dst; #X text 13 342 (c) Thomas Musil 2000 - 2010; #X text 90 29 calculates the rmstodb-value from src to dst; #X connect 2 0 25 0; #X connect 5 0 27 0; #X connect 9 0 27 0; #X connect 10 0 27 0; #X connect 25 0 3 0; #X connect 27 0 4 0; iem_tab/tab_ne_scalar-help.pd0000644000175000017500000000461011120262740016734 0ustar zmoelnigzmoelnig#N canvas 22 55 880 584 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.485714 -0.457143 -0.4 -0.285713 -0.0571409 0.157146 0.328575 0.442861 0.557148 0.628577 0.714292 0.800006 0.85715 0.885721 0.885721 0.871435 0.842864 0.757149 0.557148 0.41429 0.257146 -0.0142835 -0.314285 -0.528572 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.41429 0.242861 0.0857169 -0.0571409 -0.242856 -0.385714 -0.542858 -0.685716 -0.757145 -0.800002 -0.828574 -0.828574 -0.814288 -0.800002 -0.785716 -0.757145 -0.728573 -0.67143 -0.585715 -0.471429 -0.271428 -0.0857125 0.114288 0.228575 0.314289 0.385718 0.414285 0.428571 0.457143 0.471428 0.485714 0.485714 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 201 332 1.arg: source-name; #X text 201 345 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 224 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 42 200 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 12 3 tab_ne_scalar; #X text 129 29 compare "not equal to" the src-array with this scalar to dst-array; #X obj 61 78 tab_ne_scalar src dst; #X text 205 72 (the number of samples which were compared are:; #X msg 48 228 0 0 100 0.5; #X obj 59 331 tab_ne_scalar src dst; #X connect 4 0 31 0; #X connect 5 0 31 0; #X connect 6 0 28 0; #X connect 7 0 28 0; #X connect 28 0 2 0; #X connect 30 0 31 0; #X connect 31 0 3 0; iem_tab/tab_min_max-help.pd0000644000175000017500000000460611120262740016442 0ustar zmoelnigzmoelnig#N canvas 82 83 782 436 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.185715 0.185715 0.200001 0.214286 0.214286 0.214286 0.228572 0.228572 0.214286 0.200001 0.185715 0.171429 0.142857 0.1 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 534 20 graph; #X obj 61 34 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 109 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 297 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 205 273 1.arg: source-name; #X msg 101 216 src src; #X floatatom 103 106 5 0 0 0 - - -; #X floatatom 146 107 5 0 0 0 - - -; #X text 154 121 max; #X floatatom 101 323 5 0 0 0 - - -; #X floatatom 144 339 5 0 0 0 - - -; #X msg 59 196 35 50; #X text 75 387 IEM KUG; #X text 59 375 musil; #X text 89 375 @; #X text 95 375 iem.at; #X text 58 397 Graz \, Austria; #X text 10 364 (c) Thomas Musil 2000 - 2006; #X text 229 261 initial arguments:; #X text 65 283 output; #X text 152 216 xxx : change source name; #X text 43 153 list of 2 floats:; #X text 55 163 1.) src onset; #X text 151 322 maximum value output; #X text 11 9 tab_min_max; #X text 85 32 calculate minimum and maximum element value of array; #X text 55 174 2.) n samples to calculate minimum and maximum; #X text 110 120 min; #X obj 61 81 tab_min_max src; #X text 108 304 minimum value output; #X obj 59 265 tab_min_max src; #X connect 1 0 28 0; #X connect 5 0 30 0; #X connect 11 0 30 0; #X connect 28 0 2 0; #X connect 28 1 6 0; #X connect 28 2 7 0; #X connect 30 0 3 0; #X connect 30 1 9 0; #X connect 30 2 10 0; iem_tab/tab_gt_scalar-help.pd0000644000175000017500000000460711120262740016752 0ustar zmoelnigzmoelnig#N canvas 22 55 880 584 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.485714 -0.457143 -0.4 -0.285713 -0.0571409 0.157146 0.328575 0.442861 0.557148 0.628577 0.714292 0.800006 0.85715 0.885721 0.885721 0.871435 0.842864 0.757149 0.557148 0.41429 0.257146 -0.0142835 -0.314285 -0.528572 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.41429 0.242861 0.0857169 -0.0571409 -0.242856 -0.385714 -0.542858 -0.685716 -0.757145 -0.800002 -0.828574 -0.828574 -0.814288 -0.800002 -0.785716 -0.757145 -0.728573 -0.67143 -0.585715 -0.471429 -0.271428 -0.0857125 0.114288 0.228575 0.314289 0.385718 0.414285 0.428571 0.457143 0.471428 0.485714 0.485714 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X msg 48 228 0 0 100 0.3; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 201 332 1.arg: source-name; #X text 201 345 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 224 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 42 201 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 205 72 (the number of samples which were compared are:; #X text 12 3 tab_gt_scalar; #X obj 61 78 tab_gt_scalar src dst; #X obj 59 331 tab_gt_scalar src dst; #X text 129 29 compare "greater than" the src-array with this scalar to dst-array; #X connect 4 0 30 0; #X connect 5 0 30 0; #X connect 6 0 30 0; #X connect 7 0 29 0; #X connect 8 0 29 0; #X connect 29 0 2 0; #X connect 30 0 3 0; iem_tab/tab_div-help.pd0000644000175000017500000000722611141231101015563 0ustar zmoelnigzmoelnig#N canvas 116 92 851 556 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 574 20 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 575 368 graph; #X obj 61 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 350 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 286 dst dst; #N canvas 0 22 450 300 (subpatch) 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-06 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.428564 0.457135 0.485707 0.499992 0.514278 0.499992 0.471421 0.44285 0.414279 0.357136 0.285708 0.171423 0.0999952 0.0142815 -0.100003 -0.214288 -0.314288 -0.385716 -0.457144 -0.471429 -0.514286 -0.500001 -0.47143 -0.442858 -0.414287 -0.37143 -0.300002 -0.228574 -0.157146 -0.0714324 0.0571381 0.128566 0.199994 0.271422 0.34285 0.414278 0.457135 0.485707 0.499992 0.528563 0.542849 0.499992 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 575 171 graph; #X msg 136 243 src1 src1; #X msg 195 265 src2 src2; #X msg 59 221 50 50 20 50; #X text 45 149 list of 4 floats:; #X text 212 363 3.arg: destination-name; #X text 78 445 IEM KUG; #X text 56 433 musil; #X text 92 433 @; #X text 100 433 iem.at; #X text 61 455 Graz \, Austria; #X text 234 322 initial arguments:; #X text 72 329 output; #X text 314 285 xxx : change destination name; #X text 229 96 the minimum of the 3 array lengths); #X text 56 187 3.) dst onset; #X text 56 165 1.) src_1 onset; #X text 56 176 2.) src_2 onset; #X text 207 243 xxx : change source name 1; #X text 265 265 xxx : change source name 2; #X text 211 336 1.arg: source-name 1; #X text 211 349 2.arg: source-name 2; #X text 12 13 tab_div; #X text 90 39 divide the 2 src-arrays to dst-array; #X text 216 82 (the number of samples which were divided are:; #X text 56 197 4.) n samples to divide; #X obj 61 88 tab_div src1 src2 dst; #X obj 59 311 tab_div src1 src2 dst; #X text 13 422 (c) Thomas Musil 2000 - 2009; #X connect 2 0 32 0; #X connect 5 0 33 0; #X connect 7 0 33 0; #X connect 8 0 33 0; #X connect 9 0 33 0; #X connect 32 0 3 0; #X connect 33 0 4 0; iem_tab/tab_ifft-help.pd0000644000175000017500000002423111141231101015724 0ustar zmoelnigzmoelnig#N canvas 265 105 961 540 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 239 graph; #X obj 24 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 24 122 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 62 371 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 353 graph; #X msg 103 276 dst_re dst_re; #X msg 118 299 dst_im dst_im; #X msg 139 322 fftsize 64; #X floatatom 474 22 5 0 63 0 - - -; #X msg 546 341 \; dst_re const 0 \; dst_im const 0; #X text 102 464 IEM KUG; #X text 81 452 musil; #X text 116 452 @; #X text 124 452 iem.at; #X text 85 474 Graz \, Austria; #N canvas 0 22 478 328 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 60 103 \; src_re const 0 \; src_re \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 474 41 pd generate_a_dirac; #X floatatom 514 22 5 -32 32 0 - - -; #N canvas 0 22 543 496 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 127 t b f; #X obj 219 331 tabwrite src_re; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 39 333 tabwrite src_re; #X obj 90 70 * -1; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 151 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 38 154 pd counter; #X obj 39 310 * -1; #X obj 219 106 clip 0 32; #X obj 39 108 clip 0 32; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 1 1 7 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 6 0 17 0; #X connect 6 1 5 1; #X connect 8 0 16 0; #X connect 8 1 20 0; #X connect 9 0 10 0; #X connect 9 1 15 1; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 19 0; #X connect 13 0 12 0; #X connect 14 0 18 0; #X connect 14 1 13 1; #X connect 16 0 21 0; #X connect 17 0 1 0; #X connect 18 0 9 0; #X connect 19 0 15 0; #X connect 20 0 6 0; #X connect 21 0 14 0; #X restore 514 61 pd generate_a_cos; #X floatatom 555 22 5 -31 31 0 - - -; #N canvas 0 22 499 423 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 337 tabwrite src_re; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 132 t b f; #X obj 54 335 tabwrite src_re; #X obj 54 287 sin; #X obj 102 60 moses 0; #X obj 54 88 * -1; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X obj 54 312 * -1; #X connect 0 0 17 0; #X connect 1 0 2 0; #X connect 1 1 7 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 6 0; #X connect 6 0 20 0; #X connect 6 1 4 1; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 9 1 15 1; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 16 0; #X connect 13 0 14 0; #X connect 14 0 19 0; #X connect 14 1 12 1; #X connect 16 0 21 0; #X connect 17 0 18 0; #X connect 17 1 5 0; #X connect 18 0 13 0; #X connect 19 0 9 0; #X connect 20 0 1 0; #X connect 21 0 15 0; #X restore 555 82 pd generate_a_sin; #X text 299 365 initial arguments:; #X text 37 147 list of 4 floats:; #X text 49 178 3.) dst_re-onset; #X text 49 188 4.) dst_im-onset; #X text 49 158 1.) src_re-onset; #X text 49 168 2.) src_im-onset; #X msg 62 207 20 20 30 30; #X text 259 412 4.arg: imag_destination-name; #X text 259 400 3.arg: real_destination-name; #X text 259 389 2.arg: imag_source-name; #X text 259 378 1.arg: real_source-name; #N canvas 0 22 450 300 (subpatch) 0; #X array src_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 124 graph; #X msg 76 230 src_re src_re; #X msg 90 253 src_im src_im; #X msg 546 283 \; src_re const 0 \; src_im const 0; #X floatatom 474 132 5 0 63 0 - - -; #N canvas 0 22 478 328 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 61 99 \; src_im const 0 \; src_im \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 474 151 pd generate_a_dirac; #X floatatom 514 132 5 -32 32 0 - - -; #N canvas 0 22 499 423 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 127 t b f; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 90 70 * -1; #X obj 40 334 tabwrite src_im; #X obj 220 331 tabwrite src_im; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 39 153 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 153 pd counter; #X obj 39 311 * -1; #X obj 219 106 clip 0 32; #X obj 39 108 clip 0 32; #X connect 0 0 7 0; #X connect 1 0 2 0; #X connect 1 1 16 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 16 0; #X connect 5 0 4 0; #X connect 6 0 18 0; #X connect 6 1 5 1; #X connect 7 0 14 0; #X connect 7 1 20 0; #X connect 8 0 9 0; #X connect 8 1 15 1; #X connect 9 0 10 0; #X connect 10 0 12 0; #X connect 11 0 19 0; #X connect 12 0 11 0; #X connect 13 0 17 0; #X connect 13 1 12 1; #X connect 14 0 21 0; #X connect 17 0 8 0; #X connect 18 0 1 0; #X connect 19 0 15 0; #X connect 20 0 6 0; #X connect 21 0 13 0; #X restore 514 171 pd generate_a_cos; #X floatatom 555 132 5 -31 31 0 - - -; #N canvas 0 22 495 419 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 131 t b f; #X obj 54 287 sin; #X obj 102 60 moses 0; #X obj 54 88 * -1; #X obj 246 337 tabwrite src_im; #X obj 54 336 tabwrite src_im; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X obj 53 312 * -1; #X connect 0 0 15 0; #X connect 1 0 2 0; #X connect 1 1 17 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 7 0; #X connect 5 0 6 0; #X connect 6 0 20 0; #X connect 6 1 4 1; #X connect 7 0 17 0; #X connect 8 0 9 0; #X connect 8 1 18 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 14 0; #X connect 12 0 13 0; #X connect 13 0 19 0; #X connect 13 1 11 1; #X connect 14 0 21 0; #X connect 15 0 16 0; #X connect 15 1 5 0; #X connect 16 0 12 0; #X connect 19 0 8 0; #X connect 20 0 1 0; #X connect 21 0 18 0; #X restore 555 192 pd generate_a_sin; #X text 37 441 (c) Thomas Musil 2000 - 2009; #X text 10 0 tab_ifft; #X text 93 -1 complex inverse FTT with arrays; #X text 45 56 calculates a complex inverse fourier transformation of complex src-arrays to complex dst-arrays; #X obj 24 94 tab_ifft src_re src_im dst_re dst_im 64; #X obj 62 348 tab_ifft src_re src_im dst_re dst_im 64; #X text 259 424 5.arg: ifftsize; #X connect 2 0 46 0; #X connect 6 0 47 0; #X connect 7 0 47 0; #X connect 8 0 47 0; #X connect 9 0 16 0; #X connect 17 0 18 0; #X connect 19 0 20 0; #X connect 27 0 47 0; #X connect 33 0 47 0; #X connect 34 0 47 0; #X connect 36 0 37 0; #X connect 38 0 39 0; #X connect 40 0 41 0; #X connect 46 0 3 0; #X connect 47 0 4 0; iem_tab/GnuGPL.txt0000644000175000017500000004311010404166423014544 0ustar zmoelnigzmoelnig GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. iem_tab/tab_rfft-help.pd0000644000175000017500000001353011141231101015735 0ustar zmoelnigzmoelnig#N canvas 0 22 965 544 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 239 graph; #X obj 24 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 24 122 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 353 graph; #X msg 89 252 dst_re dst_re; #X msg 104 275 dst_im dst_im; #X msg 125 298 fftsize 64; #X floatatom 474 22 5 0 63 0 - - -; #X msg 546 341 \; dst_re const 0 \; dst_im const 0; #N canvas 0 22 482 332 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 61 89 \; src const 0 \; src \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 474 41 pd generate_a_dirac; #X floatatom 514 22 5 -32 32 0 - - -; #N canvas 0 22 507 431 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 308 / 32; #X obj 219 127 t b f; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 90 70 * -1; #X obj 39 310 / -32; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 151 pd counter; #N canvas 193 158 458 308 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 38 154 pd counter; #X obj 219 106 clip 0 32; #X obj 39 108 clip 0 32; #X obj 39 333 tabwrite src; #X obj 219 331 tabwrite src; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 1 1 22 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 22 0; #X connect 7 0 17 0; #X connect 7 1 5 1; #X connect 8 0 15 0; #X connect 8 1 19 0; #X connect 9 0 10 0; #X connect 9 1 21 1; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 14 0 18 0; #X connect 14 1 13 1; #X connect 15 0 20 0; #X connect 16 0 21 0; #X connect 17 0 1 0; #X connect 18 0 9 0; #X connect 19 0 7 0; #X connect 20 0 14 0; #X restore 514 61 pd generate_a_cos; #X floatatom 555 22 5 -31 31 0 - - -; #N canvas 0 22 503 427 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 314 / 32; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 132 t b f; #X obj 54 287 sin; #X obj 54 312 / -32; #X obj 102 60 moses 0; #X obj 54 88 * -1; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X obj 54 334 tabwrite src; #X obj 246 337 tabwrite src; #X connect 0 0 17 0; #X connect 1 0 2 0; #X connect 1 1 22 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 22 0; #X connect 6 0 7 0; #X connect 7 0 20 0; #X connect 7 1 4 1; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 9 1 21 1; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 15 0; #X connect 13 0 14 0; #X connect 14 0 19 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 21 0; #X connect 17 0 18 0; #X connect 17 1 6 0; #X connect 18 0 13 0; #X connect 19 0 9 0; #X connect 20 0 1 0; #X restore 555 82 pd generate_a_sin; #X text 309 355 initial arguments:; #X msg 546 283 \; src const 0; #X msg 76 230 src src; #X msg 62 207 20 30 30; #X text 49 158 1.) src-onset; #X text 49 168 2.) dst_re-onset; #X text 49 178 3.) dst_im-onset; #X text 37 147 list of 3 floats:; #X text 269 368 1.arg: source-name; #X text 269 380 2.arg: real_destination-name; #X text 269 392 3.arg: imag_destination-name; #X text 269 404 4.arg: fftsize; #X text 10 0 tab_rfft; #X text 93 -1 real FTT with arrays; #X text 45 56 calculates a real fourier transformation of a real src-array to complex dst-arrays; #X obj 24 94 tab_rfft src dst_re dst_im 64; #X obj 62 322 tab_rfft src dst_re dst_im 64; #X text 102 464 IEM KUG; #X text 81 452 musil; #X text 116 452 @; #X text 124 452 iem.at; #X text 85 474 Graz \, Austria; #X text 37 441 (c) Thomas Musil 2000 - 2009; #X connect 2 0 31 0; #X connect 6 0 32 0; #X connect 7 0 32 0; #X connect 8 0 32 0; #X connect 9 0 11 0; #X connect 12 0 13 0; #X connect 14 0 15 0; #X connect 18 0 32 0; #X connect 19 0 32 0; #X connect 31 0 3 0; #X connect 32 0 4 0; iem_tab/tab_min_index-help.pd0000644000175000017500000000460211120262740016760 0ustar zmoelnigzmoelnig#N canvas 116 92 784 436 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.185715 0.185715 0.200001 0.214286 0.214286 0.214286 0.228572 0.228572 0.214286 0.200001 0.185715 0.171429 0.142857 0.1 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 529 24 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 205 270 1.arg: source-name; #X msg 101 213 src src; #X floatatom 109 103 5 0 0 0 - - -; #X floatatom 158 104 5 0 0 0 - - -; #X floatatom 107 320 5 0 0 0 - - -; #X floatatom 156 336 5 0 0 0 - - -; #X msg 59 193 35 50; #X text 75 384 IEM KUG; #X text 59 372 musil; #X text 89 372 @; #X text 95 372 iem.at; #X text 58 394 Graz \, Austria; #X text 10 361 (c) Thomas Musil 2000 - 2006; #X text 229 258 initial arguments:; #X text 65 280 output; #X text 152 213 xxx : change source name; #X text 43 150 list of 2 floats:; #X text 55 160 1.) src onset; #X text 11 6 tab_min_index; #X obj 61 78 tab_min_index src; #X obj 59 262 tab_min_index src; #X text 55 171 2.) n samples to calculate minimum; #X text 115 301 minimum index output; #X text 163 319 minimum value output; #X text 166 118 min; #X text 97 117 min_index; #X text 85 29 calculate minimum element and its index of array ; #X connect 1 0 23 0; #X connect 5 0 24 0; #X connect 10 0 24 0; #X connect 23 0 2 0; #X connect 23 1 6 0; #X connect 23 2 7 0; #X connect 24 0 3 0; #X connect 24 1 8 0; #X connect 24 2 9 0; iem_tab/tab_cross_corr-help.pd0000644000175000017500000000635011141231101017154 0ustar zmoelnigzmoelnig#N canvas 107 80 1053 581 10; #X obj 55 51 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 55 92 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 478 328 init_tables 0; #X obj 45 113 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 239 151 noise~; #X obj 114 193 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 134 234 tabwrite~ ref; #X obj 238 234 tabwrite~ meas; #X obj 149 15 inlet; #X obj 149 37 t b; #X obj 188 99 del 100; #X msg 53 82 1; #X msg 188 122 0; #X obj 167 64 del 100; #N canvas 0 22 238 185 dsp 0; #X msg 28 63 \; pd dsp \$1; #X obj 28 34 inlet; #X connect 1 0 0 0; #X restore 45 139 pd dsp; #N canvas 448 145 462 312 delay 0; #X obj 75 169 outlet~; #X obj 75 23 inlet~; #N canvas 0 22 458 308 del1 0; #X obj 75 169 outlet~; #X obj 75 23 inlet~; #X obj 105 101 delwrite~ \$0delz 5; #X connect 1 0 2 0; #X connect 1 0 0 0; #X restore 75 66 pd del1; #N canvas 0 22 458 308 del2 0; #X obj 75 169 outlet~; #X obj 75 23 inlet~; #X obj 75 122 delread~ \$0delz 1.31; #X connect 2 0 0 0; #X restore 75 116 pd del2; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X restore 136 190 pd delay; #X connect 0 0 11 0; #X connect 1 0 4 0; #X connect 1 0 12 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 5 0 6 0; #X connect 6 0 8 0; #X connect 6 0 10 0; #X connect 7 0 9 0; #X connect 8 0 0 0; #X connect 9 0 0 0; #X connect 10 0 7 0; #X connect 10 0 2 0; #X connect 12 0 3 0; #X restore 636 311 pd init_tables; #X obj 636 266 loadbang; #N canvas 0 22 450 300 (subpatch) 0; #X array ref 200 float 0; #X coords 0 1 199 -1 199 100 1; #X restore 483 20 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array meas 100 float 0; #X coords 0 1 99 -1 99 100 1; #X restore 541 140 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array cross_corr 100 float 0; #X coords 0 1 99 -1 99 100 1; #X restore 483 260 graph; #X text 94 459 IEM KUG; #X text 73 447 musil; #X text 108 447 @; #X text 116 447 iem.at; #X text 77 469 Graz \, Austria; #X text 380 381 initial arguments:; #X text 12 7 tab_cross_corr; #X text 77 37 correlates the 2nd array "measured" with the 1st array "reference" to the destination array "cross_corr"; #X text 78 92 (the number of samples which were correlated are: the positive minimum of the difference (src1-src2) and dst array lengths) ; #X text 358 393 1.arg: source1-name; #X text 358 405 2.arg: source2-name; #X text 358 417 3.arg: destination-name; #X text 533 452 calculation in ms; #X text 358 441 5.arg: delay time per destination sample; #X msg 63 257 bang; #X msg 80 278 time 1; #X msg 135 361 dst cross_corr; #X msg 124 340 src2 meas; #X msg 109 319 src1 ref; #X obj 636 290 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 97 297 factor 0.02; #X obj 63 389 tab_cross_corr ref meas cross_corr 0.02 1; #X text 62 155 !! array length of src1 > array length of src2 !!; #X text 29 436 (c) Thomas Musil 2000 - 2009; #X obj 55 70 tab_cross_corr ref meas cross_corr 0.04 1; #X text 358 429 4.arg: scaling factor; #X connect 0 0 31 0; #X connect 3 0 26 0; #X connect 21 0 28 0; #X connect 22 0 28 0; #X connect 23 0 28 0; #X connect 24 0 28 0; #X connect 25 0 28 0; #X connect 26 0 2 0; #X connect 27 0 28 0; #X connect 31 0 1 0; iem_tab/tab_eq-help.pd0000644000175000017500000000651011141231101015401 0ustar zmoelnigzmoelnig#N canvas 116 92 863 568 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 584 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 585 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 22 450 300 (subpatch) 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-06 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 585 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 57 423 musil; #X text 92 423 @; #X text 100 423 iem.at; #X text 61 445 Graz \, Austria; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 316 275 xxx : change destination name; #X text 219 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 209 233 xxx : change source name 1; #X text 267 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 12 3 tab_eq; #X text 90 29 compare "equal to" the 2 src-arrays to dst-array ; #X obj 61 78 tab_eq src1 src2 dst; #X text 206 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X obj 59 301 tab_eq src1 src2 dst; #X text 13 412 (c) Thomas Musil 2000 - 2009; #X connect 2 0 30 0; #X connect 5 0 33 0; #X connect 7 0 33 0; #X connect 8 0 33 0; #X connect 9 0 33 0; #X connect 30 0 3 0; #X connect 33 0 4 0; iem_tab/tab_lt_scalar-help.pd0000644000175000017500000000460511120262740016755 0ustar zmoelnigzmoelnig#N canvas 22 55 884 588 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.485714 -0.457143 -0.4 -0.285713 -0.0571409 0.157146 0.328575 0.442861 0.557148 0.628577 0.714292 0.800006 0.85715 0.885721 0.885721 0.871435 0.842864 0.757149 0.557148 0.41429 0.257146 -0.0142835 -0.314285 -0.528572 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.41429 0.242861 0.0857169 -0.0571409 -0.242856 -0.385714 -0.542858 -0.685716 -0.757145 -0.800002 -0.828574 -0.828574 -0.814288 -0.800002 -0.785716 -0.757145 -0.728573 -0.67143 -0.585715 -0.471429 -0.271428 -0.0857125 0.114288 0.228575 0.314289 0.385718 0.414285 0.428571 0.457143 0.471428 0.485714 0.485714 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 201 332 1.arg: source-name; #X text 201 345 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 224 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 42 201 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 205 72 (the number of samples which were compared are:; #X text 12 3 tab_lt_scalar; #X text 129 29 compare "less than" the src-array with this scalar to dst-array; #X obj 59 331 tab_lt_scalar src dst; #X msg 48 228 0 0 100 0.5; #X obj 61 78 tab_lt_scalar src dst; #X connect 4 0 29 0; #X connect 5 0 29 0; #X connect 6 0 31 0; #X connect 7 0 31 0; #X connect 29 0 3 0; #X connect 30 0 29 0; #X connect 31 0 2 0; iem_tab/tab_conv-help.pd0000644000175000017500000000716411153612710015763 0ustar zmoelnigzmoelnig#N canvas 18 36 1204 616 10; #X obj 55 56 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 55 97 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 711 532 init_tables 0; #X obj 45 113 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 133 200 noise~; #X obj 104 144 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 149 15 inlet; #X obj 149 37 t b; #X obj 188 99 del 100; #X msg 53 82 1; #X msg 188 122 0; #X obj 167 64 del 100; #X obj 134 234 tabwrite~ in; #X obj 228 235 tabwrite~ filt; #X obj 229 180 *~ 10; #N canvas 0 22 238 185 dsp 0; #X msg 28 63 \; pd dsp \$1; #X obj 28 34 inlet; #X connect 1 0 0 0; #X restore 45 132 pd dsp; #N canvas 448 145 458 308 dirac~ 0; #X obj 75 23 inlet; #X obj 75 96 sig~; #X obj 75 121 biquad~ 0 0 1 -1 0; #X obj 75 143 clip~ 0 1; #X obj 75 169 outlet~; #X obj 110 48 del 2; #X msg 75 49 1; #X msg 111 69 0; #X connect 0 0 5 0; #X connect 0 0 6 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X restore 229 155 pd dirac~; #X obj 229 209 bp~ 1000 10; #X connect 0 0 12 0; #X connect 1 0 9 0; #X connect 2 0 9 0; #X connect 2 0 10 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 4 0 8 0; #X connect 5 0 7 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 5 0; #X connect 8 0 2 0; #X connect 8 0 13 0; #X connect 11 0 14 0; #X connect 13 0 11 0; #X connect 14 0 10 0; #X restore 678 278 pd init_tables; #X obj 678 233 loadbang; #N canvas 0 22 450 300 (subpatch) 0; #X array in 800 float 0; #X coords 0 1 799 -1 399 100 1; #X restore 483 25 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array filt 200 float 0; #X coords 0 0.1 199 -0.1 99 100 1; #X restore 483 219 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array out 800 float 0; #X coords 0 1 799 -1 399 100 1; #X restore 483 382 graph; #X text 94 464 IEM KUG; #X text 73 452 musil; #X text 108 452 @; #X text 116 452 iem.at; #X text 77 474 Graz \, Austria; #X text 248 365 initial arguments:; #X text 78 97 (the number of samples which were correlated are: the positive minimum of the difference (src1-src2) and dst array lengths) ; #X text 226 377 1.arg: source1-name; #X text 226 389 2.arg: source2-name; #X text 226 401 3.arg: destination-name; #X msg 77 302 bang; #X obj 678 257 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 12 12 tab_conv; #X obj 55 75 tab_conv in filt out; #X text 29 441 (c) Thomas Musil 2000 - 2009; #X msg 109 324 src1 in; #X msg 124 345 src2 filt; #X msg 135 366 dst out; #X obj 63 394 tab_conv in filt out; #X msg 54 251 0 0 0 800 200; #N canvas 0 22 450 300 (subpatch) 0; #X array in2 16 float 2; #X coords 0 1 16 -1 160 100 1; #X restore 903 25 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array filt2 4 float 2; #X coords 0 1 4 -1 40 100 1; #X restore 903 151 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array out2 19 float 2; #X coords 0 1 19 -1 190 100 1; #X restore 903 282 graph; #X obj 972 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 972 246 tab_conv in2 filt2 out2; #X msg 971 139 \; filt2 0 0.9 0.7 0.5 0.3 \; in2 const 0 \; in2 1 0.9 \; in2 8 0.9 \; in2 14 -0.9; #X text 162 250 not working yet; #X text 25 158 !!! array length of src1 + array length of src2 - 1 ; #X text 391 158 >= array length of dst !!!; #X text 78 39 convolutes the 2nd array "src2" with the 1st array "src1" to the destination array "dst"; #X connect 0 0 20 0; #X connect 3 0 18 0; #X connect 17 0 25 0; #X connect 18 0 2 0; #X connect 20 0 1 0; #X connect 22 0 25 0; #X connect 23 0 25 0; #X connect 24 0 25 0; #X connect 26 0 25 0; #X connect 30 0 31 0; iem_tab/tab_ge_scalar-help.pd0000644000175000017500000000462411120262740016732 0ustar zmoelnigzmoelnig#N canvas 22 55 888 592 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.485714 -0.457143 -0.4 -0.285713 -0.0571409 0.157146 0.328575 0.442861 0.557148 0.628577 0.714292 0.800006 0.85715 0.885721 0.885721 0.871435 0.842864 0.757149 0.557148 0.41429 0.257146 -0.0142835 -0.314285 -0.528572 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.41429 0.242861 0.0857169 -0.0571409 -0.242856 -0.385714 -0.542858 -0.685716 -0.757145 -0.800002 -0.828574 -0.828574 -0.814288 -0.800002 -0.785716 -0.757145 -0.728573 -0.67143 -0.585715 -0.471429 -0.271428 -0.0857125 0.114288 0.228575 0.314289 0.385718 0.414285 0.428571 0.457143 0.471428 0.485714 0.485714 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 201 332 1.arg: source-name; #X text 201 345 2.arg: destination-name; #X text 31 162 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 224 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 178 1.) src onset; #X text 42 189 2.) dst onset; #X text 42 200 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 205 72 (the number of samples which were compared are:; #X msg 48 228 0 0 100 0.5; #X text 12 3 tab_ge_scalar; #X obj 61 78 tab_ge_scalar src dst; #X obj 59 331 tab_ge_scalar src dst; #X text 129 29 compare "greater than or equal to" the src-array with this scalar to dst-array; #X connect 4 0 30 0; #X connect 5 0 30 0; #X connect 6 0 29 0; #X connect 7 0 29 0; #X connect 27 0 30 0; #X connect 29 0 2 0; #X connect 30 0 3 0; iem_tab/tab_complex_mul-help.pd0000644000175000017500000000702711141231101017324 0ustar zmoelnigzmoelnig#N canvas 132 30 862 634 10; #N canvas 0 22 450 300 (subpatch) 0; #X array re1 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 481 29 graph; #X obj 61 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 54 439 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array im1 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 481 71 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array re2 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 606 29 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array im2 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 606 71 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array re3 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 735 28 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array im3 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 735 70 graph; #X msg 710 152 \; re1 const 0.9 \; im1 const 0.6 \; re2 const 0.7 \; im2 const -0.8; #X obj 61 78 tab_complex_mul re1 im1 re2 im2 re3 im3; #X obj 662 472 tabread re3; #X obj 745 472 tabread im3; #X msg 711 439 2; #X floatatom 662 495 5 0 0 0 - - -; #X floatatom 745 496 5 0 0 0 - - -; #X obj 692 350 *; #X obj 715 350 *; #X obj 760 350 *; #X obj 783 350 *; #X obj 767 372 +; #X obj 698 372 -; #X msg 692 304 0.9 0.7; #X msg 715 328 0.6 -0.8; #X floatatom 699 395 5 0 0 0 - - -; #X msg 760 305 0.9 -0.8; #X msg 777 329 0.6 0.7; #X floatatom 767 394 5 0 0 0 - - -; #X obj 54 418 tab_complex_mul re1 im1 re2 im2 re3 im3; #X msg 74 258 src1_re re1; #X msg 191 368 dst_re re3; #X msg 232 391 dst_im im3; #X msg 91 284 src1_im im1; #X msg 143 309 src2_re re2; #X msg 161 335 src2_im im2; #X msg 40 234 0 0 0 0 0 0 64; #X text 84 146 list of 7 floats:; #X text 353 419 1.arg: real_source1-name; #X text 353 431 2.arg: imag_source1-name; #X text 353 443 3.arg: real_source2-name; #X text 354 454 4.arg: imag_source2-name; #X text 354 466 5.arg: real_destination-name; #X text 354 477 6.arg: imag_destination-name; #X obj 728 281 t b b b b; #X obj 728 257 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 710 131 loadbang; #X text 87 537 IEM KUG; #X text 66 525 musil; #X text 101 525 @; #X text 109 525 iem.at; #X text 70 547 Graz \, Austria; #X text 12 7 tab_complex_mul; #X text 375 407 initial arguments:; #X text 115 99 (the number of samples which were multiplied are:; #X text 105 155 1.) src1_re-onset; #X text 105 165 2.) src1_im-onset; #X text 105 175 3.) src2_re-onset; #X text 105 185 4.) src2_im-onset; #X text 105 195 5.) dst_re-onset; #X text 105 205 6.) dst_im-onset; #X text 105 215 7.) number of samples to multiply; #X text 81 39 multiply the complex src1-arrays with the complex src2-arrays to complex dst-array; #X text 128 113 the minimum of the 6 array lengths); #X text 22 514 (c) Thomas Musil 2000 - 2009; #X connect 1 0 10 0; #X connect 10 0 2 0; #X connect 11 0 14 0; #X connect 12 0 15 0; #X connect 13 0 11 0; #X connect 13 0 12 0; #X connect 16 0 21 0; #X connect 17 0 21 1; #X connect 18 0 20 0; #X connect 19 0 20 1; #X connect 20 0 27 0; #X connect 21 0 24 0; #X connect 22 0 16 0; #X connect 23 0 17 0; #X connect 25 0 18 0; #X connect 26 0 19 0; #X connect 28 0 3 0; #X connect 29 0 28 0; #X connect 30 0 28 0; #X connect 31 0 28 0; #X connect 32 0 28 0; #X connect 33 0 28 0; #X connect 34 0 28 0; #X connect 35 0 28 0; #X connect 43 0 22 0; #X connect 43 1 23 0; #X connect 43 2 25 0; #X connect 43 3 26 0; #X connect 44 0 43 0; #X connect 45 0 9 0; iem_tab/tab_counter-help.pd0000644000175000017500000000523611141231101016457 0ustar zmoelnigzmoelnig#N canvas 115 92 872 576 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 0 0 0 0 0 0 0 0 0 0.9 0 0 0 0 0 0 0 0 0 0.9 0 0 0 0 0 0 0 0 0 0.9 0 0 0 0 0 0 0 0 0 0.9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 1 99 0 200 140 1; #X restore 544 234 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 10 99 0 200 140 1; #X restore 544 413 graph; #X obj 53 146 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 55 398 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 219 367 1.arg: source-name; #X msg 146 317 dst dst; #X msg 101 296 src src; #X text 219 380 2.arg: destination-name; #X obj 55 359 tab_gt_scalar src dst; #X obj 53 121 tab_counter src dst; #X msg 82 93 reset; #X obj 53 33 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 55 273 0 0 100; #N canvas 0 22 462 312 (subpatch) 0; #X msg 175 59 \; src const 0; #X msg 88 57 \; src \$1 0.9; #X floatatom 89 30 5 0 0 0 - - -; #X msg 88 127 \; dst ylabel -5.15 0 1 2 3 4 5 6 7 8 9 10; #X msg 87 93 \; dst yticks 0 1 1; #X obj 22 64 loadbang; #X connect 2 0 1 0; #X connect 5 0 4 0; #X connect 5 0 3 0; #X restore 496 285 pd; #X text 37 222 list of 3 floats:; #X text 78 455 IEM KUG; #X text 57 443 musil; #X text 92 443 @; #X text 100 443 iem.at; #X text 61 465 Graz \, Austria; #X text 49 233 1.) src onset; #X text 49 243 2.) dst onset; #X text 252 354 initial arguments:; #X text 64 379 output; #X text 158 296 xxx : change source name; #X text 199 318 xxx : change destination name; #X text 135 162 the minimum of both array lengths); #X text 12 3 tab_counter; #X msg 549 36 \; src 9 0.9 \; src 19 0.9 \; src 29 0.9 \; src 39 0.9 ; #X text 77 27 each element of the source array controls an increment counter in the destination array \, a nonzero value lets increment the counter value by one \, a zero value resets the counter value to zero.; #X text 124 93 resets all counter values to zero; #X text 122 148 (the number of samples which control counters are: ; #X text 49 253 3.) n samples to control n counters; #X text 13 432 (c) Thomas Musil 2000 - 2009; #X msg 684 37 \; src 9 -0.1 \; src 19 0 \; src 29 0 \; src 39 0.9; #X msg 686 133 \; src 9 0 \; src 19 0 \; src 29 0 \; src 39 0; #X msg 545 132 \; src 9 0 \; src 19 0.9 \; src 29 -0.1 \; src 39 0 ; #X text 536 15 4 indices incr.; #X text 677 14 2 indices incr.; #X text 537 112 2 indices incr.; #X text 695 114 reset; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 8 0 3 0; #X connect 9 0 2 0; #X connect 10 0 9 0; #X connect 11 0 9 0; #X connect 12 0 8 0; iem_tab/tab_ge-help.pd0000644000175000017500000000651011120262740015401 0ustar zmoelnigzmoelnig#N canvas 116 92 859 564 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 62 423 musil; #X text 92 423 @; #X text 98 423 iem.at; #X text 61 445 Graz \, Austria; #X text 13 412 (c) Thomas Musil 2000 - 2006; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 208 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 195 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X text 12 3 tab_ge; #X obj 61 78 tab_ge src1 src2 dst; #X obj 59 301 tab_ge src1 src2 dst; #X text 90 29 compare "greater than or equal to" the 2 src-arrays to dst-array; #X connect 2 0 32 0; #X connect 5 0 33 0; #X connect 7 0 33 0; #X connect 8 0 33 0; #X connect 9 0 33 0; #X connect 32 0 3 0; #X connect 33 0 4 0; iem_tab/tab_add_scalar-help.pd0000644000175000017500000000472411141231101017056 0ustar zmoelnigzmoelnig#N canvas 115 92 864 568 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 527 46 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 211 336 1.arg: source-name; #X msg 197 270 dst dst; #X msg 47 36 0.5; #X msg 145 247 src src; #X msg 82 37 -0.5; #X obj 61 78 tab_add_scalar src dst; #X obj 59 301 tab_add_scalar src dst; #X msg 48 227 50 20 50 -0.8; #X text 211 349 2.arg: destination-name; #X text 129 29 add the src-array with this scalar to dst-array ; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 58 463 musil; #X text 92 463 @; #X text 100 463 iem.at; #X text 61 485 Graz \, Austria; #X text 234 322 initial arguments:; #X text 71 322 output; #X text 250 271 xxx : change destination name; #X text 12 3 tab_add_scalar; #X text 218 86 the minimum of both array lengths); #X text 197 246 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 42 200 3.) n samples to add; #X text 42 210 4.) added scalar value; #X text 205 72 (the number of samples which were added are:; #X text 13 452 (c) Thomas Musil 2000 - 2009; #X connect 5 0 10 0; #X connect 6 0 9 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 9 0 2 0; #X connect 10 0 3 0; #X connect 11 0 10 0; iem_tab/tab_const-help.pd0000644000175000017500000000411111141231101016115 0ustar zmoelnigzmoelnig#N canvas 117 93 790 448 10; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 1; #A 0 0 0 0 0 0 0 0.0428571 0.1 0.128571 0.185714 0.257143 0.3 0.371429 0.428571 0.471429 0.557143 0.614286 0.671429 0.4 0.171429 0.0714286 -0.0857142 -0.285714 -0.557143 -0.542857 -0.485714 -0.457143 -0.428571 -0.357143 -0.314286 -0.271429 -0.221429 -0.171429 -0.128571 -0.0857143 -0.0428571 1.49012e-08 0.0428572 0.0857143 0.128571 0.171429 0.271429 0.357143 0.442857 0.471429 -0.514286 -0.514286 -0.485714 -0.428571 -0.342857 -0.292857 -0.242857 -0.2 -0.157143 -0.0285715 0.0357142 0.1 0.152381 0.204762 0.257143 0.321429 0.385714 0.435714 0.485714 0.528571 0.571429 0.621429 -0.242857 -0.414286 -0.414286 -0.4 -0.357143 -0.328571 -0.3 -0.257143 -0.214286 -0.185714 -0.157143 -0.128571 -0.0785714 -0.0285714 0.00476191 0.0380952 0.0714286 0.114286 0.157143 0.2 0.242857 0.278571 0.314286 -0.228571 -0.242857 -0.214286 -0.2 -0.142857 -0.114286 -0.0714285 -0.0285714 3.53903e-08 0.114286; #X coords 0 1 99 -1 200 140 1; #X restore 518 36 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 130 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 60 302 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 122 218 dst dst; #X obj 61 102 tab_const dst; #X msg 60 195 30 50 0.5; #X text 172 270 1.arg: destination-name; #X obj 60 261 tab_const dst; #X msg 82 59 -0.7; #X msg 114 78 0.8; #X text 11 6 tab_const; #X text 90 29 set all samples of array to zero; #X text 114 58 set all samples of array to this float value ; #X text 55 163 1.) dst onset; #X text 55 174 2.) n samples to set; #X text 190 257 initial arguments:; #X text 174 219 xxx : change destination name; #X text 75 374 IEM KUG; #X text 54 362 musil; #X text 89 362 @; #X text 97 362 iem.at; #X text 58 384 Graz \, Austria; #X text 65 280 output; #X text 43 153 list of 2 floats:; #X text 10 351 (c) Thomas Musil 2000 - 2009; #X connect 1 0 5 0; #X connect 4 0 8 0; #X connect 5 0 2 0; #X connect 6 0 8 0; #X connect 8 0 3 0; #X connect 9 0 5 0; #X connect 10 0 5 0; iem_tab/tab_complex_inv-help.pd0000644000175000017500000000437511141231101017326 0ustar zmoelnigzmoelnig#N canvas 132 30 858 524 10; #N canvas 0 22 450 300 (subpatch) 0; #X array re1 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 451 29 graph; #X obj 61 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 40 381 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array im1 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 451 71 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array re2 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 596 29 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array im2 100 float 0; #X coords 0 1 99 -1 100 40 1; #X restore 596 71 graph; #X msg 700 247 2; #X floatatom 651 303 5 0 0 0 - - -; #X floatatom 734 304 5 0 0 0 - - -; #X obj 710 131 loadbang; #X text 96 444 IEM KUG; #X text 75 432 musil; #X text 110 432 @; #X text 118 432 iem.at; #X text 79 454 Graz \, Austria; #X text 324 276 initial arguments:; #X text 12 7 tab_complex_inv; #X text 81 39 invert the complex src-arrays to the complex dst-arrays ; #X obj 61 78 tab_complex_inv re1 im1 re2 im2; #X text 128 113 the minimum of the 4 array lengths); #X text 115 99 (the number of samples which were inverted are:; #X msg 74 253 src_re re1; #X msg 91 279 src_im im1; #X msg 110 306 dst_re re2; #X msg 143 331 dst_im im2; #X obj 40 360 tab_complex_inv re1 im1 re2 im2; #X text 302 312 3.arg: real_destination-name; #X text 302 323 4.arg: imag_destination-name; #X text 302 288 1.arg: real_source-name; #X text 302 300 2.arg: imag_source-name; #X obj 651 280 tabread re2; #X obj 734 280 tabread im2; #X msg 710 152 \; re1 const 0.8 \; im1 const -0.6; #X text 105 155 1.) src_re-onset; #X text 105 165 2.) src_im-onset; #X text 105 175 3.) dst_re-onset; #X text 105 185 4.) dst_im-onset; #X text 105 195 5.) number of samples to multiply; #X text 84 146 list of 5 floats:; #X msg 40 229 0 0 0 0 64; #X text 31 421 (c) Thomas Musil 2000 - 2009; #X connect 1 0 19 0; #X connect 7 0 31 0; #X connect 7 0 32 0; #X connect 10 0 33 0; #X connect 19 0 2 0; #X connect 22 0 26 0; #X connect 23 0 26 0; #X connect 24 0 26 0; #X connect 25 0 26 0; #X connect 26 0 3 0; #X connect 31 0 8 0; #X connect 32 0 9 0; #X connect 40 0 26 0; iem_tab/tab_sqrt-help.pd0000644000175000017500000000461211120262740016000 0ustar zmoelnigzmoelnig#N canvas 116 92 786 482 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 0.916135 0.888992 0.83593 0.810011 0.784501 0.759399 0.734704 0.710418 0.663071 0.640009 0.595111 0.573274 0.551845 0.510212 0.490007 0.450823 0.413271 0.395108 0.377353 0.326536 0.310413 0.279392 0.264494 0.250004 0.222248 0.196126 0.171635 0.160003 0.148778 0.127553 0.0987772 0.0900016 0.0736748 0.0661237 0.0522459 0.0459193 0.0344905 0.0246944 0.0204086 0.0130616 0.0100003 0.00326543 0.00183682 0.000816378 5.03628e-013 0.000204064 0.0018367 0.00510201 0.00510201 0.00999999 0.0165306 0.0204082 0.0293879 0.0400002 0.0459187 0.05898 0.0661229 0.0816333 0.0816333 0.0987763 0.10796 0.127552 0.13796 0.148777 0.160001 0.183675 0.196124 0.208982 0.235921 0.250002 0.279391 0.294697 0.310411 0.343065 0.360004 0.377351 0.395106 0.431841 0.470209 0.490005 0.510209 0.530822 0.551843 0.573271 0.595108 0.617354 0.640007 0.663068 0.686538 0.710416 0.734702 0.734702 0.759396 0.784498 0.810009 0.835928 0.862254 0.862254 0.88899 0.916133; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 534 176 graph; #X obj 60 35 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 60 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 58 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 58 215 50 20 50; #X text 194 318 1.arg: source-name; #X text 194 331 2.arg: destination-name; #X msg 115 235 src src; #X msg 165 253 dst dst; #X text 184 73 (the number of samples which are copied are:; #X text 197 87 the minimum of both array lengths); #X text 43 168 list of 3 floats:; #X text 77 419 IEM KUG; #X text 61 407 musil; #X text 91 407 @; #X text 97 407 iem.at; #X text 60 429 Graz \, Austria; #X text 12 396 (c) Thomas Musil 2000 - 2006; #X text 55 179 1.) src onset; #X text 55 189 2.) dst onset; #X text 225 306 initial arguments:; #X text 73 323 output; #X text 172 233 xxx : change source name; #X text 218 252 xxx : change destination name; #X text 11 7 tab_sqrt; #X text 89 33 copy square root value from src to dst; #X obj 60 82 tab_sqrt src dst; #X text 55 198 3.) n samples to copy square root; #X obj 58 306 tab_sqrt src dst; #X connect 2 0 27 0; #X connect 5 0 29 0; #X connect 8 0 29 0; #X connect 9 0 29 0; #X connect 27 0 3 0; #X connect 29 0 4 0; iem_tab/tab_rifft-help.pd0000644000175000017500000001436712023647533016143 0ustar zmoelnigzmoelnig#N canvas 24 39 991 674 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 210 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array src_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 327 graph; #X obj 24 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 24 122 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 513 graph; #X msg 125 298 fftsize 64; #X text 309 425 initial arguments:; #X text 10 0 tab_rifft; #X text 93 -1 real inverse FTT with arrays; #X text 37 147 list of 3 floats:; #X msg 587 540 \; dst const 0; #X obj 62 322 tab_rifft src_re src_im dst 64; #X obj 24 94 tab_rifft src_re src_im dst 64; #X text 49 158 1.) src_re-onset; #X text 49 168 2.) src_im-onset; #X text 49 178 3.) dst-onset; #X msg 62 207 20 20 30; #X msg 76 230 src_re src_re; #X msg 89 252 src_im src_im; #X msg 104 275 dst dst; #X text 269 438 1.arg: real source-name; #X text 269 450 2.arg: imag_source-name; #X text 269 462 3.arg: destination-name; #X text 45 56 calculates a real inverse fourier transformation of complex src-arrays to a real dst-array; #X text 269 474 4.arg: ifftsize; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 31 graph; #X floatatom 479 40 5 0 63 0 - - -; #N canvas 0 22 486 336 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 61 89 \; src const 0 \; src \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 479 59 pd generate_a_dirac; #X floatatom 519 40 5 -32 32 0 - - -; #N canvas 0 22 515 439 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 308 / 32; #X obj 219 127 t b f; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 90 70 * -1; #X obj 39 310 / -32; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 151 pd counter; #N canvas 193 158 458 308 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 38 154 pd counter; #X obj 219 106 clip 0 32; #X obj 39 108 clip 0 32; #X obj 39 333 tabwrite src; #X obj 219 331 tabwrite src; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 1 1 22 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 22 0; #X connect 7 0 17 0; #X connect 7 1 5 1; #X connect 8 0 15 0; #X connect 8 1 19 0; #X connect 9 0 10 0; #X connect 9 1 21 1; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 14 0 18 0; #X connect 14 1 13 1; #X connect 15 0 20 0; #X connect 16 0 21 0; #X connect 17 0 1 0; #X connect 18 0 9 0; #X connect 19 0 7 0; #X connect 20 0 14 0; #X restore 519 79 pd generate_a_cos; #X floatatom 560 40 5 -31 31 0 - - -; #N canvas 0 22 507 431 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 314 / 32; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 132 t b f; #X obj 54 287 sin; #X obj 54 312 / -32; #X obj 102 60 moses 0; #X obj 54 88 * -1; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X obj 54 334 tabwrite src; #X obj 246 337 tabwrite src; #X connect 0 0 17 0; #X connect 1 0 2 0; #X connect 1 1 22 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 22 0; #X connect 6 0 7 0; #X connect 7 0 20 0; #X connect 7 1 4 1; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 9 1 21 1; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 15 0; #X connect 13 0 14 0; #X connect 14 0 19 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 21 0; #X connect 17 0 18 0; #X connect 17 1 6 0; #X connect 18 0 13 0; #X connect 19 0 9 0; #X connect 20 0 1 0; #X restore 560 100 pd generate_a_sin; #X obj 471 258 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 471 333 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 471 305 tab_rfft src src_re src_im 64; #X msg 590 127 \; src const 0; #X text 102 464 IEM KUG; #X text 81 452 musil; #X text 116 452 @; #X text 124 452 iem.at; #X text 85 474 Graz \, Austria; #X text 37 441 (c) Thomas Musil 2000 - 2009; #X text 521 17 1.); #X text 469 236 2.); #X text 44 25 3.); #X connect 2 0 13 0; #X connect 6 0 12 0; #X connect 12 0 4 0; #X connect 13 0 3 0; #X connect 17 0 12 0; #X connect 18 0 12 0; #X connect 19 0 12 0; #X connect 20 0 12 0; #X connect 27 0 28 0; #X connect 29 0 30 0; #X connect 31 0 32 0; #X connect 33 0 35 0; #X connect 35 0 34 0; iem_tab/tab_add-help.pd0000644000175000017500000000721511141231101015527 0ustar zmoelnigzmoelnig#N canvas 116 92 859 564 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 22 450 300 (subpatch) 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-06 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.428564 0.457135 0.485707 0.499992 0.514278 0.499992 0.471421 0.44285 0.414279 0.357136 0.285708 0.171423 0.0999952 0.0142815 -0.100003 -0.214288 -0.314288 -0.385716 -0.457144 -0.471429 -0.514286 -0.500001 -0.47143 -0.442858 -0.414287 -0.37143 -0.300002 -0.228574 -0.157146 -0.0714324 0.0571381 0.128566 0.199994 0.271422 0.34285 0.414278 0.457135 0.485707 0.499992 0.528563 0.542849 0.499992 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 90 29 add the 2 src-arrays to dst-array; #X obj 61 78 tab_add src1 src2 dst; #X obj 59 301 tab_add src1 src2 dst; #X text 78 435 IEM KUG; #X text 58 423 musil; #X text 92 423 @; #X text 100 423 iem.at; #X text 61 445 Graz \, Austria; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 12 3 tab_add; #X text 225 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 56 187 4.) n samples to add; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 212 72 (the number of samples which were added are:; #X text 13 412 (c) Thomas Musil 2000 - 2009; #X connect 2 0 13 0; #X connect 5 0 14 0; #X connect 7 0 14 0; #X connect 8 0 14 0; #X connect 9 0 14 0; #X connect 13 0 3 0; #X connect 14 0 4 0; iem_tab/tab_le_scalar-help.pd0000644000175000017500000000462111120262740016734 0ustar zmoelnigzmoelnig#N canvas 22 55 884 588 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.485714 -0.457143 -0.4 -0.285713 -0.0571409 0.157146 0.328575 0.442861 0.557148 0.628577 0.714292 0.800006 0.85715 0.885721 0.885721 0.871435 0.842864 0.757149 0.557148 0.41429 0.257146 -0.0142835 -0.314285 -0.528572 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.41429 0.242861 0.0857169 -0.0571409 -0.242856 -0.385714 -0.542858 -0.685716 -0.757145 -0.800002 -0.828574 -0.828574 -0.814288 -0.800002 -0.785716 -0.757145 -0.728573 -0.67143 -0.585715 -0.471429 -0.271428 -0.0857125 0.114288 0.228575 0.314289 0.385718 0.414285 0.428571 0.457143 0.471428 0.485714 0.485714 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 201 332 1.arg: source-name; #X text 201 345 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 62 463 musil; #X text 92 463 @; #X text 98 463 iem.at; #X text 61 485 Graz \, Austria; #X text 13 452 (c) Thomas Musil 2000 - 2006; #X text 224 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 42 201 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 205 72 (the number of samples which were compared are:; #X msg 48 228 0 0 100 0.5; #X text 12 3 tab_le_scalar; #X text 129 29 compare "less than or equal to" the src-array with this scalar to dst-array; #X obj 61 78 tab_le_scalar src dst; #X obj 59 331 tab_le_scalar src dst; #X connect 4 0 31 0; #X connect 5 0 31 0; #X connect 6 0 30 0; #X connect 7 0 30 0; #X connect 27 0 31 0; #X connect 30 0 2 0; #X connect 31 0 3 0; iem_tab/tab_find_exact_peaks-help.pd0000644000175000017500000000572411141231101020271 0ustar zmoelnigzmoelnig#N canvas 178 103 949 490 10; #X obj 60 52 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 31 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 249 306 1.arg: source-name; #X floatatom 94 372 5 0 0 0 - - -; #X floatatom 143 373 5 0 0 0 - - -; #X msg 88 78 src src; #X msg 118 102 amp_sort; #X msg 120 124 freq_sort; #X floatatom 198 371 5 0 0 0 - - -; #X obj 263 369 pack 0 0 0; #X obj 263 392 print; #X msg 233 173 abs_min_height_diff 10; #X text 69 385 sort_index; #X text 204 382 amp; #X text 147 387 index; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 9.99997 9.28569 9.28569 10.7143 7.14284 7.85712 8.5714 39 10 11 38 8.5714 7.85712 8.5714 9.28569 8.5714 9.99997 39 40 41 38 12.8571 12.8571 14.2857 12.8571 11.4285 12.1428 11.4285 9.99997 10.7143 11.4285 9.99997 9.28569 9.28569 9.99997 10.7143 10.7143 45 9.99997 9.99997 10.7143 11.4285 12.1428 10.7143 11.4285 12.1428 11.4285 46 11.4285 11.4285 11.4285 12.1428 12.8571 11.4285 11.4285 12.1428 12.8571 12.1428 12.1428 12.1428 12.1428 12.1428 11.4285 11.4285 11.4285 11.4285 10.7143 48 49 43 11.4285 12.1428 13.5714 15 13.5714 13.5714 14.2857 14.2857 15 15 14.2857 14.2857 14.2857 15 15 15.7142 15.7142 51 53 15 15 15 15 15 14.2857 14.2857 15 15.7142 16.4285 16.4285; #X coords 0 100 99 0 200 140 1; #X restore 658 93 graph; #X msg 171 149 max_peaks 9; #X text 20 347 ready; #X msg 289 194 width_range 1 4; #X msg 289 216 width_range 1 1; #N canvas 0 22 466 316 (subpatch) 0; #X msg 355 125 \; src const 0; #X msg 303 175 \; src 37 45; #X msg 310 223 \; src 47 46; #X msg 187 177 \; src 67 48 49 43; #X msg 180 218 \; src 87 51 53; #X msg 44 223 \; src 7 39 10 11 38; #X msg 50 181 \; src 17 39 40 41 38; #X obj 65 25 loadbang; #X msg 33 50 \; src xticks 0 1 5; #X msg 34 84 \; src xlabel -5.15 0 10 20 30 40 50 60 70 80 90; #X connect 7 0 8 0; #X connect 7 0 9 0; #X restore 716 289 pd; #X obj 314 73 loadbang; #X text 89 50 calculate all peaks (index bin amplitude); #X text 218 61 of an array; #X text 78 442 IEM KUG; #X text 57 430 musil; #X text 92 430 @; #X text 100 430 iem.at; #X text 61 452 Graz \, Austria; #X text 267 296 initial arguments:; #X text 192 111 kind of order; #X text 258 150 maximum number of peaks detected; #X text 395 168 vertical difference between peak; #X text 399 177 and noise; #X text 406 205 width range of peak in bins; #X text 21 6 tab_exact_find_peaks; #X obj 60 302 tab_find_exact_peaks src; #X text 184 7 same like tab_find_peaks; #X text 13 419 (c) Thomas Musil 2000 - 2009; #X msg 289 240 width_range 3 5; #X connect 0 0 36 0; #X connect 5 0 36 0; #X connect 6 0 36 0; #X connect 7 0 36 0; #X connect 9 0 10 0; #X connect 11 0 36 0; #X connect 16 0 36 0; #X connect 18 0 36 0; #X connect 19 0 36 0; #X connect 21 0 6 0; #X connect 21 0 16 0; #X connect 21 0 11 0; #X connect 21 0 18 0; #X connect 36 0 1 0; #X connect 36 1 3 0; #X connect 36 1 9 0; #X connect 36 2 4 0; #X connect 36 2 9 1; #X connect 36 3 8 0; #X connect 36 3 9 2; #X connect 39 0 36 0; iem_tab/tab_powtodb-help.pd0000644000175000017500000000457711660764625016521 0ustar zmoelnigzmoelnig#N canvas 369 22 790 417 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 0.0214324 0.0214324 0.0214324 0.0214324 0.0214324 0.0214324 0.0357179 0.0357179 0.0428607 0.0428607 0.0428607 0.0500035 0.0642891 0.0714318 0.0785746 0.0857174 0.0857174 0.100003 0.100003 0.107146 0.107146 0.114289 0.114289 0.121431 0.121431 0.128574 0.128574 0.135717 0.14286 0.14286 0.14286 0.150002 0.157145 0.157145 0.171431 0.178574 0.185716 0.192859 0.200002 0.214287 0.214287 0.22143 0.228573 0.242859 0.242859 0.257144 0.257144 0.264287 0.278573 0.292858 0.300001 0.314286 0.335715 0.35 0.357143 0.364286 0.378571 0.392857 0.407143 0.414285 0.435714 0.442857 0.449999 0.457142 0.471428 0.485713 0.492856 0.499999 0.521427 0.52857 0.542856 0.542856 0.564284 0.578569 0.599998 0.621426 0.635712 0.642854 0.649997 0.671426 0.685711 0.699997 0.707139 0.714282 0.735711 0.757139 0.764282 0.771425 0.778567 0.799996 0.807138 0.821424 0.83571 0.864281 0.885709 0.885709 0.899995 0.935709 0.949994 0.957137; #X coords 0 1 99 0 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 100 99 0 200 140 1; #X restore 534 166 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 44 154 list of 3 floats:; #X text 222 273 1.arg: source-name; #X text 222 286 2.arg: destination-name; #X msg 154 213 src src; #X msg 185 234 dst dst; #X text 78 365 IEM KUG; #X text 57 353 musil; #X text 92 353 @; #X text 100 353 iem.at; #X text 61 375 Graz \, Austria; #X text 56 165 1.) src onset; #X text 56 175 2.) dst onset; #X text 231 261 initial arguments:; #X text 68 283 output; #X text 208 213 xxx : change source name; #X text 240 233 xxx : change destination name; #X text 205 69 (the number of samples which are copied are:; #X text 218 83 the minimum of both array lengths); #X text 13 342 (c) Thomas Musil 2000 - 2010; #X text 90 29 calculates the powtodb-value from src to dst; #X obj 61 78 tab_powtodb src dst; #X obj 59 264 tab_powtodb src dst; #X text 57 185 3.) n samples of powtodb; #X text 12 4 tab_powtodb; #X connect 2 0 26 0; #X connect 5 0 27 0; #X connect 9 0 27 0; #X connect 10 0 27 0; #X connect 26 0 3 0; #X connect 27 0 4 0; iem_tab/tab_le-help.pd0000644000175000017500000000650511120262740015412 0ustar zmoelnigzmoelnig#N canvas 116 92 863 568 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 62 423 musil; #X text 92 423 @; #X text 98 423 iem.at; #X text 61 445 Graz \, Austria; #X text 13 412 (c) Thomas Musil 2000 - 2006; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 208 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 195 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X text 12 3 tab_le; #X obj 61 78 tab_le src1 src2 dst; #X obj 59 301 tab_le src1 src2 dst; #X text 90 29 compare "less than or equal to" the 2 src-arrays to dst-array; #X connect 2 0 32 0; #X connect 5 0 33 0; #X connect 7 0 33 0; #X connect 8 0 33 0; #X connect 9 0 33 0; #X connect 32 0 3 0; #X connect 33 0 4 0; iem_tab/tab_sum-help.pd0000644000175000017500000000426611141231101015606 0ustar zmoelnigzmoelnig#N canvas 116 92 798 425 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 524 40 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 93 213 src src; #X obj 61 78 tab_sum src; #X floatatom 122 104 5 0 0 0 - - -; #X obj 59 244 tab_sum src; #X msg 59 188 50 20; #X floatatom 120 305 5 0 0 0 - - -; #X text 75 364 IEM KUG; #X text 54 352 musil; #X text 89 352 @; #X text 97 352 iem.at; #X text 58 374 Graz \, Austria; #X text 90 29 calc sum of all array elements; #X text 182 234 initial arguments:; #X text 65 260 output; #X text 11 6 tab_sum; #X text 55 171 2.) n samples to calc sum; #X text 142 213 xxx : change source name; #X text 164 247 1.arg: source-name; #X text 125 280 sum output; #X text 118 118 sum value; #X text 43 150 list of 2 floats:; #X text 55 160 1.) src onset; #X msg 391 84 \; src const 0.5; #X text 10 341 (c) Thomas Musil 2000 - 2009; #X connect 1 0 5 0; #X connect 4 0 7 0; #X connect 5 0 2 0; #X connect 5 1 6 0; #X connect 7 0 3 0; #X connect 7 1 9 0; #X connect 8 0 7 0; iem_tab/tab_mul-help.pd0000644000175000017500000000721611120262740015607 0ustar zmoelnigzmoelnig#N canvas 116 92 853 558 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 534 20 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 368 graph; #X obj 61 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 350 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 286 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.428564 0.457135 0.485707 0.499992 0.514278 0.499992 0.471421 0.44285 0.414279 0.357136 0.285708 0.171423 0.0999952 0.0142815 -0.100003 -0.214288 -0.314288 -0.385716 -0.457144 -0.471429 -0.514286 -0.500001 -0.47143 -0.442858 -0.414287 -0.37143 -0.300002 -0.228574 -0.157146 -0.0714324 0.0571381 0.128566 0.199994 0.271422 0.34285 0.414278 0.457135 0.485707 0.499992 0.528563 0.542849 0.499992 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 171 graph; #X msg 136 243 src1 src1; #X msg 195 265 src2 src2; #X msg 59 221 50 50 20 50; #X text 45 149 list of 4 floats:; #X text 212 363 3.arg: destination-name; #X text 78 445 IEM KUG; #X text 62 433 musil; #X text 92 433 @; #X text 98 433 iem.at; #X text 61 455 Graz \, Austria; #X text 13 422 (c) Thomas Musil 2000 - 2006; #X text 234 322 initial arguments:; #X text 72 329 output; #X text 306 285 xxx : change destination name; #X text 208 96 the minimum of the 3 array lengths); #X text 56 187 3.) dst onset; #X text 56 165 1.) src_1 onset; #X text 56 176 2.) src_2 onset; #X text 199 243 xxx : change source name 1; #X text 257 265 xxx : change source name 2; #X text 211 336 1.arg: source-name 1; #X text 211 349 2.arg: source-name 2; #X text 12 13 tab_mul; #X text 90 39 multiply the 2 src-arrays to dst-array; #X text 195 82 (the number of samples which were multiplied are:; #X text 56 197 4.) n samples to multiply; #X obj 59 311 tab_mul src1 src2 dst; #X obj 61 88 tab_mul src1 src2 dst; #X connect 2 0 34 0; #X connect 5 0 33 0; #X connect 7 0 33 0; #X connect 8 0 33 0; #X connect 9 0 33 0; #X connect 33 0 4 0; #X connect 34 0 3 0; iem_tab/tab_dbtorms-help.pd0000644000175000017500000000441611660764625016505 0ustar zmoelnigzmoelnig#N canvas 369 22 790 417 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 0.0214324 5.77858 10.0643 15.0643 17.2072 22.2072 31.4929 33.6358 37.2072 38.9929 40.7786 45.0644 49.3501 51.4929 53.6358 55.4215 57.2072 59.3501 61.493 62.6834 63.8739 65.0644 66.8501 68.6358 70.4215 70.7787 71.493 72.9215 73.2787 73.6358 75.0644 75.4216 75.7787 76.493 76.8501 77.2073 77.5644 77.9216 78.6358 79.3501 80.0644 80.7787 81.493 81.8501 82.2073 83.6358 84.3501 85.0644 85.4216 85.7787 87.2073 87.5644 87.9216 88.6359 89.3501 90.0644 90.7787 90.7787 91.493 92.2073 92.2073 92.2073 92.2073 92.2073 92.2073 92.2073 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 94.3502 94.3502 94.3502 95.0644 95.0644 95.7787 96.493 96.493 96.493 97.9216 98.6359 98.6359 99.3502 99.3502 99.3502 100.064 100.064 100.064 100.064 100.779 100.779; #X coords 0 100 99 0 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 0 200 140 1; #X restore 534 166 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 44 154 list of 3 floats:; #X text 222 273 1.arg: source-name; #X text 222 286 2.arg: destination-name; #X msg 154 213 src src; #X msg 185 234 dst dst; #X text 78 365 IEM KUG; #X text 57 353 musil; #X text 92 353 @; #X text 100 353 iem.at; #X text 61 375 Graz \, Austria; #X text 56 165 1.) src onset; #X text 56 175 2.) dst onset; #X text 231 261 initial arguments:; #X text 68 283 output; #X text 208 213 xxx : change source name; #X text 240 233 xxx : change destination name; #X text 205 69 (the number of samples which are copied are:; #X text 218 83 the minimum of both array lengths); #X text 13 342 (c) Thomas Musil 2000 - 2010; #X text 12 4 tab_dbtorms; #X text 90 30 calculates the dbtorms-value from src to dst; #X obj 61 79 tab_dbtorms src dst; #X obj 59 264 tab_dbtorms src dst; #X text 57 185 3.) n samples of dbtorms; #X connect 2 0 27 0; #X connect 5 0 28 0; #X connect 9 0 28 0; #X connect 10 0 28 0; #X connect 27 0 3 0; #X connect 28 0 4 0; iem_tab/tab_dbtopow-help.pd0000644000175000017500000000441611660764625016511 0ustar zmoelnigzmoelnig#N canvas 369 22 790 417 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 0.0214324 5.77858 10.0643 15.0643 17.2072 22.2072 31.4929 33.6358 37.2072 38.9929 40.7786 45.0644 49.3501 51.4929 53.6358 55.4215 57.2072 59.3501 61.493 62.6834 63.8739 65.0644 66.8501 68.6358 70.4215 70.7787 71.493 72.9215 73.2787 73.6358 75.0644 75.4216 75.7787 76.493 76.8501 77.2073 77.5644 77.9216 78.6358 79.3501 80.0644 80.7787 81.493 81.8501 82.2073 83.6358 84.3501 85.0644 85.4216 85.7787 87.2073 87.5644 87.9216 88.6359 89.3501 90.0644 90.7787 90.7787 91.493 92.2073 92.2073 92.2073 92.2073 92.2073 92.2073 92.2073 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 93.6359 94.3502 94.3502 94.3502 95.0644 95.0644 95.7787 96.493 96.493 96.493 97.9216 98.6359 98.6359 99.3502 99.3502 99.3502 100.064 100.064 100.064 100.064 100.779 100.779; #X coords 0 100 99 0 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 0 200 140 1; #X restore 534 166 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 44 154 list of 3 floats:; #X text 222 273 1.arg: source-name; #X text 222 286 2.arg: destination-name; #X msg 154 213 src src; #X msg 185 234 dst dst; #X text 78 365 IEM KUG; #X text 57 353 musil; #X text 92 353 @; #X text 100 353 iem.at; #X text 61 375 Graz \, Austria; #X text 56 165 1.) src onset; #X text 56 175 2.) dst onset; #X text 231 261 initial arguments:; #X text 68 283 output; #X text 208 213 xxx : change source name; #X text 240 233 xxx : change destination name; #X text 205 69 (the number of samples which are copied are:; #X text 218 83 the minimum of both array lengths); #X text 13 342 (c) Thomas Musil 2000 - 2010; #X text 57 185 3.) n samples of dbtorms; #X text 12 4 tab_dbtopow; #X text 91 32 calculates the dbtopow-value from src to dst; #X obj 61 79 tab_dbtopow src dst; #X obj 59 264 tab_dbtopow src dst; #X connect 2 0 28 0; #X connect 5 0 29 0; #X connect 9 0 29 0; #X connect 10 0 29 0; #X connect 28 0 3 0; #X connect 29 0 4 0; iem_tab/tab_reverse-help.pd0000644000175000017500000000466011120262740016465 0ustar zmoelnigzmoelnig#N canvas 96 21 782 474 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.871431 -0.84286 -0.814288 -0.814288 -0.800002 -0.771431 -0.757145 -0.742859 -0.728574 -0.714288 -0.685716 -0.671431 -0.657145 -0.642859 -0.628573 -0.614288 -0.600002 -0.585716 -0.57143 -0.542859 -0.542859 -0.528573 -0.514287 -0.500002 -0.485716 -0.47143 -0.457144 -0.442859 -0.428573 -0.414287 -0.400002 -0.385716 -0.385716 -0.357144 -0.342859 -0.342859 -0.328573 -0.314287 -0.300001 -0.285716 -0.27143 -0.257144 -0.228573 -0.228573 -0.200001 -0.185715 -0.185715 -0.17143 -0.142858 -0.142858 -0.128572 -0.114287 -0.085715 -0.085715 -0.0571435 -0.028572 -0.0142863 -5.01052e-007 0.0142853 0.028571 0.0571425 0.0714283 0.0714283 0.0999998 0.114286 0.142857 0.142857 0.171429 0.185714 0.214286 0.228572 0.242857 0.257143 0.285715 0.3 0.328572 0.342858 0.357143 0.371429 0.400001 0.414286 0.428572 0.457143 0.471429 0.485715 0.500001 0.514286 0.542858 0.571429 0.585715 0.600001 0.628572 0.642858 0.657144 0.685715 0.700001 0.714287 0.742858 0.757144 0.77143; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 534 176 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 78 tab_reverse src dst; #X obj 59 341 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 195 314 1.arg: source-name; #X text 195 327 2.arg: destination-name; #X msg 116 231 src src; #X msg 166 249 dst dst; #X obj 59 302 tab_reverse src dst; #X text 185 69 (the number of samples which are copied are:; #X text 198 83 the minimum of both array lengths); #X text 12 3 tab_reverse; #X text 90 29 copy value from src to dst in reverse arrangement ; #X text 44 164 list of 3 floats:; #X text 78 415 IEM KUG; #X text 62 403 musil; #X text 92 403 @; #X text 98 403 iem.at; #X text 61 425 Graz \, Austria; #X text 13 392 (c) Thomas Musil 2000 - 2006; #X text 56 175 1.) src onset; #X text 56 185 2.) dst onset; #X text 226 302 initial arguments:; #X text 74 319 output; #X text 173 229 xxx : change source name; #X text 219 248 xxx : change destination name; #X text 56 195 3.) n samples to copy reversal; #X connect 2 0 4 0; #X connect 4 0 3 0; #X connect 6 0 11 0; #X connect 9 0 11 0; #X connect 10 0 11 0; #X connect 11 0 5 0; iem_tab/LICENSE.txt0000644000175000017500000000205210534775342014544 0ustar zmoelnigzmoelnigiem_tab - dynamic library for pd; handle array operations Copyright (C) 2000-2006 Thomas MUSIL [musil_at_iem.at] IEM - Institute of Electronic Music and Acoustics, Graz Inffeldgasse 10/3, 8010 Graz, Austria http://iem.at This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details ( GnuGPL.txt ). (e.g. http://www.gnu.org/copyleft/gpl.html) You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Graz, 15 Nov. 2006 Thomas Musiliem_tab/tab_sub-help.pd0000644000175000017500000000721611120262740015603 0ustar zmoelnigzmoelnig#N canvas 116 92 855 560 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 534 20 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 368 graph; #X obj 61 41 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 350 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 286 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.428564 0.457135 0.485707 0.499992 0.514278 0.499992 0.471421 0.44285 0.414279 0.357136 0.285708 0.171423 0.0999952 0.0142815 -0.100003 -0.214288 -0.314288 -0.385716 -0.457144 -0.471429 -0.514286 -0.500001 -0.47143 -0.442858 -0.414287 -0.37143 -0.300002 -0.228574 -0.157146 -0.0714324 0.0571381 0.128566 0.199994 0.271422 0.34285 0.414278 0.457135 0.485707 0.499992 0.528563 0.542849 0.499992 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 171 graph; #X msg 136 243 src1 src1; #X msg 195 265 src2 src2; #X msg 59 221 50 50 20 50; #X text 45 149 list of 4 floats:; #X text 212 363 3.arg: destination-name; #X text 78 445 IEM KUG; #X text 62 433 musil; #X text 92 433 @; #X text 98 433 iem.at; #X text 61 455 Graz \, Austria; #X text 13 422 (c) Thomas Musil 2000 - 2006; #X text 234 322 initial arguments:; #X text 72 329 output; #X text 306 285 xxx : change destination name; #X text 208 96 the minimum of the 3 array lengths); #X text 56 187 3.) dst onset; #X text 56 165 1.) src_1 onset; #X text 56 176 2.) src_2 onset; #X text 199 243 xxx : change source name 1; #X text 257 265 xxx : change source name 2; #X text 211 336 1.arg: source-name 1; #X text 211 349 2.arg: source-name 2; #X text 12 13 tab_sub; #X obj 61 88 tab_sub src1 src2 dst; #X obj 59 311 tab_sub src1 src2 dst; #X text 90 39 subtract the 2 src-arrays to dst-array; #X text 56 197 4.) n samples to subtract; #X text 195 82 (the number of samples which were subtracted are:; #X connect 2 0 30 0; #X connect 5 0 31 0; #X connect 7 0 31 0; #X connect 8 0 31 0; #X connect 9 0 31 0; #X connect 30 0 3 0; #X connect 31 0 4 0; iem_tab/READ_ME.txt0000644000175000017500000000063510534775342014563 0ustar zmoelnigzmoelnigThis library extends the performance of miller puckette's pure data (pd). iem_tab is written by Thomas Musil from IEM Graz Austria and it is compatible to miller puckette's pd-0.37-3 to pd-0.39-2. see also LICENCE.txt, GnuGPL.txt. The objects of iem_tab manipulate tables or arrays; you can set constant, copy, fft, ifft, reverse, find minimum or maximum, compare, add, subtract, multiplicate, divide arrays. iem_tab/tab_eq_scalar-help.pd0000644000175000017500000000421611141231101016727 0ustar zmoelnigzmoelnig#N canvas 22 55 884 588 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.542857 -0.614286 -0.657144 -0.67143 -0.700001 -0.714287 -0.757145 -0.757145 -0.757145 -0.742859 -0.742859 -0.728573 -0.714287 -0.685715 -0.657144 -0.585715 -0.528572 -0.4 -0.242856 -0.0428551 0.157146 0.342861 0.51429 0.728577 0.800006 0.828578 0.828578 0.828578 0.828578 0.800006 0.771435 0.714292 0.571433 0.528572 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5; #X coords 0 1 99 -1 200 140 1; #X restore 527 116 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 527 325 graph; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 370 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 178 272 dst dst; #X msg 129 249 src src; #X obj 61 78 tab_eq_scalar src dst; #X obj 59 331 tab_eq_scalar src dst; #X msg 47 36 0.5; #X msg 82 37 -0.5; #X text 221 332 1.arg: source-name; #X text 221 345 2.arg: destination-name; #X text 31 163 list of 4 floats:; #X text 78 475 IEM KUG; #X text 57 463 musil; #X text 92 463 @; #X text 100 463 iem.at; #X text 61 485 Graz \, Austria; #X text 244 318 initial arguments:; #X text 75 351 output; #X text 229 272 xxx : change destination name; #X text 218 86 the minimum of both array lengths); #X text 182 248 xxx : change source name; #X text 42 179 1.) src onset; #X text 42 190 2.) dst onset; #X text 12 3 tab_eq_scalar; #X text 42 201 3.) n samples to compare; #X text 42 210 4.) compared scalar value; #X text 129 29 compare "equal to" the src-array with this scalar to dst-array; #X text 205 72 (the number of samples which were compared are:; #X msg 48 228 0 0 100 0.5; #X text 13 452 (c) Thomas Musil 2000 - 2009; #X connect 4 0 7 0; #X connect 5 0 7 0; #X connect 6 0 2 0; #X connect 7 0 3 0; #X connect 8 0 6 0; #X connect 9 0 6 0; #X connect 30 0 7 0; iem_tab/tab_lt-help.pd0000644000175000017500000000647111120262740015433 0ustar zmoelnigzmoelnig#N canvas 116 92 859 564 10; #N canvas 0 0 450 300 graph1 0; #X array src1 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485715 0.471429 0.457144 0.442858 0.442858 0.428572 0.414286 0.385715 0.357143 0.342858 0.314286 0.285715 0.242857 0.185714 0.142857 0.114286 0.085714; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 0 450 300 graph1 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 535 358 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 340 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 255 276 dst dst; #N canvas 0 0 450 300 graph1 0; #X array src2 100 float 1; #A 0 0.557135 0.57142 0.557135 0.528564 0.499992 0.428564 0.357136 0.299994 0.0999951 -0.0571467 -0.157146 -0.228574 -0.300002 -0.328573 -0.357145 -0.385716 -0.400001 -0.400001 -0.385716 -0.385716 -0.37143 -0.364287 -0.357145 -0.328573 -0.300002 -0.271431 -0.24286 -0.214288 -0.14286 -0.085718 -0.0428611 -4.28595e-006 0.0428526 0.099995 0.171423 0.21428 0.257137 0.328565 0.371422 0.442849 0.457135 0.471421 0.471421 0.485706 0.485706 0.485706 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.485714 0.471429 0.457135 0.428564 0.371422 0.314279 0.242851 0.0857095 -0.0857178 -0.271431 -0.400001 -0.514286 -0.542858 -0.557143 -0.585714 -0.585714 -0.6 -0.6 -0.614286 -0.614286 -0.614286; #X coords 0 1 99 -1 200 140 1; #X restore 535 161 graph; #X msg 136 233 src1 src1; #X msg 195 255 src2 src2; #X msg 59 211 50 50 20 50; #X text 45 139 list of 4 floats:; #X text 212 353 3.arg: destination-name; #X text 78 435 IEM KUG; #X text 62 423 musil; #X text 92 423 @; #X text 98 423 iem.at; #X text 61 445 Graz \, Austria; #X text 13 412 (c) Thomas Musil 2000 - 2006; #X text 234 312 initial arguments:; #X text 72 319 output; #X text 306 275 xxx : change destination name; #X text 208 86 the minimum of the 3 array lengths); #X text 56 177 3.) dst onset; #X text 56 155 1.) src_1 onset; #X text 56 166 2.) src_2 onset; #X text 199 233 xxx : change source name 1; #X text 257 255 xxx : change source name 2; #X text 211 326 1.arg: source-name 1; #X text 211 339 2.arg: source-name 2; #X text 195 72 (the number of samples which were compared are:; #X text 56 187 4.) n samples to compare; #X text 12 3 tab_lt; #X text 90 29 compare less than" the 2 src-arrays to dst-array ; #X obj 61 78 tab_lt src1 src2 dst; #X obj 59 301 tab_lt src1 src2 dst; #X connect 2 0 33 0; #X connect 5 0 34 0; #X connect 7 0 34 0; #X connect 8 0 34 0; #X connect 9 0 34 0; #X connect 33 0 3 0; #X connect 34 0 4 0; iem_tab/tab_get_size-help.pd0000644000175000017500000000312511141230571016616 0ustar zmoelnigzmoelnig#N canvas 116 92 706 333 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 433 42 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 60 102 5 0 0 0 - - -; #X text 93 224 IEM KUG; #X text 72 212 musil; #X text 107 212 @; #X text 115 212 iem.at; #X text 76 234 Graz \, Austria; #X text 201 68 initial arguments:; #X text 11 6 tab_sum; #X text 183 81 1.arg: source-name; #X text 28 201 (c) Thomas Musil 2000 - 2009; #X obj 61 78 tab_get_size src; #X text 56 116 array size; #X text 90 29 calc size of array; #X connect 1 0 12 0; #X connect 12 0 2 0; iem_tab/tab_fft-help.pd0000644000175000017500000002446511141231101015564 0ustar zmoelnigzmoelnig#N canvas 29 22 965 544 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_re 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 239 graph; #X obj 24 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 24 122 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 62 371 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #N canvas 0 22 450 300 (subpatch) 0; #X array dst_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 353 graph; #X msg 103 276 dst_re dst_re; #X msg 118 299 dst_im dst_im; #X msg 139 322 fftsize 64; #X floatatom 473 22 5 0 63 0 - - -; #X msg 546 341 \; dst_re const 0 \; dst_im const 0; #X text 10 0 tab_fft; #X text 93 -1 complex FTT with arrays; #X text 102 464 IEM KUG; #X text 81 452 musil; #X text 116 452 @; #X text 124 452 iem.at; #X text 85 474 Graz \, Austria; #N canvas 0 22 474 324 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 60 103 \; src_re const 0 \; src_re \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 474 41 pd generate_a_dirac; #X floatatom 514 22 5 -32 32 0 - - -; #N canvas 0 22 531 484 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 308 / 32; #X obj 219 127 t b f; #X obj 219 331 tabwrite src_re; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 39 333 tabwrite src_re; #X obj 90 70 * -1; #X obj 39 310 / -32; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 151 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 38 154 pd counter; #X obj 219 106 clip 0 32; #X obj 39 108 clip 0 32; #X connect 0 0 9 0; #X connect 1 0 2 0; #X connect 1 1 8 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 8 0; #X connect 7 0 19 0; #X connect 7 1 5 1; #X connect 9 0 17 0; #X connect 9 1 21 0; #X connect 10 0 11 0; #X connect 10 1 16 1; #X connect 11 0 12 0; #X connect 12 0 14 0; #X connect 13 0 18 0; #X connect 14 0 13 0; #X connect 15 0 20 0; #X connect 15 1 14 1; #X connect 17 0 22 0; #X connect 18 0 16 0; #X connect 19 0 1 0; #X connect 20 0 10 0; #X connect 21 0 7 0; #X connect 22 0 15 0; #X restore 514 61 pd generate_a_cos; #X floatatom 555 22 5 -31 31 0 - - -; #N canvas 0 22 491 415 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 314 / 32; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 337 tabwrite src_re; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 132 t b f; #X obj 54 335 tabwrite src_re; #X obj 54 287 sin; #X obj 54 312 / -32; #X obj 102 60 moses 0; #X obj 54 88 * -1; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X connect 0 0 19 0; #X connect 1 0 2 0; #X connect 1 1 8 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 9 0; #X connect 5 0 8 0; #X connect 6 0 7 0; #X connect 7 0 22 0; #X connect 7 1 4 1; #X connect 9 0 5 0; #X connect 10 0 11 0; #X connect 10 1 16 1; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 17 0; #X connect 14 0 15 0; #X connect 15 0 21 0; #X connect 15 1 13 1; #X connect 17 0 18 0; #X connect 18 0 16 0; #X connect 19 0 20 0; #X connect 19 1 6 0; #X connect 20 0 14 0; #X connect 21 0 10 0; #X connect 22 0 1 0; #X restore 555 82 pd generate_a_sin; #X text 299 365 initial arguments:; #X text 45 56 calculates a complex fourier transformation of complex src-arrays to complex dst-arrays; #X text 37 147 list of 4 floats:; #X text 49 178 3.) dst_re-onset; #X text 49 188 4.) dst_im-onset; #X text 49 158 1.) src_re-onset; #X text 49 168 2.) src_im-onset; #X msg 62 207 20 20 30 30; #X text 259 412 4.arg: imag_destination-name; #X text 259 400 3.arg: real_destination-name; #X text 259 389 2.arg: imag_source-name; #X text 259 378 1.arg: real_source-name; #X text 259 424 5.arg: fftsize; #N canvas 0 22 450 300 (subpatch) 0; #X array src_im 100 float 0; #X coords 0 1 99 -1 199 100 1; #X restore 694 124 graph; #X obj 24 94 tab_fft src_re src_im dst_re dst_im 64; #X msg 76 230 src_re src_re; #X msg 90 253 src_im src_im; #X obj 62 348 tab_fft src_re src_im dst_re dst_im 64; #X msg 546 283 \; src_re const 0 \; src_im const 0; #X floatatom 474 132 5 0 63 0 - - -; #N canvas 0 22 478 328 generate_a_dirac 0; #X obj 61 62 clip 0 63; #X obj 61 32 inlet; #X msg 62 88 \; src_im const 0 \; src_im \$1 1; #X connect 0 0 2 0; #X connect 1 0 0 0; #X restore 474 151 pd generate_a_dirac; #X floatatom 514 132 5 -32 32 0 - - -; #N canvas 0 22 495 419 generate_a_cos 0; #X obj 120 18 inlet; #X obj 219 176 t f f; #X obj 219 211 / 32; #X obj 219 232 * 3.14159; #X obj 219 283 cos; #X obj 219 257 * 8; #X obj 219 308 / 32; #X obj 219 127 t b f; #X obj 120 43 moses 0; #X obj 39 178 t f f; #X obj 39 213 / 32; #X obj 39 234 * 3.14159; #X obj 39 285 cos; #X obj 39 259 * 8; #X obj 39 129 t b f; #X obj 90 70 * -1; #X obj 39 310 / -32; #X obj 40 334 tabwrite src_im; #X obj 220 331 tabwrite src_im; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 39 153 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 219 153 pd counter; #X obj 218 106 clip 0 32; #X obj 39 108 clip 0 32; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 1 1 18 1; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 4 0 6 0; #X connect 5 0 4 0; #X connect 6 0 18 0; #X connect 7 0 20 0; #X connect 7 1 5 1; #X connect 8 0 15 0; #X connect 8 1 21 0; #X connect 9 0 10 0; #X connect 9 1 17 1; #X connect 10 0 11 0; #X connect 11 0 13 0; #X connect 12 0 16 0; #X connect 13 0 12 0; #X connect 14 0 19 0; #X connect 14 1 13 1; #X connect 15 0 22 0; #X connect 16 0 17 0; #X connect 19 0 9 0; #X connect 20 0 1 0; #X connect 21 0 7 0; #X connect 22 0 14 0; #X restore 514 171 pd generate_a_cos; #X floatatom 555 132 5 -31 31 0 - - -; #N canvas 0 22 491 415 generate_a_sin 0; #X obj 102 37 inlet; #X obj 246 182 t f f; #X obj 246 217 / 32; #X obj 246 238 * 3.14159; #X obj 246 263 * 8; #X obj 246 314 / 32; #X obj 246 112 clip 0 31; #X obj 246 133 t b f; #X obj 246 289 sin; #X obj 54 180 t f f; #X obj 54 215 / 32; #X obj 54 236 * 3.14159; #X obj 54 261 * 8; #X obj 54 110 clip 0 31; #X obj 54 131 t b f; #X obj 54 287 sin; #X obj 54 312 / -32; #X obj 102 60 moses 0; #X obj 54 88 * -1; #X obj 246 337 tabwrite src_im; #X obj 54 336 tabwrite src_im; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 54 156 pd counter; #N canvas 193 158 454 304 counter 0; #X obj 108 25 inlet; #X obj 109 163 outlet; #X obj 109 133 f; #X obj 142 133 + 1; #X obj 108 50 t b b; #X msg 154 76 0; #X msg 109 75 64; #X obj 110 98 until; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 1 0; #X connect 3 0 2 1; #X connect 4 0 6 0; #X connect 4 1 5 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 2 0; #X restore 246 156 pd counter; #X connect 0 0 17 0; #X connect 1 0 2 0; #X connect 1 1 19 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 8 0; #X connect 5 0 19 0; #X connect 6 0 7 0; #X connect 7 0 22 0; #X connect 7 1 4 1; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 9 1 20 1; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 15 0; #X connect 13 0 14 0; #X connect 14 0 21 0; #X connect 14 1 12 1; #X connect 15 0 16 0; #X connect 16 0 20 0; #X connect 17 0 18 0; #X connect 17 1 6 0; #X connect 18 0 13 0; #X connect 21 0 9 0; #X connect 22 0 1 0; #X restore 555 192 pd generate_a_sin; #X text 37 441 (c) Thomas Musil 2000 - 2009; #X connect 2 0 37 0; #X connect 6 0 40 0; #X connect 7 0 40 0; #X connect 8 0 40 0; #X connect 9 0 18 0; #X connect 19 0 20 0; #X connect 21 0 22 0; #X connect 30 0 40 0; #X connect 37 0 3 0; #X connect 38 0 40 0; #X connect 39 0 40 0; #X connect 40 0 4 0; #X connect 42 0 43 0; #X connect 44 0 45 0; #X connect 46 0 47 0; iem_tab/tab_find_peaks-help.pd0000644000175000017500000000553711141231101017107 0ustar zmoelnigzmoelnig#N canvas 191 230 938 537 10; #X obj 60 52 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 31 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 200 306 1.arg: source-name; #X floatatom 94 372 5 0 0 0 - - -; #X floatatom 143 373 5 0 0 0 - - -; #X msg 88 78 src src; #X msg 118 102 amp_sort; #X msg 120 124 freq_sort; #X obj 60 302 tab_find_peaks src; #X floatatom 198 371 5 0 0 0 - - -; #X obj 263 369 pack 0 0 0; #X obj 263 392 print; #X msg 233 173 abs_min_height_diff 10; #X text 69 385 sort_index; #X text 204 382 amp; #X text 147 387 index; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 9.99997 9.28569 9.28569 10.7143 7.14284 7.85712 8.5714 39 10 11 38 8.5714 7.85712 8.5714 9.28569 8.5714 9.99997 39 40 41 38 12.8571 12.8571 14.2857 12.8571 11.4285 12.1428 11.4285 9.99997 10.7143 11.4285 9.99997 9.28569 9.28569 9.99997 10.7143 10.7143 45 9.99997 9.99997 10.7143 11.4285 12.1428 10.7143 11.4285 12.1428 11.4285 46 11.4285 11.4285 11.4285 12.1428 12.8571 11.4285 11.4285 12.1428 12.8571 12.1428 12.1428 12.1428 12.1428 12.1428 11.4285 11.4285 11.4285 11.4285 10.7143 48 49 43 11.4285 12.1428 13.5714 15 13.5714 13.5714 14.2857 14.2857 15 15 14.2857 14.2857 14.2857 15 15 15.7142 15.7142 51 53 15 15 15 15 15 14.2857 14.2857 15 15.7142 16.4285 16.4285; #X coords 0 100 99 0 200 140 1; #X restore 638 93 graph; #X msg 171 149 max_peaks 9; #X text 20 347 ready; #X msg 289 194 width_range 1 4; #X text 21 6 tab_find_peaks; #X msg 289 216 width_range 1 1; #N canvas 0 22 470 320 (subpatch) 0; #X msg 355 125 \; src const 0; #X msg 303 175 \; src 37 45; #X msg 310 223 \; src 47 46; #X msg 187 177 \; src 67 48 49 43; #X msg 180 218 \; src 87 51 53; #X msg 44 223 \; src 7 39 10 11 38; #X msg 50 181 \; src 17 39 40 41 38; #X obj 65 25 loadbang; #X msg 33 50 \; src xticks 0 1 5; #X msg 34 84 \; src xlabel -5.15 0 10 20 30 40 50 60 70 80 90; #X connect 7 0 8 0; #X connect 7 0 9 0; #X restore 696 289 pd; #X obj 311 69 loadbang; #X text 89 50 calculate all peaks (index bin amplitude); #X text 218 61 of an array; #X text 78 442 IEM KUG; #X text 57 430 musil; #X text 92 430 @; #X text 100 430 iem.at; #X text 61 452 Graz \, Austria; #X text 218 296 initial arguments:; #X text 190 111 kind of order; #X text 257 148 maximum number of peaks detected; #X text 395 171 vertical difference between peak; #X text 397 180 and noise; #X text 413 205 width range of peak in bins; #X text 13 419 (c) Thomas Musil 2000 - 2009; #X connect 0 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 1 0; #X connect 8 1 3 0; #X connect 8 1 10 0; #X connect 8 2 4 0; #X connect 8 2 10 1; #X connect 8 3 9 0; #X connect 8 3 10 2; #X connect 10 0 11 0; #X connect 12 0 8 0; #X connect 17 0 8 0; #X connect 19 0 8 0; #X connect 21 0 8 0; #X connect 23 0 6 0; #X connect 23 0 17 0; #X connect 23 0 12 0; #X connect 23 0 19 0; iem_tab/tab_abs-help.pd0000644000175000017500000000466511141231101015552 0ustar zmoelnigzmoelnig#N canvas 369 22 790 417 10; #N canvas 0 22 450 300 (subpatch) 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.171429 0.328572 0.400001 0.442858 0.47143 0.485715 0.485715 0.485715 0.485715 0.485715 0.442858 0.357144 0.242858 0.185715 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 534 10 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array dst 100 float 0; #X coords 0 1 99 -1 200 140 1; #X restore 534 166 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 59 211 50 20 50; #X text 44 154 list of 3 floats:; #X text 162 273 1.arg: source-name; #X text 162 286 2.arg: destination-name; #X msg 154 213 src src; #X msg 185 234 dst dst; #X obj 61 78 tab_abs src dst; #X obj 59 264 tab_abs src dst; #X text 78 365 IEM KUG; #X text 57 353 musil; #X text 92 353 @; #X text 100 353 iem.at; #X text 61 375 Graz \, Austria; #X text 12 3 tab_abs; #X text 90 29 copy absolute-value from src to dst; #X text 56 165 1.) src onset; #X text 56 175 2.) dst onset; #X text 171 261 initial arguments:; #X text 68 283 output; #X text 208 213 xxx : change source name; #X text 240 233 xxx : change destination name; #X text 175 69 (the number of samples which are copied are:; #X text 188 83 the minimum of both array lengths); #X text 56 185 3.) n samples to copy; #X text 190 185 absolute value; #X text 13 342 (c) Thomas Musil 2000 - 2009; #X connect 2 0 11 0; #X connect 5 0 12 0; #X connect 9 0 12 0; #X connect 10 0 12 0; #X connect 11 0 3 0; #X connect 12 0 4 0; iem_tab/tab_max_index-help.pd0000644000175000017500000000460311120262740016763 0ustar zmoelnigzmoelnig#N canvas 118 94 788 440 10; #N canvas 0 0 450 300 graph1 0; #X array src 100 float 1; #A 0 -0.442858 -0.414287 -0.385715 -0.342858 -0.314287 -0.257144 -0.128572 -0.0428573 0.128572 0.228572 0.285715 0.328572 0.400001 0.414287 0.457144 0.457144 0.442858 0.385715 0.314287 0.257144 0.214286 0.1 0.0428572 -0.0142858 -0.0428573 -0.114286 -0.142858 -0.200001 -0.242858 -0.285715 -0.328572 -0.342858 -0.37143 -0.385715 -0.414287 -0.414287 -0.414287 -0.414287 -0.400001 -0.357144 -0.314287 -0.257144 -0.185715 -0.0714288 0.0142857 0.0571429 0.185715 0.185715 0.200001 0.214286 0.214286 0.214286 0.228572 0.228572 0.214286 0.200001 0.185715 0.171429 0.142857 0.1 0.114286 0.0714285 -0.071429 -0.242858 -0.300001 -0.328573 -0.357144 -0.37143 -0.385715 -0.400001 -0.442858 -0.457144 -0.47143 -0.457144 -0.428573 -0.400001 -0.378573 -0.328572 -0.271429 -0.242858 -0.200001 -0.128572 -0.0428574 -0.0285717 0.0142858 0.114286 0.128572 0.185715 0.214286 0.257144 0.285715 0.314287 0.342858 0.357144 0.357144 0.357144 0.357144 0.357144 0.342858 0.328572; #X coords 0 1 99 -1 200 140 1; #X restore 529 24 graph; #X obj 61 31 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 61 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 59 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 205 270 1.arg: source-name; #X msg 101 213 src src; #X floatatom 109 103 5 0 0 0 - - -; #X floatatom 158 104 5 0 0 0 - - -; #X text 166 118 max; #X floatatom 107 320 5 0 0 0 - - -; #X floatatom 156 336 5 0 0 0 - - -; #X msg 59 193 35 50; #X obj 61 78 tab_max_index src; #X text 97 117 max_index; #X obj 59 262 tab_max_index src; #X text 75 384 IEM KUG; #X text 59 372 musil; #X text 89 372 @; #X text 95 372 iem.at; #X text 58 394 Graz \, Austria; #X text 10 361 (c) Thomas Musil 2000 - 2006; #X text 229 258 initial arguments:; #X text 65 280 output; #X text 152 213 xxx : change source name; #X text 11 6 tab_max_index; #X text 43 150 list of 2 floats:; #X text 55 160 1.) src onset; #X text 55 171 2.) n samples to calculate maximum; #X text 163 319 maximum value output; #X text 115 301 maximum index output; #X text 85 29 calculate maximum element and its index of array ; #X connect 1 0 12 0; #X connect 5 0 14 0; #X connect 11 0 14 0; #X connect 12 0 2 0; #X connect 12 1 6 0; #X connect 12 2 7 0; #X connect 14 0 3 0; #X connect 14 1 9 0; #X connect 14 2 10 0; iem_tab/src/0000755000175000017500000000000012527356720013510 5ustar zmoelnigzmoelnigiem_tab/src/tab_sqrt.c0000644000175000017500000001200612476364224015473 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_sqrt ------------------------------ */ /* x_beg_mem_dst[i] = sqrt(x_beg_mem_src1[i]) */ typedef struct _tab_sqrt { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_sqrt; static t_class *tab_sqrt_class; static void tab_sqrt_src(t_tab_sqrt *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_sqrt_dst(t_tab_sqrt *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_sqrt_bang(t_tab_sqrt *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_sqrt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_sqrt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i 0 || PD_MINOR_VERSION > 43)) t_float g = q8_rsqrt(f); iemarray_setfloat(vec_dst, i, f*g*(1.5f - 0.5f * g * g * f)); #else iemarray_setfloat(vec_dst, i, sqrt(f)); #endif } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_sqrt_list(t_tab_sqrt *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_sqrt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_sqrt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i 0 || PD_MINOR_VERSION > 43)) t_float g = q8_rsqrt(f); iemarray_setfloat(vec_dst, i, f*g*(1.5f - 0.5f * g * g * f)); #else iemarray_setfloat(vec_dst, i, sqrt(f)); #endif } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_sqrt-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_sqrt"); } } static void tab_sqrt_free(t_tab_sqrt *x) { } static void *tab_sqrt_new(t_symbol *s, int argc, t_atom *argv) { t_tab_sqrt *x = (t_tab_sqrt *)pd_new(tab_sqrt_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_sqrt-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_sqrt_setup(void) { tab_sqrt_class = class_new(gensym("tab_sqrt"), (t_newmethod)tab_sqrt_new, (t_method)tab_sqrt_free, sizeof(t_tab_sqrt), 0, A_GIMME, 0); class_addbang(tab_sqrt_class, (t_method)tab_sqrt_bang); class_addlist(tab_sqrt_class, (t_method)tab_sqrt_list); class_addmethod(tab_sqrt_class, (t_method)tab_sqrt_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_sqrt_class, (t_method)tab_sqrt_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_sqrt_class, (t_method)tab_sqrt_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/tab_reverse.c0000644000175000017500000001126511141231101016132 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_reverse ------------------------------ */ typedef struct _tab_reverse { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_reverse; static t_class *tab_reverse_class; static void tab_reverse_src(t_tab_reverse *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_reverse_dst(t_tab_reverse *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_reverse_bang(t_tab_reverse *x) { int i, j, n, n2; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; t_float f; ok_src = iem_tab_check_arrays(gensym("tab_reverse"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_reverse"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; n2 = n/2; if(n) { t_garray *a; for(i=0, j=n-1; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_reverse_list(t_tab_reverse *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, j, n, n2; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; t_float f; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_reverse"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_reverse"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; n2 = n/2; if(n) { t_garray *a; for(i=0, j=n-1; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_reverse-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_copy"); } } static void tab_reverse_free(t_tab_reverse *x) { } static void *tab_reverse_new(t_symbol *s, int argc, t_atom *argv) { t_tab_reverse *x = (t_tab_reverse *)pd_new(tab_reverse_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_reverse-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_reverse_setup(void) { tab_reverse_class = class_new(gensym("tab_reverse"), (t_newmethod)tab_reverse_new, (t_method)tab_reverse_free, sizeof(t_tab_reverse), 0, A_GIMME, 0); class_addbang(tab_reverse_class, (t_method)tab_reverse_bang); class_addlist(tab_reverse_class, (t_method)tab_reverse_list); class_addmethod(tab_reverse_class, (t_method)tab_reverse_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_reverse_class, (t_method)tab_reverse_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_reverse_class, (t_method)tab_reverse_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_reverse_class, gensym("iemhelp2/tab_reverse-help")); } iem_tab/src/tab_gt_scalar.c0000644000175000017500000001177311141231101016422 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_gt_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] > compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_gt_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_gt_scalar; static t_class *tab_gt_scalar_class; static void tab_gt_scalar_src(t_tab_gt_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_gt_scalar_float(t_tab_gt_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i compare) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_gt_scalar_dst(t_tab_gt_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_gt_scalar_list(t_tab_gt_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float compare; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i compare) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_gt_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_gt_scalar_free(t_tab_gt_scalar *x) { } static void *tab_gt_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_gt_scalar *x = (t_tab_gt_scalar *)pd_new(tab_gt_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_gt_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_gt_scalar_setup(void) { tab_gt_scalar_class = class_new(gensym("tab_gt_scalar"), (t_newmethod)tab_gt_scalar_new, (t_method)tab_gt_scalar_free, sizeof(t_tab_gt_scalar), 0, A_GIMME, 0); class_addfloat(tab_gt_scalar_class, (t_method)tab_gt_scalar_float); class_addlist(tab_gt_scalar_class, (t_method)tab_gt_scalar_list); class_addmethod(tab_gt_scalar_class, (t_method)tab_gt_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_gt_scalar_class, (t_method)tab_gt_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_gt_scalar_class, (t_method)tab_gt_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_gt_scalar_class, gensym("iemhelp2/tab_gt_scalar-help")); } iem_tab/src/tab_carth2polar.c0000644000175000017500000002003112022354154016704 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_carth2polar ------------------------------ */ /* x_beg_mem_dst_mag[i] = sqrt(x_beg_mem_src_re[i]*x_beg_mem_src_re[i] + x_beg_mem_src_im[i]*x_beg_mem_src_im[i]) */ /* x_beg_mem_dst_arg[i] = atan2(x_beg_mem_src_im[i], x_beg_mem_src_re[i]) */ typedef struct _tab_carth2polar { t_object x_obj; int x_size_src_re; int x_size_dst_mag; int x_size_src_im; int x_size_dst_arg; int x_offset_src_re; int x_offset_dst_mag; int x_offset_src_im; int x_offset_dst_arg; iemarray_t *x_beg_mem_src_re; iemarray_t *x_beg_mem_dst_mag; iemarray_t *x_beg_mem_src_im; iemarray_t *x_beg_mem_dst_arg; t_symbol *x_sym_src_re; t_symbol *x_sym_dst_mag; t_symbol *x_sym_src_im; t_symbol *x_sym_dst_arg; } t_tab_carth2polar; static t_class *tab_carth2polar_class; static void tab_carth2polar_src_re(t_tab_carth2polar *x, t_symbol *s) { x->x_sym_src_re = s; } static void tab_carth2polar_src_im(t_tab_carth2polar *x, t_symbol *s) { x->x_sym_src_im = s; } static void tab_carth2polar_dst_mag(t_tab_carth2polar *x, t_symbol *s) { x->x_sym_dst_mag = s; } static void tab_carth2polar_dst_arg(t_tab_carth2polar *x, t_symbol *s) { x->x_sym_dst_arg = s; } static void tab_carth2polar_bang(t_tab_carth2polar *x) { int i, n; int ok_src_re, ok_dst_mag; int ok_src_im, ok_dst_arg; iemarray_t *vec_src_re, *vec_dst_mag; iemarray_t *vec_src_im, *vec_dst_arg; ok_src_re = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, 0); ok_dst_mag = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_dst_mag, &x->x_beg_mem_dst_mag, &x->x_size_dst_mag, 0); ok_src_im = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, 0); ok_dst_arg = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_dst_arg, &x->x_beg_mem_dst_arg, &x->x_size_dst_arg, 0); if(ok_src_re && ok_dst_mag && ok_src_im && ok_dst_arg) { if(x->x_size_src_re < x->x_size_dst_mag) n = x->x_size_src_re; else n = x->x_size_dst_mag; if(x->x_size_src_im < n) n = x->x_size_src_im; if(x->x_size_dst_arg < n) n = x->x_size_dst_arg; vec_src_re = x->x_beg_mem_src_re; vec_dst_mag = x->x_beg_mem_dst_mag; vec_src_im = x->x_beg_mem_src_im; vec_dst_arg = x->x_beg_mem_dst_arg; if(n) { t_garray *a; t_float rcp_two_pi=0.125/atan(1.0); for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_mag, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_arg, garray_class); garray_redraw(a); } } } static void tab_carth2polar_list(t_tab_carth2polar *x, t_symbol *s, int argc, t_atom *argv) { int i, n; int beg_src_re, beg_dst_mag; int beg_src_im, beg_dst_arg; int ok_src_re, ok_dst_mag; int ok_src_im, ok_dst_arg; iemarray_t *vec_src_re, *vec_dst_mag; iemarray_t *vec_src_im, *vec_dst_arg; if((argc >= 5) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3) && IS_A_FLOAT(argv,4)) { beg_src_re = (int)atom_getintarg(0, argc, argv); beg_src_im = (int)atom_getintarg(1, argc, argv); beg_dst_mag = (int)atom_getintarg(2, argc, argv); beg_dst_arg = (int)atom_getintarg(3, argc, argv); n = (int)atom_getintarg(4, argc, argv); if(beg_src_re < 0) beg_src_re = 0; if(beg_dst_mag < 0) beg_dst_mag = 0; if(beg_src_im < 0) beg_src_im = 0; if(beg_dst_arg < 0) beg_dst_arg = 0; if(n < 0) n = 0; ok_src_re = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, beg_src_re+n); ok_dst_mag = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_dst_mag, &x->x_beg_mem_dst_mag, &x->x_size_dst_mag, beg_dst_mag+n); ok_src_im = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, beg_src_im+n); ok_dst_arg = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_dst_arg, &x->x_beg_mem_dst_arg, &x->x_size_dst_arg, beg_dst_arg+n); if(ok_src_re && ok_dst_mag && ok_src_im && ok_dst_arg) { vec_src_re = x->x_beg_mem_src_re + beg_src_re; vec_dst_mag = x->x_beg_mem_dst_mag + beg_dst_mag; vec_src_im = x->x_beg_mem_src_im + beg_src_im; vec_dst_arg = x->x_beg_mem_dst_arg + beg_dst_arg; if(n) { t_garray *a; t_float rcp_two_pi=0.125/atan(1.0); for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_mag, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_arg, garray_class); garray_redraw(a); } } } else { post("tab_carth2polar-ERROR: list need 5 float arguments:"); post(" source_real_offset + source_imag_offset + destination_magnitude_offset + destination_phase_argument_offset + number_of_samples_to_convert"); } } static void tab_carth2polar_free(t_tab_carth2polar *x) { } static void *tab_carth2polar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_carth2polar *x = (t_tab_carth2polar *)pd_new(tab_carth2polar_class); t_symbol *src_re, *dst_mag, *src_im, *dst_arg; if((argc >= 4) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,3)) { src_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_mag = (t_symbol *)atom_getsymbolarg(2, argc, argv); dst_arg = (t_symbol *)atom_getsymbolarg(3, argc, argv); } else { post("tab_carth2polar-ERROR: need 4 symbols arguments:"); post(" source_real_array_name + source_imag_array_name + destination_magnitude_array_name + destination_phase_argument_array_name"); return(0); } x->x_sym_src_re = src_re; x->x_sym_src_im = src_im; x->x_sym_dst_mag = dst_mag; x->x_sym_dst_arg = dst_arg; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_carth2polar_setup(void) { tab_carth2polar_class = class_new(gensym("tab_carth2polar"), (t_newmethod)tab_carth2polar_new, (t_method)tab_carth2polar_free, sizeof(t_tab_carth2polar), 0, A_GIMME, 0); class_addbang(tab_carth2polar_class, (t_method)tab_carth2polar_bang); class_addlist(tab_carth2polar_class, (t_method)tab_carth2polar_list); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_src_re, gensym("src_re"), A_DEFSYMBOL, 0); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_src_im, gensym("src_im"), A_DEFSYMBOL, 0); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_src_re, gensym("src1_re"), A_DEFSYMBOL, 0); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_src_im, gensym("src1_im"), A_DEFSYMBOL, 0); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_dst_mag, gensym("dst_mag"), A_DEFSYMBOL, 0); class_addmethod(tab_carth2polar_class, (t_method)tab_carth2polar_dst_arg, gensym("dst_arg"), A_DEFSYMBOL, 0); } iem_tab/src/tab_find_exact_peaks.c0000644000175000017500000002760211141231101017750 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_find_exact_peaks ------------------------------ */ #define IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_AMP 0 #define IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_FREQ 1 typedef struct _tab_find_exact_peaks { t_object x_obj; int x_size_src1; int x_offset_src1; iemarray_t *x_beg_mem_src1; int x_work_alloc; int *x_beg_mem_work1; t_float *x_beg_mem_work2; int x_sort_mode; t_float x_hdiff; int x_min_width; int x_max_width; int x_n_peaks; t_symbol *x_sym_scr1; t_outlet *x_bang_out; t_outlet *x_sort_index_out; t_outlet *x_peak_value_out; t_outlet *x_peak_index_out; } t_tab_find_exact_peaks; static t_class *tab_find_exact_peaks_class; static void tab_find_exact_peaks_max_peaks(t_tab_find_exact_peaks *x, t_floatarg fmax_peaks) { int max_peaks = (int)fmax_peaks; if(max_peaks <= 0) max_peaks = 1; x->x_n_peaks = max_peaks; } static void tab_find_exact_peaks_width_range(t_tab_find_exact_peaks *x, t_symbol *s, int argc, t_atom *argv) { int minw, maxw, h; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { minw = (int)atom_getintarg(0, argc, argv); maxw = (int)atom_getintarg(1, argc, argv); if(minw <= 0) minw = 1; if(maxw <= 0) maxw = 1; if(minw > maxw) { h = minw; minw = maxw; maxw = h; } x->x_min_width = minw; x->x_max_width = maxw; } } static void tab_find_exact_peaks_abs_min_height_diff(t_tab_find_exact_peaks *x, t_floatarg height_diff) { if(height_diff < 0.0f) height_diff *= -1.0f; x->x_hdiff = height_diff; } static void tab_find_exact_peaks_amp_sort(t_tab_find_exact_peaks *x) { x->x_sort_mode = IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_AMP; } static void tab_find_exact_peaks_freq_sort(t_tab_find_exact_peaks *x) { x->x_sort_mode = IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_FREQ; } static void tab_find_exact_peaks_src(t_tab_find_exact_peaks *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_find_exact_peaks_bang(t_tab_find_exact_peaks *x) { int i, n, w, ww; int ok_src, peak_index=0; t_float *vec_work2; iemarray_t *vec_src; int *vec_work1; t_float max=-1.0e37; int max_peaks=x->x_n_peaks; int min_width=x->x_min_width; int max_width=x->x_max_width; t_float abs_min_height_diff=x->x_hdiff; ok_src = iem_tab_check_arrays(gensym("tab_find_exact_peaks"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; if(n) { if(!x->x_work_alloc) { x->x_beg_mem_work1 = (int *)getbytes(n * sizeof(int)); x->x_beg_mem_work2 = (t_float *)getbytes(n * sizeof(t_float)); x->x_work_alloc = n; } else if(n != x->x_work_alloc) { x->x_beg_mem_work1 = (int *)resizebytes(x->x_beg_mem_work1, x->x_work_alloc*sizeof(int), n*sizeof(int)); x->x_beg_mem_work2 = (t_float *)resizebytes(x->x_beg_mem_work2, x->x_work_alloc*sizeof(t_float), n*sizeof(t_float)); x->x_work_alloc = n; } vec_src = x->x_beg_mem_src1; vec_work1 = x->x_beg_mem_work1; vec_work2 = x->x_beg_mem_work2; if(x->x_sort_mode == IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_FREQ) // FREQ_SORT BEGIN { int sort_index=1,old=0,j; for(i=0; ix_peak_value_out, iemarray_getfloat(vec_src, i)); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); sort_index++; } else i = n+1; } old = vec_work1[i]; } outlet_bang(x->x_bang_out); } // FREQ_SORT END else if(x->x_sort_mode == IEMLIB_TAB_FIND_EXACT_PEAKS_SORT_MODE_AMP) // AMP_SORT BEGIN { int sort_index=1,old=0,j; for(i=0; i max) { max = vec_work2[i]; peak_index = i; } } } if(peak_index >= 0) { outlet_float(x->x_peak_value_out, max); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); vec_work1[peak_index] = 0; vec_work2[peak_index] = 0.0f; j=peak_index+1; while(vec_work1[j]) { vec_work1[j] = 0; j++; } j=peak_index-1; while(vec_work1[j]) { vec_work1[j] = 0; j--; } } else sort_index = max_peaks+1; } outlet_bang(x->x_bang_out); } } // AMP_SORT END } /* [n] zu [n-1] u. [n+1] (ww=0)(w=1)(beg=1)(end=n-1) [n-1] u. [n] zu [n-2] u. [n+1] (ww=0)(w=2)(beg=2)(end=n-1) [n] u. [n+1] zu [n-1] u. [n+2] (ww=1)(w=2)(beg=1)(end=n-2) [n-2] u. [n-1] u. [n] zu [n-3] u. [n+1] (ww=0)(w=3)(beg=3)(end=n-1) [n-1] u. [n] u. [n+1] zu [n-2] u. [n+2] (ww=1)(w=3)(beg=2)(end=n-2) [n] u. [n+1] u. [n+2] zu [n-1] u. [n+3] (ww=2)(w=3)(beg=1)(end=n-3) */ } /*static void tab_find_exact_peaks_list(t_tab_find_exact_peaks *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src, max_index=0; t_float *vec_src; t_float max=-1.0e37; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_find_exact_peaks"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; i max) { max = vec_src[i]; max_index = i + beg_src; } } outlet_float(x->x_peak_value_out, max); outlet_float(x->x_peak_index_out, (t_float)max_index); outlet_bang(x->x_bang_out); } } } else { post("tab_find_exact_peaks-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_max_index"); } }*/ static void tab_find_exact_peaks_free(t_tab_find_exact_peaks *x) { if(x->x_work_alloc) { freebytes(x->x_beg_mem_work1, x->x_work_alloc * sizeof(int)); freebytes(x->x_beg_mem_work2, x->x_work_alloc * sizeof(t_float)); } } static void *tab_find_exact_peaks_new(t_symbol *s, int argc, t_atom *argv) { t_tab_find_exact_peaks *x = (t_tab_find_exact_peaks *)pd_new(tab_find_exact_peaks_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_find_exact_peaks-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_work_alloc = 0; x->x_beg_mem_work1 = (int *)0; x->x_beg_mem_work2 = (t_float *)0; x->x_sym_scr1 = src; x->x_bang_out = (t_outlet *)outlet_new(&x->x_obj, &s_bang); // ready x->x_sort_index_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // sort index x->x_peak_index_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // freq x->x_peak_value_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // value return(x); } void tab_find_exact_peaks_setup(void) { tab_find_exact_peaks_class = class_new(gensym("tab_find_exact_peaks"), (t_newmethod)tab_find_exact_peaks_new, (t_method)tab_find_exact_peaks_free, sizeof(t_tab_find_exact_peaks), 0, A_GIMME, 0); class_addbang(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_bang); /*class_addlist(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_list);*/ class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_max_peaks, gensym("max_peaks"), A_DEFFLOAT, 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_width_range, gensym("width_range"), A_GIMME, 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_abs_min_height_diff, gensym("abs_min_height_diff"), A_DEFFLOAT, 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_amp_sort, gensym("amp_sort"), 0); class_addmethod(tab_find_exact_peaks_class, (t_method)tab_find_exact_peaks_freq_sort, gensym("freq_sort"), 0); // class_sethelpsymbol(tab_find_exact_peaks_class, gensym("iemhelp2/help-tab_find_exact_peaks")); } iem_tab/src/tab_ge.c0000644000175000017500000001314011141231101015044 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_ge ------------------------------ */ /* if(x_beg_mem_src1[i] >= x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_ge { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_ge; static t_class *tab_ge_class; static void tab_ge_src1(t_tab_ge *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_ge_src2(t_tab_ge *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_ge_dst(t_tab_ge *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_ge_bang(t_tab_ge *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i= iemarray_getfloat(vec_src2, i)) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_ge_list(t_tab_ge *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i= iemarray_getfloat(vec_src2, i)) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_ge-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_ge_free(t_tab_ge *x) { } static void *tab_ge_new(t_symbol *s, int argc, t_atom *argv) { t_tab_ge *x = (t_tab_ge *)pd_new(tab_ge_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_ge-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_ge_setup(void) { tab_ge_class = class_new(gensym("tab_ge"), (t_newmethod)tab_ge_new, (t_method)tab_ge_free, sizeof(t_tab_ge), 0, A_GIMME, 0); class_addbang(tab_ge_class, (t_method)tab_ge_bang); class_addlist(tab_ge_class, (t_method)tab_ge_list); class_addmethod(tab_ge_class, (t_method)tab_ge_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_ge_class, (t_method)tab_ge_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_ge_class, (t_method)tab_ge_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_ge_class, gensym("iemhelp2/tab_ge-help")); } iem_tab/src/tab_cross_corr.c0000644000175000017500000001374611141231101016643 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_cross_corr ------------------------------ */ typedef struct _tab_cross_corr { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_n; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_float x_factor; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; t_float x_delay; int x_counter; void *x_clock; } t_tab_cross_corr; static t_class *tab_cross_corr_class; static void tab_cross_corr_tick(t_tab_cross_corr *x) { x->x_counter++; if(x->x_counter < x->x_n) { iemarray_t *vec_src1, *vec_src2, *vec_dst; t_float sum; int j, m; vec_src1 = x->x_beg_mem_src1 + x->x_counter; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst + x->x_counter; m = x->x_size_src2; sum = 0.0f; for(j=0; jx_factor); clock_delay(x->x_clock, x->x_delay); } else { t_garray *a; clock_unset(x->x_clock); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } static void tab_cross_corr_time(t_tab_cross_corr *x, t_floatarg dtime) { if(dtime < 0.0f) dtime = 0.0f; x->x_delay = dtime; } static void tab_cross_corr_factor(t_tab_cross_corr *x, t_floatarg factor) { x->x_factor = factor; } static void tab_cross_corr_src1(t_tab_cross_corr *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_cross_corr_src2(t_tab_cross_corr *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_cross_corr_dst(t_tab_cross_corr *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_cross_corr_bang(t_tab_cross_corr *x) { int i, j, m, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; t_float sum, f; ok_src1 = iem_tab_check_arrays(gensym("tab_cross_corr"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_cross_corr"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_cross_corr"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 > x->x_size_src2) n = x->x_size_src1 - x->x_size_src2; else n = 0; if(n > x->x_size_dst) x->x_n = x->x_size_dst; else x->x_n = n; f = x->x_factor; if(n) { if(x->x_delay == 0.0f) { t_garray *a; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; m = x->x_size_src2; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } else { x->x_counter = 0; vec_src1 = x->x_beg_mem_src1 + x->x_counter; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst + x->x_counter; m = x->x_size_src2; sum = 0.0f; for(j=0; jx_clock, x->x_delay); } } } } static void tab_cross_corr_free(t_tab_cross_corr *x) { clock_free(x->x_clock); } static void *tab_cross_corr_new(t_symbol *s, int argc, t_atom *argv) { t_tab_cross_corr *x = (t_tab_cross_corr *)pd_new(tab_cross_corr_class); t_symbol *src1, *src2, *dst; t_float dtime=0.0f, factor=1.0f; if((argc >= 5) && IS_A_FLOAT(argv,4)) dtime = (t_float)atom_getfloatarg(4, argc, argv); if((argc >= 4) && IS_A_FLOAT(argv,3)) factor = (t_float)atom_getfloatarg(3, argc, argv); if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else { post("tab_cross_corr-ERROR: need 3 symbol + 2 float arguments:"); post(" source_reference_array_name + source_measure_array_name + destination_array_name + norm_factor + calculation-time-per-sample_ms"); return(0); } if(dtime < 0.0f) dtime = 0.0f; x->x_delay = dtime; x->x_factor = factor; x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); x->x_clock = clock_new(x, (t_method)tab_cross_corr_tick); return(x); } void tab_cross_corr_setup(void) { tab_cross_corr_class = class_new(gensym("tab_cross_corr"), (t_newmethod)tab_cross_corr_new, (t_method)tab_cross_corr_free, sizeof(t_tab_cross_corr), 0, A_GIMME, 0); class_addbang(tab_cross_corr_class, (t_method)tab_cross_corr_bang); class_addmethod(tab_cross_corr_class, (t_method)tab_cross_corr_time, gensym("time"), A_DEFFLOAT, 0); class_addmethod(tab_cross_corr_class, (t_method)tab_cross_corr_factor, gensym("factor"), A_DEFFLOAT, 0); class_addmethod(tab_cross_corr_class, (t_method)tab_cross_corr_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_cross_corr_class, (t_method)tab_cross_corr_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_cross_corr_class, (t_method)tab_cross_corr_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_cross_corr_class, gensym("iemhelp2/tab_cross_corr-help")); } iem_tab/src/tab_min_index.c0000644000175000017500000000741311141231101016431 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_min_index ------------------------------ */ typedef struct _tab_min_index { t_object x_obj; int x_size_src1; int x_offset_src1; iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_min_out; void *x_min_index_out; } t_tab_min_index; static t_class *tab_min_index_class; static void tab_min_index_src(t_tab_min_index *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_min_index_bang(t_tab_min_index *x) { int i, n; int ok_src, min_index=0; iemarray_t *vec_src; t_float min=1.0e37; ok_src = iem_tab_check_arrays(gensym("tab_min_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; vec_src = x->x_beg_mem_src1; if(n) { for(i=0; ix_min_out, min); outlet_float(x->x_min_index_out, (t_float)min_index); outlet_bang(x->x_bang_out); } } } static void tab_min_index_list(t_tab_min_index *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src, min_index=0; iemarray_t *vec_src; t_float min=1.0e37; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_min_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; ix_min_out, min); outlet_float(x->x_min_index_out, (t_float)min_index); outlet_bang(x->x_bang_out); } } } else { post("tab_min_index-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_min_index"); } } static void tab_min_index_free(t_tab_min_index *x) { } static void *tab_min_index_new(t_symbol *s, int argc, t_atom *argv) { t_tab_min_index *x = (t_tab_min_index *)pd_new(tab_min_index_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_min_index-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_sym_scr1 = src; x->x_bang_out = outlet_new(&x->x_obj, &s_bang); x->x_min_index_out = outlet_new(&x->x_obj, &s_float); x->x_min_out = outlet_new(&x->x_obj, &s_float); return(x); } void tab_min_index_setup(void) { tab_min_index_class = class_new(gensym("tab_min_index"), (t_newmethod)tab_min_index_new, (t_method)tab_min_index_free, sizeof(t_tab_min_index), 0, A_GIMME, 0); class_addbang(tab_min_index_class, (t_method)tab_min_index_bang); class_addlist(tab_min_index_class, (t_method)tab_min_index_list); class_addmethod(tab_min_index_class, (t_method)tab_min_index_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_min_index_class, (t_method)tab_min_index_src, gensym("src1"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_min_index_class, gensym("iemhelp2/tab_min_index-help")); } iem_tab/src/tab_powtodb.c0000644000175000017500000001161211660755610016157 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2010 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include #define IEMTABLOGTEN 2.302585092994046 /* -------------------------- tab_powtodb ------------------------------ */ /* x_beg_mem_dst[i] = sqrt(x_beg_mem_src1[i]) */ typedef struct _tab_powtodb { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_powtodb; static t_class *tab_powtodb_class; static void tab_powtodb_src(t_tab_powtodb *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_powtodb_dst(t_tab_powtodb *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_powtodb_bang(t_tab_powtodb *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_powtodb"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_powtodb"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_powtodb_list(t_tab_powtodb *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_powtodb"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_powtodb"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_powtodb-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_sqrt"); } } static void tab_powtodb_free(t_tab_powtodb *x) { } static void *tab_powtodb_new(t_symbol *s, int argc, t_atom *argv) { t_tab_powtodb *x = (t_tab_powtodb *)pd_new(tab_powtodb_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_powtodb-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_powtodb_setup(void) { tab_powtodb_class = class_new(gensym("tab_powtodb"), (t_newmethod)tab_powtodb_new, (t_method)tab_powtodb_free, sizeof(t_tab_powtodb), 0, A_GIMME, 0); class_addbang(tab_powtodb_class, (t_method)tab_powtodb_bang); class_addlist(tab_powtodb_class, (t_method)tab_powtodb_list); class_addmethod(tab_powtodb_class, (t_method)tab_powtodb_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_powtodb_class, (t_method)tab_powtodb_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_powtodb_class, (t_method)tab_powtodb_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/iem_tab.dsp0000644000175000017500000000474511203415342015614 0ustar zmoelnigzmoelnig# Microsoft Developer Studio Project File - Name="iem_tab" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) External Target" 0x0106 CFG=iem_tab - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "iem_tab.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "iem_tab.mak" CFG="iem_tab - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "iem_tab - Win32 Release" (basierend auf "Win32 (x86) External Target") !MESSAGE "iem_tab - Win32 Debug" (basierend auf "Win32 (x86) External Target") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "iem_tab - Win32 Release" # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_tab.exe" # PROP Bsc_Name "iem_tab.bsc" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "iem_tab - Win32 Debug" # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_tab.exe" # PROP Bsc_Name "iem_tab.bsc" # PROP Target_Dir "" !ENDIF # Begin Target # Name "iem_tab - Win32 Release" # Name "iem_tab - Win32 Debug" !IF "$(CFG)" == "iem_tab - Win32 Release" !ELSEIF "$(CFG)" == "iem_tab - Win32 Debug" !ENDIF # Begin Source File SOURCE=.\makefile_win # End Source File # End Target # End Project iem_tab/src/tab_ge_scalar.c0000644000175000017500000001177611141231101016406 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_ge_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] >= compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_ge_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_ge_scalar; static t_class *tab_ge_scalar_class; static void tab_ge_scalar_src(t_tab_ge_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_ge_scalar_float(t_tab_ge_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i= compare) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_ge_scalar_dst(t_tab_ge_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_ge_scalar_list(t_tab_ge_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float compare; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i= compare) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_ge_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_ge_scalar_free(t_tab_ge_scalar *x) { } static void *tab_ge_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_ge_scalar *x = (t_tab_ge_scalar *)pd_new(tab_ge_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_ge_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_ge_scalar_setup(void) { tab_ge_scalar_class = class_new(gensym("tab_ge_scalar"), (t_newmethod)tab_ge_scalar_new, (t_method)tab_ge_scalar_free, sizeof(t_tab_ge_scalar), 0, A_GIMME, 0); class_addfloat(tab_ge_scalar_class, (t_method)tab_ge_scalar_float); class_addlist(tab_ge_scalar_class, (t_method)tab_ge_scalar_list); class_addmethod(tab_ge_scalar_class, (t_method)tab_ge_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_ge_scalar_class, (t_method)tab_ge_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_ge_scalar_class, (t_method)tab_ge_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_ge_scalar_class, gensym("iemhelp2/tab_ge_scalar-help")); } iem_tab/src/makefile_linux0000644000175000017500000000275211660761146016434 0ustar zmoelnigzmoelnigcurrent: all .SUFFIXES: .pd_linux #edit or define outside PD_INCLUDE=/usr/local/src/pd/src INCLUDE = -I. -I$(PD_INCLUDE) LDFLAGS = -export-dynamic -shared LIB = -ldl -lm #select either the DBG and OPT compiler flags below: CFLAGS = -DPD -DUNIX -W -Wno-unused \ -Wno-parentheses -Wno-switch -O2 -funroll-loops -fomit-frame-pointer \ -fno-strict-aliasing -DDL_OPEN -fPIC SYSTEM = $(shell uname -m) # the sources SRC = \ tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtopow.c \ tab_dbtorms.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_rmstodb.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c TARGET = iem_tab.pd_linux OBJ = $(SRC:.c=.o) # # ------------------ targets ------------------------------------ # clean: rm ../$(TARGET) rm *.o all: $(OBJ) @echo :: $(OBJ) $(LD) $(LDFLAGS) -o $(TARGET) *.o $(LIB) strip --strip-unneeded $(TARGET) mv $(TARGET) .. $(OBJ) : %.o : %.c $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c iem_tab/src/iem_tab.sln0000644000175000017500000000155711603066337015632 0ustar zmoelnigzmoelnig Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iem_tab", "iem_tab.vcproj", "{6A44952F-0D55-44EE-9032-928368583BEC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6A44952F-0D55-44EE-9032-928368583BEC}.Debug|Win32.ActiveCfg = Debug|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Debug|Win32.Build.0 = Debug|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Release|Win32.ActiveCfg = Release|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal iem_tab/src/tab_dbtopow.c0000644000175000017500000001152611660755610016163 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2010 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include #define IEMTABLOGTEN 2.302585092994046 /* -------------------------- tab_dbtopow ------------------------------ */ typedef struct _tab_dbtopow { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_dbtopow; static t_class *tab_dbtopow_class; static void tab_dbtopow_src(t_tab_dbtopow *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_dbtopow_dst(t_tab_dbtopow *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_dbtopow_bang(t_tab_dbtopow *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_dbtopow"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_dbtopow"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i 870.0) f = 870.0; iemarray_setfloat(vec_dst, i, exp((IEMTABLOGTEN * 0.1) * (f-100.0))); } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_dbtopow_list(t_tab_dbtopow *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_dbtopow"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_dbtopow"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i 870.0) f = 870.0; iemarray_setfloat(vec_dst, i, exp((IEMTABLOGTEN * 0.1) * (f-100.0))); } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_dbtopow-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_dbtopow"); } } static void tab_dbtopow_free(t_tab_dbtopow *x) { } static void *tab_dbtopow_new(t_symbol *s, int argc, t_atom *argv) { t_tab_dbtopow *x = (t_tab_dbtopow *)pd_new(tab_dbtopow_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_dbtopow-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_dbtopow_setup(void) { tab_dbtopow_class = class_new(gensym("tab_dbtopow"), (t_newmethod)tab_dbtopow_new, (t_method)tab_dbtopow_free, sizeof(t_tab_dbtopow), 0, A_GIMME, 0); class_addbang(tab_dbtopow_class, (t_method)tab_dbtopow_bang); class_addlist(tab_dbtopow_class, (t_method)tab_dbtopow_list); class_addmethod(tab_dbtopow_class, (t_method)tab_dbtopow_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_dbtopow_class, (t_method)tab_dbtopow_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_dbtopow_class, (t_method)tab_dbtopow_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/tab_fft.c0000644000175000017500000003013711660756044015265 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_fft ------------------------------ */ /* complex FFT */ typedef struct _tab_fft { t_object x_obj; int x_size_src_re; int x_size_src_im; int x_size_dst_re; int x_size_dst_im; int x_offset_src_re; int x_offset_src_im; int x_offset_dst_re; int x_offset_dst_im; int x_fftsize; iemarray_t *x_beg_mem_src_re; iemarray_t *x_beg_mem_src_im; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src_re; t_symbol *x_sym_src_im; t_symbol *x_sym_dst_re; t_symbol *x_sym_dst_im; } t_tab_fft; static t_class *tab_fft_class; static void tab_fft_init(t_tab_fft *x) { int i, fftsize = x->x_fftsize; t_float f, g; TAB_COMPLEX *sincos = x->x_sin_cos; g = 2.0 * 3.141592653589793 / (t_float)fftsize; for(i=0; ix_fftsize) { x->x_sin_cos = (TAB_COMPLEX *)resizebytes(x->x_sin_cos, x->x_fftsize*sizeof(TAB_COMPLEX), i*sizeof(TAB_COMPLEX)); x->x_fftsize = i; } tab_fft_init(x); } static void tab_fft_src_re(t_tab_fft *x, t_symbol *s) { x->x_sym_src_re = s; } static void tab_fft_src_im(t_tab_fft *x, t_symbol *s) { x->x_sym_src_im = s; } static void tab_fft_dst_re(t_tab_fft *x, t_symbol *s) { x->x_sym_dst_re = s; } static void tab_fft_dst_im(t_tab_fft *x, t_symbol *s) { x->x_sym_dst_im = s; } static void tab_fft_bang(t_tab_fft *x) { int i, j, k; int ok_src_re, ok_src_im, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im; ok_src_re = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, fftsize); if(ok_src_re && ok_src_im && ok_dst_re && ok_dst_im) { t_garray *a; vec_src_re=x->x_beg_mem_src_re; vec_src_im=x->x_beg_mem_src_im; vec_dst_re=x->x_beg_mem_dst_re; vec_dst_im=x->x_beg_mem_dst_im; for(k=0; k>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } static void tab_fft_list(t_tab_fft *x, t_symbol *s, int argc, t_atom *argv) { int beg_src_re, beg_src_im, beg_dst_re, beg_dst_im; int i, j, k; int ok_src_re, ok_src_im, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src_re = (int)atom_getintarg(0, argc, argv); beg_src_im = (int)atom_getintarg(1, argc, argv); beg_dst_re = (int)atom_getintarg(2, argc, argv); beg_dst_im = (int)atom_getintarg(3, argc, argv); if(beg_src_re < 0) beg_src_re = 0; if(beg_src_im < 0) beg_src_im = 0; if(beg_dst_re < 0) beg_dst_re = 0; if(beg_dst_im < 0) beg_dst_im = 0; ok_src_re = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, beg_src_re+fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, beg_src_im+fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, beg_dst_re+fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, beg_dst_im+fftsize); if(ok_src_re && ok_src_im && ok_dst_re && ok_dst_im) { t_garray *a; vec_src_re=x->x_beg_mem_src_re + beg_src_re; vec_src_im=x->x_beg_mem_src_im + beg_src_im; vec_dst_re=x->x_beg_mem_dst_re + beg_dst_re; vec_dst_im=x->x_beg_mem_dst_im + beg_dst_im; for(k=0; k>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } else { post("tab_fft-ERROR: list need 4 float arguments:"); post(" source_real_offset + source_imag_offset + destination_real_offset + destination_imag_offset"); } } static void tab_fft_free(t_tab_fft *x) { freebytes(x->x_sin_cos, x->x_fftsize * sizeof(TAB_COMPLEX)); } static void *tab_fft_new(t_symbol *s, int argc, t_atom *argv) { t_tab_fft *x = (t_tab_fft *)pd_new(tab_fft_class); t_symbol *src_re, *src_im, *dst_re, *dst_im; int fftsize, i=1; if((argc >= 5) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,3) && IS_A_FLOAT(argv,4)) { src_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_re = (t_symbol *)atom_getsymbolarg(2, argc, argv); dst_im = (t_symbol *)atom_getsymbolarg(3, argc, argv); fftsize = (int)atom_getintarg(4, argc, argv); } else { post("tab_fft-ERROR: need 4 symbols + 1 float arguments:"); post(" source_real_array_name + source_imag_array_name + destination_real_array_name + destination_imag_array_name + FFT-size"); return(0); } if(fftsize < 8) fftsize = 8; while(i <= fftsize) i *= 2; i /= 2; fftsize = i; x->x_fftsize = fftsize; x->x_sym_src_re = src_re; x->x_sym_src_im = src_im; x->x_sym_dst_re = dst_re; x->x_sym_dst_im = dst_im; x->x_sin_cos = (TAB_COMPLEX *)getbytes(x->x_fftsize * sizeof(TAB_COMPLEX)); tab_fft_init(x); outlet_new(&x->x_obj, &s_bang); return(x); } void tab_fft_setup(void) { tab_fft_class = class_new(gensym("tab_fft"), (t_newmethod)tab_fft_new, (t_method)tab_fft_free, sizeof(t_tab_fft), 0, A_GIMME, 0); class_addbang(tab_fft_class, (t_method)tab_fft_bang); class_addlist(tab_fft_class, (t_method)tab_fft_list); class_addmethod(tab_fft_class, (t_method)tab_fft_fftsize, gensym("fftsize"), A_DEFFLOAT, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_src_re, gensym("src_re"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_src_im, gensym("src_im"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_src_re, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_src_im, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_dst_re, gensym("dst_re"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_dst_im, gensym("dst_im"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_dst_re, gensym("dst1"), A_DEFSYMBOL, 0); class_addmethod(tab_fft_class, (t_method)tab_fft_dst_im, gensym("dst2"), A_DEFSYMBOL, 0); } iem_tab/src/tab_find_peaks.c0000644000175000017500000002702011141231101016556 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_find_peaks ------------------------------ */ #define IEMLIB_TAB_FIND_PEAKS_SORT_MODE_AMP 0 #define IEMLIB_TAB_FIND_PEAKS_SORT_MODE_FREQ 1 typedef struct _tab_find_peaks { t_object x_obj; int x_size_src1; int x_offset_src1; iemarray_t *x_beg_mem_src1; int x_work_alloc; int *x_beg_mem_work1; t_float *x_beg_mem_work2; int x_sort_mode; t_float x_hdiff; int x_min_width; int x_max_width; int x_n_peaks; t_symbol *x_sym_scr1; t_outlet *x_bang_out; t_outlet *x_sort_index_out; t_outlet *x_peak_value_out; t_outlet *x_peak_index_out; } t_tab_find_peaks; static t_class *tab_find_peaks_class; static void tab_find_peaks_max_peaks(t_tab_find_peaks *x, t_floatarg fmax_peaks) { int max_peaks = (int)fmax_peaks; if(max_peaks <= 0) max_peaks = 1; x->x_n_peaks = max_peaks; } static void tab_find_peaks_width_range(t_tab_find_peaks *x, t_symbol *s, int argc, t_atom *argv) { int minw, maxw, h; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { minw = (int)atom_getintarg(0, argc, argv); maxw = (int)atom_getintarg(1, argc, argv); if(minw <= 0) minw = 1; if(maxw <= 0) maxw = 1; if(minw > maxw) { h = minw; minw = maxw; maxw = h; } x->x_min_width = minw; x->x_max_width = maxw; } } static void tab_find_peaks_abs_min_height_diff(t_tab_find_peaks *x, t_floatarg height_diff) { if(height_diff < 0.0f) height_diff *= -1.0f; x->x_hdiff = height_diff; } static void tab_find_peaks_amp_sort(t_tab_find_peaks *x) { x->x_sort_mode = IEMLIB_TAB_FIND_PEAKS_SORT_MODE_AMP; } static void tab_find_peaks_freq_sort(t_tab_find_peaks *x) { x->x_sort_mode = IEMLIB_TAB_FIND_PEAKS_SORT_MODE_FREQ; } static void tab_find_peaks_src(t_tab_find_peaks *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_find_peaks_bang(t_tab_find_peaks *x) { int i, n, w, ww; int ok_src, peak_index=0; iemarray_t *vec_src; t_float *vec_work2; int *vec_work1; t_float max=-1.0e37; int max_peaks=x->x_n_peaks; int min_width=x->x_min_width; int max_width=x->x_max_width; t_float abs_min_height_diff=x->x_hdiff; ok_src = iem_tab_check_arrays(gensym("tab_find_peaks"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; if(n) { if(!x->x_work_alloc) { x->x_beg_mem_work1 = (int *)getbytes(n * sizeof(int)); x->x_beg_mem_work2 = (t_float *)getbytes(n * sizeof(t_float)); x->x_work_alloc = n; } else if(n != x->x_work_alloc) { x->x_beg_mem_work1 = (int *)resizebytes(x->x_beg_mem_work1, x->x_work_alloc*sizeof(int), n*sizeof(int)); x->x_beg_mem_work2 = (t_float *)resizebytes(x->x_beg_mem_work2, x->x_work_alloc*sizeof(t_float), n*sizeof(t_float)); x->x_work_alloc = n; } vec_src = x->x_beg_mem_src1; vec_work1 = x->x_beg_mem_work1; vec_work2 = x->x_beg_mem_work2; if(x->x_sort_mode == IEMLIB_TAB_FIND_PEAKS_SORT_MODE_FREQ) // FREQ_SORT BEGIN { int sort_index=1,old=0,j; for(i=0; ix_peak_value_out, iemarray_getfloat(vec_src, i)); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); sort_index++; } else i = n+1; } old = vec_work1[i]; } outlet_bang(x->x_bang_out); } // FREQ_SORT END else if(x->x_sort_mode == IEMLIB_TAB_FIND_PEAKS_SORT_MODE_AMP) // AMP_SORT BEGIN { int sort_index=1,old=0,j; for(i=0; i max) { max = vec_work2[i]; peak_index = i; } } } if(peak_index >= 0) { outlet_float(x->x_peak_value_out, max); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); vec_work1[peak_index] = 0; vec_work2[peak_index] = 0.0f; j=peak_index+1; while(vec_work1[j]) { vec_work1[j] = 0; j++; } j=peak_index-1; while(vec_work1[j]) { vec_work1[j] = 0; j--; } } else sort_index = max_peaks+1; } outlet_bang(x->x_bang_out); } } // AMP_SORT END } /* [n] zu [n-1] u. [n+1] (ww=0)(w=1)(beg=1)(end=n-1) [n-1] u. [n] zu [n-2] u. [n+1] (ww=0)(w=2)(beg=2)(end=n-1) [n] u. [n+1] zu [n-1] u. [n+2] (ww=1)(w=2)(beg=1)(end=n-2) [n-2] u. [n-1] u. [n] zu [n-3] u. [n+1] (ww=0)(w=3)(beg=3)(end=n-1) [n-1] u. [n] u. [n+1] zu [n-2] u. [n+2] (ww=1)(w=3)(beg=2)(end=n-2) [n] u. [n+1] u. [n+2] zu [n-1] u. [n+3] (ww=2)(w=3)(beg=1)(end=n-3) */ } /*static void tab_find_peaks_list(t_tab_find_peaks *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src, max_index=0; t_float *vec_src; t_float max=-1.0e37; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_find_peaks"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; i max) { max = vec_src[i]; max_index = i + beg_src; } } outlet_float(x->x_peak_value_out, max); outlet_float(x->x_peak_index_out, (t_float)max_index); outlet_bang(x->x_bang_out); } } } else { post("tab_find_peaks-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_max_index"); } }*/ static void tab_find_peaks_free(t_tab_find_peaks *x) { if(x->x_work_alloc) { freebytes(x->x_beg_mem_work1, x->x_work_alloc * sizeof(int)); freebytes(x->x_beg_mem_work2, x->x_work_alloc * sizeof(t_float)); } } static void *tab_find_peaks_new(t_symbol *s, int argc, t_atom *argv) { t_tab_find_peaks *x = (t_tab_find_peaks *)pd_new(tab_find_peaks_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_find_peaks-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_work_alloc = 0; x->x_beg_mem_work1 = (int *)0; x->x_beg_mem_work2 = (t_float *)0; x->x_sym_scr1 = src; x->x_bang_out = (t_outlet *)outlet_new(&x->x_obj, &s_bang); // ready x->x_sort_index_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // sort index x->x_peak_index_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // freq x->x_peak_value_out = (t_outlet *)outlet_new(&x->x_obj, &s_float); // value return(x); } void tab_find_peaks_setup(void) { tab_find_peaks_class = class_new(gensym("tab_find_peaks"), (t_newmethod)tab_find_peaks_new, (t_method)tab_find_peaks_free, sizeof(t_tab_find_peaks), 0, A_GIMME, 0); class_addbang(tab_find_peaks_class, (t_method)tab_find_peaks_bang); /*class_addlist(tab_find_peaks_class, (t_method)tab_find_peaks_list);*/ class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_max_peaks, gensym("max_peaks"), A_DEFFLOAT, 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_width_range, gensym("width_range"), A_GIMME, 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_abs_min_height_diff, gensym("abs_min_height_diff"), A_DEFFLOAT, 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_amp_sort, gensym("amp_sort"), 0); class_addmethod(tab_find_peaks_class, (t_method)tab_find_peaks_freq_sort, gensym("freq_sort"), 0); // class_sethelpsymbol(tab_find_peaks_class, gensym("iemhelp2/tab_find_peaks-help")); } iem_tab/src/makefile0000644000175000017500000000002711660730346015204 0ustar zmoelnigzmoelniginclude makefile_linux iem_tab/src/tab_rifft.c0000644000175000017500000003057611660756044015627 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_rifft ------------------------------ */ /* complex spectral domain inverse FFT to real time domain */ typedef struct _tab_rifft { t_object x_obj; int x_size_src_re; int x_size_src_im; int x_size_dst; int x_offset_src_re; int x_offset_src_im; int x_offset_dst; int x_fftsize; iemarray_t *x_beg_mem_src_re; iemarray_t *x_beg_mem_src_im; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src_re; t_symbol *x_sym_src_im; t_symbol *x_sym_dst; } t_tab_rifft; static t_class *tab_rifft_class; static void tab_rifft_init(t_tab_rifft *x) { int i, fftsize = x->x_fftsize; t_float f, g; TAB_COMPLEX *sincos = x->x_sin_cos; g = 2.0 * 3.141592653589793 / (t_float)fftsize; for(i=0; ix_fftsize) { x->x_sin_cos = (TAB_COMPLEX *)resizebytes(x->x_sin_cos, x->x_fftsize*sizeof(TAB_COMPLEX), i*sizeof(TAB_COMPLEX)); x->x_beg_mem_dst_im = (iemarray_t *)resizebytes(x->x_beg_mem_dst_im, x->x_fftsize*sizeof(iemarray_t), i*sizeof(iemarray_t)); x->x_fftsize = i; } tab_rifft_init(x); } static void tab_rifft_dst(t_tab_rifft *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_rifft_src_re(t_tab_rifft *x, t_symbol *s) { x->x_sym_src_re = s; } static void tab_rifft_src_im(t_tab_rifft *x, t_symbol *s) { x->x_sym_src_im = s; } static void tab_rifft_bang(t_tab_rifft *x) { int i, j, k; int ok_src_re, ok_src_im, ok_dst; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g; ok_src_re = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, fftsize); ok_dst = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_dst, &x->x_beg_mem_dst_re, &x->x_size_dst, fftsize); if(ok_src_re && ok_src_im && ok_dst) { t_garray *a; vec_src_re=x->x_beg_mem_src_re; vec_src_im=x->x_beg_mem_src_im; vec_dst_re=x->x_beg_mem_dst_re; vec_dst_im=x->x_beg_mem_dst_im; iemarray_setfloat(vec_dst_re, 0, iemarray_getfloat(vec_src_re, 0)); iemarray_setfloat(vec_dst_im, 0, 0.0); for(j=1; j>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ g = 1.0 / (t_float)fftsize; for(i = 0; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } static void tab_rifft_list(t_tab_rifft *x, t_symbol *s, int argc, t_atom *argv) { int beg_src_re, beg_src_im, beg_dst; int i, j, k; int ok_src_re, ok_src_im, ok_dst; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src_re = (int)atom_getintarg(0, argc, argv); beg_src_im = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); if(beg_src_re < 0) beg_src_re = 0; if(beg_src_im < 0) beg_src_im = 0; if(beg_dst < 0) beg_dst = 0; ok_src_re = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, beg_src_re+fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, beg_src_im+fftsize); ok_dst = iem_tab_check_arrays(gensym("tab_rifft"), x->x_sym_dst, &x->x_beg_mem_dst_re, &x->x_size_dst, beg_dst+fftsize); if(ok_src_re && ok_src_im && ok_dst) { t_garray *a; vec_src_re=x->x_beg_mem_src_re + beg_src_re; vec_src_im=x->x_beg_mem_src_im + beg_src_im; vec_dst_re=x->x_beg_mem_dst_re + beg_dst; vec_dst_im=x->x_beg_mem_dst_im; for(j=0; j>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_src_re[i] *= g; vec_src_im[i] *= g; } */ g = 1.0 / (t_float)fftsize; for(i = 0; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } else { post("tab_rifft-ERROR: list need 3 float arguments:"); post(" source_real_offset + source_imag_offset + destination_offset"); } } static void tab_rifft_free(t_tab_rifft *x) { freebytes(x->x_sin_cos, x->x_fftsize * sizeof(TAB_COMPLEX)); freebytes(x->x_beg_mem_dst_im, x->x_fftsize * sizeof(t_float)); } static void *tab_rifft_new(t_symbol *s, int argc, t_atom *argv) { t_tab_rifft *x = (t_tab_rifft *)pd_new(tab_rifft_class); t_symbol *src_re, *src_im, *dst; int fftsize, i=1; if((argc >= 4) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_FLOAT(argv,3)) { src_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); fftsize = (int)atom_getintarg(3, argc, argv); } else { post("tab_rifft-ERROR: need 3 symbols + 1 float arguments:"); post(" source_real_array_name + source_imag_array_name + destination_array_name + IFFT-size"); return(0); } if(fftsize < 8) fftsize = 8; while(i <= fftsize) i *= 2; i /= 2; fftsize = i; x->x_fftsize = fftsize; x->x_sym_src_re = src_re; x->x_sym_src_im = src_im; x->x_sym_dst = dst; x->x_sin_cos = (TAB_COMPLEX *)getbytes(x->x_fftsize * sizeof(TAB_COMPLEX)); x->x_beg_mem_dst_im = (iemarray_t *)getbytes(x->x_fftsize * sizeof(iemarray_t)); tab_rifft_init(x); outlet_new(&x->x_obj, &s_bang); return(x); } void tab_rifft_setup(void) { tab_rifft_class = class_new(gensym("tab_rifft"), (t_newmethod)tab_rifft_new, (t_method)tab_rifft_free, sizeof(t_tab_rifft), 0, A_GIMME, 0); class_addbang(tab_rifft_class, (t_method)tab_rifft_bang); class_addlist(tab_rifft_class, (t_method)tab_rifft_list); class_addmethod(tab_rifft_class, (t_method)tab_rifft_ifftsize, gensym("ifftsize"), A_DEFFLOAT, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_src_re, gensym("src_re"), A_DEFSYMBOL, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_src_im, gensym("src_im"), A_DEFSYMBOL, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_src_re, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_src_im, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_dst, gensym("dst"), A_DEFSYMBOL, 0); class_addmethod(tab_rifft_class, (t_method)tab_rifft_dst, gensym("dst1"), A_DEFSYMBOL, 0); } iem_tab/src/tab_ifft.c0000644000175000017500000003114711660756044015440 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_ifft ------------------------------ */ /* complex inverse FFT */ typedef struct _tab_ifft { t_object x_obj; int x_size_src_re; int x_size_src_im; int x_size_dst_re; int x_size_dst_im; int x_offset_src_re; int x_offset_src_im; int x_offset_dst_re; int x_offset_dst_im; int x_fftsize; iemarray_t *x_beg_mem_src_re; iemarray_t *x_beg_mem_src_im; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src_re; t_symbol *x_sym_src_im; t_symbol *x_sym_dst_re; t_symbol *x_sym_dst_im; } t_tab_ifft; static t_class *tab_ifft_class; static void tab_ifft_init(t_tab_ifft *x) { int i, fftsize = x->x_fftsize; t_float f, g; TAB_COMPLEX *sincos = x->x_sin_cos; g = 2.0 * 3.141592653589793 / (t_float)fftsize; for(i=0; ix_fftsize) { x->x_sin_cos = (TAB_COMPLEX *)resizebytes(x->x_sin_cos, x->x_fftsize*sizeof(TAB_COMPLEX), i*sizeof(TAB_COMPLEX)); x->x_fftsize = i; } tab_ifft_init(x); } static void tab_ifft_dst_re(t_tab_ifft *x, t_symbol *s) { x->x_sym_dst_re = s; } static void tab_ifft_dst_im(t_tab_ifft *x, t_symbol *s) { x->x_sym_dst_im = s; } static void tab_ifft_src_re(t_tab_ifft *x, t_symbol *s) { x->x_sym_src_re = s; } static void tab_ifft_src_im(t_tab_ifft *x, t_symbol *s) { x->x_sym_src_im = s; } static void tab_ifft_bang(t_tab_ifft *x) { int i, j, k; int ok_src_re, ok_src_im, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g; ok_src_re = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, fftsize); if(ok_src_re && ok_src_im && ok_dst_re && ok_dst_im) { t_garray *a; vec_src_re=x->x_beg_mem_src_re; vec_src_im=x->x_beg_mem_src_im; vec_dst_re=x->x_beg_mem_dst_re; vec_dst_im=x->x_beg_mem_dst_im; for(j=0; j>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ g = 1.0 / (t_float)fftsize; for(i = 0; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); iemarray_setfloat(vec_dst_im, i, iemarray_getfloat(vec_dst_im, i)*g); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } static void tab_ifft_list(t_tab_ifft *x, t_symbol *s, int argc, t_atom *argv) { int beg_src_re, beg_src_im, beg_dst_re, beg_dst_im; int i, j, k; int ok_src_re, ok_src_im, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src_re = (int)atom_getintarg(0, argc, argv); beg_src_im = (int)atom_getintarg(1, argc, argv); beg_dst_re = (int)atom_getintarg(2, argc, argv); beg_dst_im = (int)atom_getintarg(3, argc, argv); if(beg_src_re < 0) beg_src_re = 0; if(beg_src_im < 0) beg_src_im = 0; if(beg_dst_re < 0) beg_dst_re = 0; if(beg_dst_im < 0) beg_dst_im = 0; ok_src_re = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); ok_src_im = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_src_im, &x->x_beg_mem_src_im, &x->x_size_src_im, fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, fftsize); if(ok_src_re && ok_src_im && ok_dst_re && ok_dst_im) { t_garray *a; vec_src_re=x->x_beg_mem_src_re + beg_src_re; vec_src_im=x->x_beg_mem_src_im + beg_src_im; vec_dst_re=x->x_beg_mem_dst_re + beg_dst_re; vec_dst_im=x->x_beg_mem_dst_im + beg_dst_im; for(j=0; j>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ g = 1.0 / (t_float)fftsize; for(i = 0; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); iemarray_setfloat(vec_dst_im, i, iemarray_getfloat(vec_dst_im, i)*g); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } else { post("tab_ifft-ERROR: list need 4 float arguments:"); post(" source_real_offset + source_imag_offset + destination_real_offset + destination_imag_offset"); } } static void tab_ifft_free(t_tab_ifft *x) { freebytes(x->x_sin_cos, x->x_fftsize * sizeof(TAB_COMPLEX)); } static void *tab_ifft_new(t_symbol *s, int argc, t_atom *argv) { t_tab_ifft *x = (t_tab_ifft *)pd_new(tab_ifft_class); t_symbol *src_re, *src_im, *dst_re, *dst_im; int fftsize, i=1; if((argc >= 5) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,3) && IS_A_FLOAT(argv,4)) { src_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_re = (t_symbol *)atom_getsymbolarg(2, argc, argv); dst_im = (t_symbol *)atom_getsymbolarg(3, argc, argv); fftsize = (int)atom_getintarg(4, argc, argv); } else { post("tab_ifft-ERROR: need 4 symbols + 1 float arguments:"); post(" source_real_array_name + source_imag_array_name + destination_real_array_name + destination_imag_array_name + IFFT-size"); return(0); } if(fftsize < 8) fftsize = 8; while(i <= fftsize) i *= 2; i /= 2; fftsize = i; x->x_fftsize = fftsize; x->x_sym_src_re = src_re; x->x_sym_src_im = src_im; x->x_sym_dst_re = dst_re; x->x_sym_dst_im = dst_im; x->x_sin_cos = (TAB_COMPLEX *)getbytes(x->x_fftsize * sizeof(TAB_COMPLEX)); tab_ifft_init(x); outlet_new(&x->x_obj, &s_bang); return(x); } void tab_ifft_setup(void) { tab_ifft_class = class_new(gensym("tab_ifft"), (t_newmethod)tab_ifft_new, (t_method)tab_ifft_free, sizeof(t_tab_ifft), 0, A_GIMME, 0); class_addbang(tab_ifft_class, (t_method)tab_ifft_bang); class_addlist(tab_ifft_class, (t_method)tab_ifft_list); class_addmethod(tab_ifft_class, (t_method)tab_ifft_ifftsize, gensym("ifftsize"), A_DEFFLOAT, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_src_re, gensym("src_re"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_src_im, gensym("src_im"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_src_re, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_src_im, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_dst_re, gensym("dst_re"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_dst_im, gensym("dst_im"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_dst_re, gensym("dst1"), A_DEFSYMBOL, 0); class_addmethod(tab_ifft_class, (t_method)tab_ifft_dst_im, gensym("dst2"), A_DEFSYMBOL, 0); } iem_tab/src/tab_lt.c0000644000175000017500000001313611141231101015075 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_lt ------------------------------ */ /* if(x_beg_mem_src1[i] < x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_lt { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_lt; static t_class *tab_lt_class; static void tab_lt_src1(t_tab_lt *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_lt_src2(t_tab_lt *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_lt_dst(t_tab_lt *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_lt_bang(t_tab_lt *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_lt_list(t_tab_lt *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_lt-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_lt_free(t_tab_lt *x) { } static void *tab_lt_new(t_symbol *s, int argc, t_atom *argv) { t_tab_lt *x = (t_tab_lt *)pd_new(tab_lt_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_lt-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_lt_setup(void) { tab_lt_class = class_new(gensym("tab_lt"), (t_newmethod)tab_lt_new, (t_method)tab_lt_free, sizeof(t_tab_lt), 0, A_GIMME, 0); class_addbang(tab_lt_class, (t_method)tab_lt_bang); class_addlist(tab_lt_class, (t_method)tab_lt_list); class_addmethod(tab_lt_class, (t_method)tab_lt_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_lt_class, (t_method)tab_lt_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_lt_class, (t_method)tab_lt_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_lt_class, gensym("iemhelp2/tab_lt-help")); } iem_tab/src/VC7/0000755000175000017500000000000012527356720014107 5ustar zmoelnigzmoelnigiem_tab/src/VC7/iem_tab.vcproj0000644000175000017500000000242111603066337016727 0ustar zmoelnigzmoelnig iem_tab/src/VC7/makefile_vc7proj0000644000175000017500000000311411603066337017254 0ustar zmoelnigzmoelnigTARGET = iem_tab all: ..\$(TARGET).dll VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio .NET 2003\Vc7" VIS_SDK_PATH = "C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK" PD_INST_PATH = "C:\Programme\pd-0.42-5" PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -D_CRT_SECURE_NO_WARNINGS PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libcmt /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel32 \ $(VIS_CPP_PATH)\lib\libcmt.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_SDK_PATH)\lib\kernel32.lib \ $(PD_INST_PATH)\bin\pd.lib SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c OBJ = $(SRC:.c=.obj) .c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c ..\$(TARGET).dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:$(TARGET)_setup \ /out:..\$(TARGET).dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iem_tab/src/iem_tab.vcproj0000644000175000017500000000356511603066337016342 0ustar zmoelnigzmoelnig iem_tab/src/makefile_darwin0000644000175000017500000000302212022354154016536 0ustar zmoelnigzmoelnigcurrent: all .SUFFIXES: .pd_darwin PD_INSTALL_PATH = "/Applications/Pd.app/Contents/Resources" INCLUDE = -I. -I$(PD_INSTALL_PATH)/src LIB = -ldl -lm -lpthread CFLAGS = -DPD -DUNIX -g -Wall -W -Werror -Wno-unused \ -Wno-parentheses -Wno-switch -O2 -fno-strict-aliasing \ $(INCLUDE) $(UCFLAGS) $(AFLAGS) \ MACOSXLINKFLAGS = -bundle -bundle_loader $(PD_INSTALL_PATH)/bin/pd SYSTEM = $(shell uname -m) # the sources SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtopow.c \ tab_dbtorms.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_rmstodb.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c TARGET = iem_tab.pd_darwin OBJ = $(SRC:.c=.o) # # ------------------ targets ------------------------------------ # clean: rm ../$(TARGET) rm *.o all: $(OBJ) @echo :: $(OBJ) $(CC) $(MACOSXLINKFLAGS) -o $(TARGET) *.o $(LIB) strip -S -x $(TARGET) mv $(TARGET) .. $(OBJ) : %.o : %.c touch $*.c $(CC) $(CFLAGS) -DPD $(INCLUDE) -c -o $*.o $*.c iem_tab/src/tab_sub.c0000644000175000017500000001251611141231101015250 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_sub ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i] - x_offset_src2[i] */ typedef struct _tab_sub { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_sub; static t_class *tab_sub_class; static void tab_sub_src1(t_tab_sub *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_sub_src2(t_tab_sub *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_sub_dst(t_tab_sub *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_sub_bang(t_tab_sub *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_sub_list(t_tab_sub *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_sub"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_sub-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_sub"); } } static void tab_sub_free(t_tab_sub *x) { } static void *tab_sub_new(t_symbol *s, int argc, t_atom *argv) { t_tab_sub *x = (t_tab_sub *)pd_new(tab_sub_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_sub-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_sub_setup(void) { tab_sub_class = class_new(gensym("tab_sub"), (t_newmethod)tab_sub_new, (t_method)tab_sub_free, sizeof(t_tab_sub), 0, A_GIMME, 0); class_addbang(tab_sub_class, (t_method)tab_sub_bang); class_addlist(tab_sub_class, (t_method)tab_sub_list); class_addmethod(tab_sub_class, (t_method)tab_sub_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_sub_class, (t_method)tab_sub_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_sub_class, (t_method)tab_sub_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_sub_class, gensym("iemhelp2/tab_sub-help")); } iem_tab/src/tab_complex_inv.c0000644000175000017500000002025312022354154017014 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_complex_inv ------------------------------ */ /* x_beg_mem_dst_re[i] = x_beg_mem_src1_re[i] / (x_beg_mem_src1_re[i]*x_beg_mem_src1_re[i] + x_beg_mem_src1_im[i]*x_beg_mem_src1_im[i]) */ /* x_beg_mem_dst_im[i] = -x_beg_mem_src1_im[i] / (x_beg_mem_src1_re[i]*x_beg_mem_src1_re[i] + x_beg_mem_src1_im[i]*x_beg_mem_src1_im[i]) */ typedef struct _tab_complex_inv { t_object x_obj; int x_size_src1_re; int x_size_dst_re; int x_size_src1_im; int x_size_dst_im; int x_offset_src1_re; int x_offset_dst_re; int x_offset_src1_im; int x_offset_dst_im; iemarray_t *x_beg_mem_src1_re; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_src1_im; iemarray_t *x_beg_mem_dst_im; t_symbol *x_sym_scr1_re; t_symbol *x_sym_dst_re; t_symbol *x_sym_scr1_im; t_symbol *x_sym_dst_im; } t_tab_complex_inv; static t_class *tab_complex_inv_class; static void tab_complex_inv_src1_re(t_tab_complex_inv *x, t_symbol *s) { x->x_sym_scr1_re = s; } static void tab_complex_inv_src1_im(t_tab_complex_inv *x, t_symbol *s) { x->x_sym_scr1_im = s; } static void tab_complex_inv_dst_re(t_tab_complex_inv *x, t_symbol *s) { x->x_sym_dst_re = s; } static void tab_complex_inv_dst_im(t_tab_complex_inv *x, t_symbol *s) { x->x_sym_dst_im = s; } static void tab_complex_inv_bang(t_tab_complex_inv *x) { int i, n; int ok_src1_re, ok_dst_re; int ok_src1_im, ok_dst_im; iemarray_t *vec_src1_re, *vec_dst_re; iemarray_t *vec_src1_im, *vec_dst_im; ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, 0); ok_dst_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, 0); ok_src1_im = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_scr1_im, &x->x_beg_mem_src1_im, &x->x_size_src1_im, 0); ok_dst_im = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, 0); if(ok_src1_re && ok_dst_re && ok_src1_im && ok_dst_im) { if(x->x_size_src1_re < x->x_size_dst_re) n = x->x_size_src1_re; else n = x->x_size_dst_re; if(x->x_size_src1_im < n) n = x->x_size_src1_im; if(x->x_size_dst_im < n) n = x->x_size_dst_im; vec_src1_re = x->x_beg_mem_src1_re; vec_dst_re = x->x_beg_mem_dst_re; vec_src1_im = x->x_beg_mem_src1_im; vec_dst_im = x->x_beg_mem_dst_im; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } } static void tab_complex_inv_list(t_tab_complex_inv *x, t_symbol *s, int argc, t_atom *argv) { int i, n; int beg_src1_re, beg_dst_re; int beg_src1_im, beg_dst_im; int ok_src1_re, ok_dst_re; int ok_src1_im, ok_dst_im; iemarray_t *vec_src1_re, *vec_dst_re; iemarray_t *vec_src1_im, *vec_dst_im; if((argc >= 5) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3) && IS_A_FLOAT(argv,4)) { beg_src1_re = (int)atom_getintarg(0, argc, argv); beg_src1_im = (int)atom_getintarg(1, argc, argv); beg_dst_re = (int)atom_getintarg(2, argc, argv); beg_dst_im = (int)atom_getintarg(3, argc, argv); n = (int)atom_getintarg(4, argc, argv); if(beg_src1_re < 0) beg_src1_re = 0; if(beg_dst_re < 0) beg_dst_re = 0; if(beg_src1_im < 0) beg_src1_im = 0; if(beg_dst_im < 0) beg_dst_im = 0; if(n < 0) n = 0; ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, beg_src1_re+n); ok_dst_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, beg_dst_re+n); ok_src1_im = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_scr1_im, &x->x_beg_mem_src1_im, &x->x_size_src1_im, beg_src1_im+n); ok_dst_im = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, beg_dst_im+n); if(ok_src1_re && ok_dst_re && ok_src1_im && ok_dst_im) { vec_src1_re = x->x_beg_mem_src1_re + beg_src1_re; vec_dst_re = x->x_beg_mem_dst_re + beg_dst_re; vec_src1_im = x->x_beg_mem_src1_im + beg_src1_im; vec_dst_im = x->x_beg_mem_dst_im + beg_dst_im; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } } else { post("tab_complex_inv-ERROR: list need 5 float arguments:"); post(" source1_real_offset + source1_imag_offset + destination_real_offset + destination_imag_offset + number_of_samples_to_complex_mul"); } } static void tab_complex_inv_free(t_tab_complex_inv *x) { } static void *tab_complex_inv_new(t_symbol *s, int argc, t_atom *argv) { t_tab_complex_inv *x = (t_tab_complex_inv *)pd_new(tab_complex_inv_class); t_symbol *src1_re, *src2_re, *dst_re, *src1_im, *src2_im, *dst_im; if((argc >= 4) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,3)) { src1_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src1_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_re = (t_symbol *)atom_getsymbolarg(2, argc, argv); dst_im = (t_symbol *)atom_getsymbolarg(3, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src1_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_re = src1_re; dst_im = src1_im; } else { post("tab_complex_inv-ERROR: need 4 symbols arguments:"); post(" source1_real_array_name + source1_imag_array_name + destination_real_array_name + destination_imag_array_name"); return(0); } x->x_sym_scr1_re = src1_re; x->x_sym_scr1_im = src1_im; x->x_sym_dst_re = dst_re; x->x_sym_dst_im = dst_im; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_complex_inv_setup(void) { tab_complex_inv_class = class_new(gensym("tab_complex_inv"), (t_newmethod)tab_complex_inv_new, (t_method)tab_complex_inv_free, sizeof(t_tab_complex_inv), 0, A_GIMME, 0); class_addbang(tab_complex_inv_class, (t_method)tab_complex_inv_bang); class_addlist(tab_complex_inv_class, (t_method)tab_complex_inv_list); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_src1_re, gensym("src1_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_src1_re, gensym("src_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_dst_re, gensym("dst_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_src1_im, gensym("src1_im"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_src1_im, gensym("src_im"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_inv_class, (t_method)tab_complex_inv_dst_im, gensym("dst_im"), A_DEFSYMBOL, 0); } iem_tab/src/makefile_vc9proj0000644000175000017500000000323612444321340016654 0ustar zmoelnigzmoelnigTARGET = iem_tab all: ..\$(TARGET).dll VIS_CPP_PATH = "$(PROGRAMFILES)\Microsoft Visual Studio 9.0\VC" VIS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDKs\Windows\v6.0A" PD_INST_PATH = "$(PROGRAMFILES)\pd" PD_WIN_INCLUDE_PATH = /I. /I..\..\include /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /DHAVE_G_CANVAS_H /Ox -D_CRT_SECURE_NO_WARNINGS PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libcmt /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel32 \ $(VIS_CPP_PATH)\lib\libcmt.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_SDK_PATH)\lib\kernel32.lib \ $(PD_INST_PATH)\bin\pd.lib SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtorms.c \ tab_dbtopow.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rmstodb.c \ tab_rfft.c \ tab_rifft.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ $(TARGET).c OBJ = $(SRC:.c=.obj) .c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c ..\$(TARGET).dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:$(TARGET)_setup \ /out:..\$(TARGET).dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iem_tab/src/iem_tab.h0000644000175000017500000000072411660756044015264 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #ifndef __IEMTAB_H__ #define __IEMTAB_H__ typedef struct { t_float real; t_float imag; } TAB_COMPLEX; int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, iemarray_t **beg_mem, int *array_size, int max_index); #endif iem_tab/src/tab_add.c0000644000175000017500000001251611141231101015207 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_add ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i] + x_beg_mem_src2[i] */ typedef struct _tab_add { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_add; static t_class *tab_add_class; static void tab_add_src1(t_tab_add *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_add_src2(t_tab_add *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_add_dst(t_tab_add *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_add_bang(t_tab_add *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_add_list(t_tab_add *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_add-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_add"); } } static void tab_add_free(t_tab_add *x) { } static void *tab_add_new(t_symbol *s, int argc, t_atom *argv) { t_tab_add *x = (t_tab_add *)pd_new(tab_add_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_add-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_add_setup(void) { tab_add_class = class_new(gensym("tab_add"), (t_newmethod)tab_add_new, (t_method)tab_add_free, sizeof(t_tab_add), 0, A_GIMME, 0); class_addbang(tab_add_class, (t_method)tab_add_bang); class_addlist(tab_add_class, (t_method)tab_add_list); class_addmethod(tab_add_class, (t_method)tab_add_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_add_class, (t_method)tab_add_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_add_class, (t_method)tab_add_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_add_class, gensym("iemhelp2/tab_add-help")); } iem_tab/src/tab_const.c0000644000175000017500000000734412022354154015625 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_const ------------------------------ */ /* x_beg_mem_dst[i] = c */ typedef struct _tab_const { t_object x_obj; int x_size_dst; int x_offset_dst; t_float x_const; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_dst; } t_tab_const; static t_class *tab_const_class; static void tab_const_dst(t_tab_const *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_const_bang(t_tab_const *x) { int i, n; int ok_dst; iemarray_t *vec_dst; ok_dst = iem_tab_check_arrays(gensym("tab_const"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_dst) { n = x->x_size_dst; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_const_float(t_tab_const *x, t_floatarg c) { int i, n; int ok_dst; iemarray_t *vec_dst; ok_dst = iem_tab_check_arrays(gensym("tab_const"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_dst) { n = x->x_size_dst; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_const_list(t_tab_const *x, t_symbol *s, int argc, t_atom *argv) { int beg_dst; int i, n; int ok_dst; iemarray_t *vec_dst; t_float c; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_dst = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); c = (t_float)atom_getfloatarg(2, argc, argv); if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_dst = iem_tab_check_arrays(gensym("tab_const"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_dst) { vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_const-ERROR: list need 3 float arguments:"); post(" destination_offset + number_of_samples_to_copy + constant-value"); } } static void tab_const_free(t_tab_const *x) { } static void *tab_const_new(t_symbol *s, int argc, t_atom *argv) { t_tab_const *x = (t_tab_const *)pd_new(tab_const_class); t_symbol *dst; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { dst = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_const-ERROR: need 1 symbol argument:"); post(" destination_array_name"); return(0); } x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_const_setup(void) { tab_const_class = class_new(gensym("tab_const"), (t_newmethod)tab_const_new, (t_method)tab_const_free, sizeof(t_tab_const), 0, A_GIMME, 0); class_addbang(tab_const_class, (t_method)tab_const_bang); class_addfloat(tab_const_class, (t_method)tab_const_float); class_addlist(tab_const_class, (t_method)tab_const_list); class_addmethod(tab_const_class, (t_method)tab_const_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/tab_rmstodb.c0000644000175000017500000001153111660755610016153 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2010 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include #define IEMTABLOGTEN 2.302585092994046 /* -------------------------- tab_rmstodb ------------------------------ */ typedef struct _tab_rmstodb { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_rmstodb; static t_class *tab_rmstodb_class; static void tab_rmstodb_src(t_tab_rmstodb *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_rmstodb_dst(t_tab_rmstodb *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_rmstodb_bang(t_tab_rmstodb *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_rmstodb"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_rmstodb"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_rmstodb_list(t_tab_rmstodb *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_rmstodb"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_rmstodb"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_rmstodb-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_rmstodb"); } } static void tab_rmstodb_free(t_tab_rmstodb *x) { } static void *tab_rmstodb_new(t_symbol *s, int argc, t_atom *argv) { t_tab_rmstodb *x = (t_tab_rmstodb *)pd_new(tab_rmstodb_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_rmstodb-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_rmstodb_setup(void) { tab_rmstodb_class = class_new(gensym("tab_rmstodb"), (t_newmethod)tab_rmstodb_new, (t_method)tab_rmstodb_free, sizeof(t_tab_rmstodb), 0, A_GIMME, 0); class_addbang(tab_rmstodb_class, (t_method)tab_rmstodb_bang); class_addlist(tab_rmstodb_class, (t_method)tab_rmstodb_list); class_addmethod(tab_rmstodb_class, (t_method)tab_rmstodb_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_rmstodb_class, (t_method)tab_rmstodb_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_rmstodb_class, (t_method)tab_rmstodb_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/VC9/0000755000175000017500000000000012527356720014111 5ustar zmoelnigzmoelnigiem_tab/src/VC9/iem_tab.sln0000644000175000017500000000155711603066337016233 0ustar zmoelnigzmoelnig Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iem_tab", "iem_tab.vcproj", "{6A44952F-0D55-44EE-9032-928368583BEC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6A44952F-0D55-44EE-9032-928368583BEC}.Debug|Win32.ActiveCfg = Debug|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Debug|Win32.Build.0 = Debug|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Release|Win32.ActiveCfg = Release|Win32 {6A44952F-0D55-44EE-9032-928368583BEC}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal iem_tab/src/VC9/iem_tab.vcproj0000644000175000017500000000356511603066337016743 0ustar zmoelnigzmoelnig iem_tab/src/VC9/makefile_vc9proj0000644000175000017500000000307211603066337017263 0ustar zmoelnigzmoelnigTARGET = iem_tab all: ..\$(TARGET).dll VIS_CPP_PATH = "C:\Program Files\Microsoft Visual Studio 9.0\VC" VIS_SDK_PATH = "C:\Program Files\Microsoft SDKs\Windows\v6.0A" PD_INST_PATH = "C:\Program Files\pd-0.43.0" PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -D_CRT_SECURE_NO_WARNINGS PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libcmt /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel32 \ $(VIS_CPP_PATH)\lib\libcmt.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_SDK_PATH)\lib\kernel32.lib \ $(PD_INST_PATH)\bin\pd.lib SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c OBJ = $(SRC:.c=.obj) .c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c ..\$(TARGET).dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:$(TARGET)_setup \ /out:..\$(TARGET).dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iem_tab/src/makefile_win0000644000175000017500000000316112022354154016053 0ustar zmoelnigzmoelnig all: ..\iem_tab.dll VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio\Vc98" PD_INST_PATH = "C:\Programme\pd" PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -DPA_LITTLE_ENDIAN PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NODEFAULTLIB:uuid \ $(VIS_CPP_PATH)\lib\libc.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_CPP_PATH)\lib\kernel32.lib \ $(VIS_CPP_PATH)\lib\wsock32.lib \ $(VIS_CPP_PATH)\lib\winmm.lib \ $(PD_INST_PATH)\bin\pd.lib SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtopow.c \ tab_dbtorms.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_rmstodb.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c OBJ = $(SRC:.c=.obj) .c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c ..\iem_tab.dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:iem_tab_setup \ /out:..\iem_tab.dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iem_tab/src/makefile_d_ppc0000644000175000017500000000260212022354154016342 0ustar zmoelnigzmoelnigcurrent: all .SUFFIXES: .d_ppc PD_INSTALL_PATH = "/Applications/Pd.app/Contents/Resources" INCLUDE = -I. -I$(PD_INSTALL_PATH)/src CFLAGS =-DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch LFLAGS = -bundle -undefined suppress -flat_namespace # the sources SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtopow.c \ tab_dbtorms.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_rmstodb.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c TARGET = iem_tab.d_ppc OBJ = $(SRC:.c=.o) # # ------------------ targets ------------------------------------ # clean: rm ../$(TARGET) rm *.o all: $(OBJ) @echo :: $(OBJ) $(CC) $(LFLAGS) -o $(TARGET) *.o strip -S -x $(TARGET) mv $(TARGET) .. $(OBJ) : %.o : %.c touch $*.c $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c iem_tab/src/tab_mul.c0000644000175000017500000001251011141231101015246 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_mul ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i]*x_offset_src2[i] */ typedef struct _tab_mul { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_mul; static t_class *tab_mul_class; static void tab_mul_src1(t_tab_mul *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_mul_src2(t_tab_mul *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_mul_dst(t_tab_mul *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_mul_bang(t_tab_mul *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_mul_list(t_tab_mul *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_mul"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_mul-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_mul"); } } static void tab_mul_free(t_tab_mul *x) { } static void *tab_mul_new(t_symbol *s, int argc, t_atom *argv) { t_tab_mul *x = (t_tab_mul *)pd_new(tab_mul_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_mul-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_mul_setup(void) { tab_mul_class = class_new(gensym("tab_mul"), (t_newmethod)tab_mul_new, (t_method)tab_mul_free, sizeof(t_tab_mul), 0, A_GIMME, 0); class_addbang(tab_mul_class, (t_method)tab_mul_bang); class_addlist(tab_mul_class, (t_method)tab_mul_list); class_addmethod(tab_mul_class, (t_method)tab_mul_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_mul_class, (t_method)tab_mul_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_mul_class, (t_method)tab_mul_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_mul_class, gensym("iemhelp2/tab_mul-help")); } iem_tab/src/tab_eq_scalar.c0000644000175000017500000001177611141231101016420 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_eq_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] == compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_eq_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_eq_scalar; static t_class *tab_eq_scalar_class; static void tab_eq_scalar_src(t_tab_eq_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_eq_scalar_float(t_tab_eq_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_eq_scalar_dst(t_tab_eq_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_eq_scalar_list(t_tab_eq_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; t_float compare; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_eq_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_eq_scalar_free(t_tab_eq_scalar *x) { } static void *tab_eq_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_eq_scalar *x = (t_tab_eq_scalar *)pd_new(tab_eq_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_eq_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_eq_scalar_setup(void) { tab_eq_scalar_class = class_new(gensym("tab_eq_scalar"), (t_newmethod)tab_eq_scalar_new, (t_method)tab_eq_scalar_free, sizeof(t_tab_eq_scalar), 0, A_GIMME, 0); class_addfloat(tab_eq_scalar_class, (t_method)tab_eq_scalar_float); class_addlist(tab_eq_scalar_class, (t_method)tab_eq_scalar_list); class_addmethod(tab_eq_scalar_class, (t_method)tab_eq_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_eq_scalar_class, (t_method)tab_eq_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_eq_scalar_class, (t_method)tab_eq_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_eq_scalar_class, gensym("iemhelp2/tab_eq_scalar-help")); } iem_tab/src/tab_eq.c0000644000175000017500000001314011141231101015056 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_eq ------------------------------ */ /* if(x_beg_mem_src1[i] == x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_eq { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_eq; static t_class *tab_eq_class; static void tab_eq_src1(t_tab_eq *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_eq_src2(t_tab_eq *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_eq_dst(t_tab_eq *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_eq_bang(t_tab_eq *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_eq_list(t_tab_eq *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_eq-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_eq_free(t_tab_eq *x) { } static void *tab_eq_new(t_symbol *s, int argc, t_atom *argv) { t_tab_eq *x = (t_tab_eq *)pd_new(tab_eq_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_eq-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_eq_setup(void) { tab_eq_class = class_new(gensym("tab_eq"), (t_newmethod)tab_eq_new, (t_method)tab_eq_free, sizeof(t_tab_eq), 0, A_GIMME, 0); class_addbang(tab_eq_class, (t_method)tab_eq_bang); class_addlist(tab_eq_class, (t_method)tab_eq_list); class_addmethod(tab_eq_class, (t_method)tab_eq_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_eq_class, (t_method)tab_eq_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_eq_class, (t_method)tab_eq_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_eq_class, gensym("iemhelp2/tab_eq-help")); } iem_tab/src/tab_ne.c0000644000175000017500000001314111141231101015054 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_ne ------------------------------ */ /* if(x_beg_mem_src1[i] != x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_ne { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_ne; static t_class *tab_ne_class; static void tab_ne_src1(t_tab_ne *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_ne_src2(t_tab_ne *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_ne_dst(t_tab_ne *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_ne_bang(t_tab_ne *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_ne_list(t_tab_ne *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_ne"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_ne-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_ne_free(t_tab_ne *x) { } static void *tab_ne_new(t_symbol *s, int argc, t_atom *argv) { t_tab_ne *x = (t_tab_ne *)pd_new(tab_ne_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_ne-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_ne_setup(void) { tab_ne_class = class_new(gensym("tab_ne"), (t_newmethod)tab_ne_new, (t_method)tab_ne_free, sizeof(t_tab_ne), 0, A_GIMME, 0); class_addbang(tab_ne_class, (t_method)tab_ne_bang); class_addlist(tab_ne_class, (t_method)tab_ne_list); class_addmethod(tab_ne_class, (t_method)tab_ne_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_ne_class, (t_method)tab_ne_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_ne_class, (t_method)tab_ne_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_ne_class, gensym("iemhelp2/tab_ne-help")); } iem_tab/src/iem_tab.dsw0000644000175000017500000000106511203415342015613 0ustar zmoelnigzmoelnigMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "iem_tab"=.\iem_tab.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### iem_tab/src/tab_dbtorms.c0000644000175000017500000001161411660755610016155 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2010 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include #define IEMTABLOGTEN 2.302585092994046 /* -------------------------- tab_dbtorms ------------------------------ */ /* x_beg_mem_dst[i] = sqrt(x_beg_mem_src1[i]) */ typedef struct _tab_dbtorms { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_dbtorms; static t_class *tab_dbtorms_class; static void tab_dbtorms_src(t_tab_dbtorms *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_dbtorms_dst(t_tab_dbtorms *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_dbtorms_bang(t_tab_dbtorms *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_dbtorms"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_dbtorms"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i 485.0) f = 485.0; iemarray_setfloat(vec_dst, i, exp((IEMTABLOGTEN * 0.05) * (f-100.0))); } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_dbtorms_list(t_tab_dbtorms *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_dbtorms"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_dbtorms"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i 485.0) f = 485.0; iemarray_setfloat(vec_dst, i, exp((IEMTABLOGTEN * 0.05) * (f-100.0))); } } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_dbtorms-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_dbtorms"); } } static void tab_dbtorms_free(t_tab_dbtorms *x) { } static void *tab_dbtorms_new(t_symbol *s, int argc, t_atom *argv) { t_tab_dbtorms *x = (t_tab_dbtorms *)pd_new(tab_dbtorms_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_dbtorms-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_dbtorms_setup(void) { tab_dbtorms_class = class_new(gensym("tab_dbtorms"), (t_newmethod)tab_dbtorms_new, (t_method)tab_dbtorms_free, sizeof(t_tab_dbtorms), 0, A_GIMME, 0); class_addbang(tab_dbtorms_class, (t_method)tab_dbtorms_bang); class_addlist(tab_dbtorms_class, (t_method)tab_dbtorms_list); class_addmethod(tab_dbtorms_class, (t_method)tab_dbtorms_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_dbtorms_class, (t_method)tab_dbtorms_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_dbtorms_class, (t_method)tab_dbtorms_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/tab_div.c0000644000175000017500000001312711141231101015240 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_div ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i]/x_offset_src2[i] */ typedef struct _tab_div { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_div; static t_class *tab_div_class; static void tab_div_src1(t_tab_div *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_div_src2(t_tab_div *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_div_dst(t_tab_div *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_div_bang(t_tab_div *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_div_list(t_tab_div *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_div-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_div"); } } static void tab_div_free(t_tab_div *x) { } static void *tab_div_new(t_symbol *s, int argc, t_atom *argv) { t_tab_div *x = (t_tab_div *)pd_new(tab_div_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_div-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_div_setup(void) { tab_div_class = class_new(gensym("tab_div"), (t_newmethod)tab_div_new, (t_method)tab_div_free, sizeof(t_tab_div), 0, A_GIMME, 0); class_addbang(tab_div_class, (t_method)tab_div_bang); class_addlist(tab_div_class, (t_method)tab_div_list); class_addmethod(tab_div_class, (t_method)tab_div_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_div_class, (t_method)tab_div_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_div_class, (t_method)tab_div_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_div_class, gensym("iemhelp2/tab_div-help")); } iem_tab/src/tab_max_index.c0000644000175000017500000000741411141231101016434 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_max_index ------------------------------ */ typedef struct _tab_max_index { t_object x_obj; int x_size_src1; int x_offset_src1; iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_max_out; void *x_max_index_out; } t_tab_max_index; static t_class *tab_max_index_class; static void tab_max_index_src(t_tab_max_index *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_max_index_bang(t_tab_max_index *x) { int i, n; int ok_src, max_index=0; iemarray_t *vec_src; t_float max=-1.0e37; ok_src = iem_tab_check_arrays(gensym("tab_max_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; vec_src = x->x_beg_mem_src1; if(n) { for(i=0; i max) { max = iemarray_getfloat(vec_src, i); max_index = i; } } outlet_float(x->x_max_out, max); outlet_float(x->x_max_index_out, (t_float)max_index); outlet_bang(x->x_bang_out); } } } static void tab_max_index_list(t_tab_max_index *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src, max_index=0; iemarray_t *vec_src; t_float max=-1.0e37; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_max_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; i max) { max = iemarray_getfloat(vec_src, i); max_index = i + beg_src; } } outlet_float(x->x_max_out, max); outlet_float(x->x_max_index_out, (t_float)max_index); outlet_bang(x->x_bang_out); } } } else { post("tab_max_index-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_max_index"); } } static void tab_max_index_free(t_tab_max_index *x) { } static void *tab_max_index_new(t_symbol *s, int argc, t_atom *argv) { t_tab_max_index *x = (t_tab_max_index *)pd_new(tab_max_index_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_max_index-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_sym_scr1 = src; x->x_bang_out = outlet_new(&x->x_obj, &s_bang); x->x_max_index_out = outlet_new(&x->x_obj, &s_float); x->x_max_out = outlet_new(&x->x_obj, &s_float); return(x); } void tab_max_index_setup(void) { tab_max_index_class = class_new(gensym("tab_max_index"), (t_newmethod)tab_max_index_new, (t_method)tab_max_index_free, sizeof(t_tab_max_index), 0, A_GIMME, 0); class_addbang(tab_max_index_class, (t_method)tab_max_index_bang); class_addlist(tab_max_index_class, (t_method)tab_max_index_list); class_addmethod(tab_max_index_class, (t_method)tab_max_index_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_max_index_class, (t_method)tab_max_index_src, gensym("src1"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_max_index_class, gensym("iemhelp2/tab_max_index-help")); } iem_tab/src/tab_ne_scalar.c0000644000175000017500000001177611141231101016415 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_ne_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] != compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_ne_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_ne_scalar; static t_class *tab_ne_scalar_class; static void tab_ne_scalar_src(t_tab_ne_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_ne_scalar_float(t_tab_ne_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_ne_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_ne_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_ne_scalar_dst(t_tab_ne_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_ne_scalar_list(t_tab_ne_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float compare; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_ne_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_ne_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_ne_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_ne_scalar_free(t_tab_ne_scalar *x) { } static void *tab_ne_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_ne_scalar *x = (t_tab_ne_scalar *)pd_new(tab_ne_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_ne_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_ne_scalar_setup(void) { tab_ne_scalar_class = class_new(gensym("tab_ne_scalar"), (t_newmethod)tab_ne_scalar_new, (t_method)tab_ne_scalar_free, sizeof(t_tab_ne_scalar), 0, A_GIMME, 0); class_addfloat(tab_ne_scalar_class, (t_method)tab_ne_scalar_float); class_addlist(tab_ne_scalar_class, (t_method)tab_ne_scalar_list); class_addmethod(tab_ne_scalar_class, (t_method)tab_ne_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_ne_scalar_class, (t_method)tab_ne_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_ne_scalar_class, (t_method)tab_ne_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_ne_scalar_class, gensym("iemhelp2/tab_ne_scalar-help")); } iem_tab/src/tab_complex_mul.c0000644000175000017500000002510711141231101017003 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_complex_mul ------------------------------ */ /* x_beg_mem_dst_re[i] = x_beg_mem_src1_re[i]*x_beg_mem_src2_re[i] - x_beg_mem_src1_im[i]*x_beg_mem_src2_im[i] */ /* x_beg_mem_dst_im[i] = x_beg_mem_src1_re[i]*x_beg_mem_src2_im[i] + x_beg_mem_src1_im[i]*x_beg_mem_src2_re[i] */ typedef struct _tab_complex_mul { t_object x_obj; int x_size_src1_re; int x_size_src2_re; int x_size_dst_re; int x_size_src1_im; int x_size_src2_im; int x_size_dst_im; int x_offset_src1_re; int x_offset_src2_re; int x_offset_dst_re; int x_offset_src1_im; int x_offset_src2_im; int x_offset_dst_im; iemarray_t *x_beg_mem_src1_re; iemarray_t *x_beg_mem_src2_re; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_src1_im; iemarray_t *x_beg_mem_src2_im; iemarray_t *x_beg_mem_dst_im; t_symbol *x_sym_scr1_re; t_symbol *x_sym_scr2_re; t_symbol *x_sym_dst_re; t_symbol *x_sym_scr1_im; t_symbol *x_sym_scr2_im; t_symbol *x_sym_dst_im; } t_tab_complex_mul; static t_class *tab_complex_mul_class; static void tab_complex_mul_src1_re(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_scr1_re = s; } static void tab_complex_mul_src1_im(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_scr1_im = s; } static void tab_complex_mul_src2_re(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_scr2_re = s; } static void tab_complex_mul_src2_im(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_scr2_im = s; } static void tab_complex_mul_dst_re(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_dst_re = s; } static void tab_complex_mul_dst_im(t_tab_complex_mul *x, t_symbol *s) { x->x_sym_dst_im = s; } static void tab_complex_mul_bang(t_tab_complex_mul *x) { int i, n; int ok_src1_re, ok_src2_re, ok_dst_re; int ok_src1_im, ok_src2_im, ok_dst_im; iemarray_t *vec_src1_re, *vec_src2_re, *vec_dst_re; iemarray_t *vec_src1_im, *vec_src2_im, *vec_dst_im; ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, 0); ok_src2_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr2_re, &x->x_beg_mem_src2_re, &x->x_size_src2_re, 0); ok_dst_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, 0); ok_src1_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr1_im, &x->x_beg_mem_src1_im, &x->x_size_src1_im, 0); ok_src2_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr2_im, &x->x_beg_mem_src2_im, &x->x_size_src2_im, 0); ok_dst_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, 0); if(ok_src1_re && ok_src2_re && ok_dst_re && ok_src1_im && ok_src2_im && ok_dst_im) { if(x->x_size_src1_re < x->x_size_dst_re) n = x->x_size_src1_re; else n = x->x_size_dst_re; if(x->x_size_src2_re < n) n = x->x_size_src2_re; if(x->x_size_src1_im < n) n = x->x_size_src1_im; if(x->x_size_src2_im < n) n = x->x_size_src2_im; if(x->x_size_dst_im < n) n = x->x_size_dst_im; vec_src1_re = x->x_beg_mem_src1_re; vec_src2_re = x->x_beg_mem_src2_re; vec_dst_re = x->x_beg_mem_dst_re; vec_src1_im = x->x_beg_mem_src1_im; vec_src2_im = x->x_beg_mem_src2_im; vec_dst_im = x->x_beg_mem_dst_im; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } } static void tab_complex_mul_list(t_tab_complex_mul *x, t_symbol *s, int argc, t_atom *argv) { int i, n; int beg_src1_re, beg_src2_re, beg_dst_re; int beg_src1_im, beg_src2_im, beg_dst_im; int ok_src1_re, ok_src2_re, ok_dst_re; int ok_src1_im, ok_src2_im, ok_dst_im; iemarray_t *vec_src1_re, *vec_src2_re, *vec_dst_re; iemarray_t *vec_src1_im, *vec_src2_im, *vec_dst_im; if((argc >= 7) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3) && IS_A_FLOAT(argv,4) && IS_A_FLOAT(argv,5) && IS_A_FLOAT(argv,6)) { beg_src1_re = (int)atom_getintarg(0, argc, argv); beg_src1_im = (int)atom_getintarg(1, argc, argv); beg_src2_re = (int)atom_getintarg(2, argc, argv); beg_src2_im = (int)atom_getintarg(3, argc, argv); beg_dst_re = (int)atom_getintarg(4, argc, argv); beg_dst_im = (int)atom_getintarg(5, argc, argv); n = (int)atom_getintarg(6, argc, argv); if(beg_src1_re < 0) beg_src1_re = 0; if(beg_src2_re < 0) beg_src2_re = 0; if(beg_dst_re < 0) beg_dst_re = 0; if(beg_src1_im < 0) beg_src1_im = 0; if(beg_src2_im < 0) beg_src2_im = 0; if(beg_dst_im < 0) beg_dst_im = 0; if(n < 0) n = 0; ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, beg_src1_re+n); ok_src2_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr2_re, &x->x_beg_mem_src2_re, &x->x_size_src2_re, beg_src2_re+n); ok_dst_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, beg_dst_re+n); ok_src1_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr1_im, &x->x_beg_mem_src1_im, &x->x_size_src1_im, beg_src1_im+n); ok_src2_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr2_im, &x->x_beg_mem_src2_im, &x->x_size_src2_im, beg_src2_im+n); ok_dst_im = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, beg_dst_im+n); if(ok_src1_re && ok_src2_re && ok_dst_re && ok_src1_im && ok_src2_im && ok_dst_im) { vec_src1_re = x->x_beg_mem_src1_re + beg_src1_re; vec_src2_re = x->x_beg_mem_src2_re + beg_src2_re; vec_dst_re = x->x_beg_mem_dst_re + beg_dst_re; vec_src1_im = x->x_beg_mem_src1_im + beg_src1_im; vec_src2_im = x->x_beg_mem_src2_im + beg_src2_im; vec_dst_im = x->x_beg_mem_dst_im + beg_dst_im; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } } else { post("tab_complex_mul-ERROR: list need 7 float arguments:"); post(" source1_real_offset + source1_imag_offset + source2_real_offset + source2_imag_offset + destination_real_offset + destination_imag_offset + number_of_samples_to_complex_mul"); } } static void tab_complex_mul_free(t_tab_complex_mul *x) { } static void *tab_complex_mul_new(t_symbol *s, int argc, t_atom *argv) { t_tab_complex_mul *x = (t_tab_complex_mul *)pd_new(tab_complex_mul_class); t_symbol *src1_re, *src2_re, *dst_re, *src1_im, *src2_im, *dst_im; if((argc >= 6) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,3) && IS_A_SYMBOL(argv,4) && IS_A_SYMBOL(argv,5)) { src1_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src1_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); src2_re = (t_symbol *)atom_getsymbolarg(2, argc, argv); src2_im = (t_symbol *)atom_getsymbolarg(3, argc, argv); dst_re = (t_symbol *)atom_getsymbolarg(4, argc, argv); dst_im = (t_symbol *)atom_getsymbolarg(5, argc, argv); } else if((argc >= 4) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_SYMBOL(argv,4)) { src1_re = (t_symbol *)atom_getsymbolarg(0, argc, argv); src1_im = (t_symbol *)atom_getsymbolarg(1, argc, argv); src2_re = (t_symbol *)atom_getsymbolarg(2, argc, argv); src2_im = (t_symbol *)atom_getsymbolarg(3, argc, argv); dst_re = src1_re; dst_im = src1_im; } else { post("tab_complex_mul-ERROR: need 6 symbols arguments:"); post(" source1_real_array_name + source1_imag_array_name + source2_real_array_name + source2_imag_array_name + destination_real_array_name + destination_imag_array_name"); return(0); } x->x_sym_scr1_re = src1_re; x->x_sym_scr1_im = src1_im; x->x_sym_scr2_re = src2_re; x->x_sym_scr2_im = src2_im; x->x_sym_dst_re = dst_re; x->x_sym_dst_im = dst_im; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_complex_mul_setup(void) { tab_complex_mul_class = class_new(gensym("tab_complex_mul"), (t_newmethod)tab_complex_mul_new, (t_method)tab_complex_mul_free, sizeof(t_tab_complex_mul), 0, A_GIMME, 0); class_addbang(tab_complex_mul_class, (t_method)tab_complex_mul_bang); class_addlist(tab_complex_mul_class, (t_method)tab_complex_mul_list); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_src1_re, gensym("src1_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_src2_re, gensym("src2_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_dst_re, gensym("dst_re"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_src1_im, gensym("src1_im"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_src2_im, gensym("src2_im"), A_DEFSYMBOL, 0); class_addmethod(tab_complex_mul_class, (t_method)tab_complex_mul_dst_im, gensym("dst_im"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_complex_mul_class, gensym("iemhelp2/tab_complex_mul-help")); } iem_tab/src/tab_conv.c0000644000175000017500000002726612022354154015451 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* ---------------------------- tab_conv ------------------------------- */ /* for(i=0; ix_sym_scr1 = s; } static void tab_conv_src2(t_tab_conv *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_conv_dst(t_tab_conv *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_conv_bang(t_tab_conv *x) { int i, j, k, l, m, n, p, q; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_sig, *vec_ir, *vec_dst; t_float sum=0.0f; ok_src1 = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { t_garray *a; if((x->x_size_src1+x->x_size_src2-1) <= x->x_size_dst)// ok, the last part of dst is zero { if(x->x_size_src1 > x->x_size_src2)// src2(t-tau) is impuls response { vec_sig = x->x_beg_mem_src1; vec_ir = x->x_beg_mem_src2; n = x->x_size_src1; m = x->x_size_src2; } else// src1(t-tau) is impuls response { vec_sig = x->x_beg_mem_src2; vec_ir = x->x_beg_mem_src1; n = x->x_size_src2; m = x->x_size_src1; } vec_dst = x->x_beg_mem_dst; for(i=1; i0; i--, k++) { sum = 0.0f; for(j=1; j<=i; j++) sum += iemarray_getfloat(vec_sig, -j) * iemarray_getfloat(vec_ir, j+k); iemarray_setfloat(vec_dst, 0, sum); vec_dst++; } } else { if(x->x_size_src1 > x->x_size_src2)// src2(t-tau) is impuls response { vec_sig = x->x_beg_mem_src1; vec_ir = x->x_beg_mem_src2; n = x->x_size_src1; m = x->x_size_src2; } else// src1(t-tau) is impuls response { vec_sig = x->x_beg_mem_src2; vec_ir = x->x_beg_mem_src1; n = x->x_size_src2; m = x->x_size_src1; } vec_dst = x->x_beg_mem_dst; p = x->x_size_dst; q = 0; for(i=1; i= p) goto tab_conv_bang_end; } l = n - m + 1; for(i=0; i= p) goto tab_conv_bang_end; } for(i=m-1, k=0; i>0; i--, k++) { sum = 0.0f; for(j=1; j<=i; j++) sum += iemarray_getfloat(vec_sig, -j) * iemarray_getfloat(vec_ir, j+k); iemarray_setfloat(vec_dst, 0, sum); vec_dst++; q++; if(q >= p) goto tab_conv_bang_end; } for(i=m-1; i>0; i--) { sum = 0.0f; for(j=0, k=i-1; j= p) goto tab_conv_bang_end; } } tab_conv_bang_end: outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } static void tab_conv_list(t_tab_conv *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int n_src1, n_src2; int i, j, k, l, m, n, p; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_sig, *vec_ir, *vec_dst; t_float sum=0.0; if((argc >= 5) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3) && IS_A_FLOAT(argv,4)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n_src1 = (int)atom_getintarg(3, argc, argv); n_src2 = (int)atom_getintarg(4, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n_src1 < 0) n_src1 = 0; if(n_src2 < 0) n_src2 = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n_src1); ok_src2 = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n_src2); ok_dst = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n_src1); if(ok_src1 && ok_src2 && ok_dst) { t_garray *a; if((x->x_size_src1+x->x_size_src2-1) <= x->x_size_dst)// ok, the last part of dst is zero { if(x->x_size_src1 > x->x_size_src2)// src2(t-tau) is impuls response { vec_sig = x->x_beg_mem_src1; vec_ir = x->x_beg_mem_src2; n = x->x_size_src1; m = x->x_size_src2; } else// src1(t-tau) is impuls response { vec_sig = x->x_beg_mem_src2; vec_ir = x->x_beg_mem_src1; n = x->x_size_src2; m = x->x_size_src1; } vec_dst = x->x_beg_mem_dst; l = m - 1; for(i=0; i=0; i--) { sum = 0.0; for(j=0, k=i-1; jx_size_src1 > x->x_size_src2)// src2(t-tau) is impuls response { vec_sig = x->x_beg_mem_src1; vec_ir = x->x_beg_mem_src2; n = x->x_size_src1; m = x->x_size_src2; } else// src1(t-tau) is impuls response { vec_sig = x->x_beg_mem_src2; vec_ir = x->x_beg_mem_src1; n = x->x_size_src2; m = x->x_size_src1; } vec_dst = x->x_beg_mem_dst; p = x->x_size_dst; k = 0; l = m - 1; for(i=0; i= p) goto tab_conv_list_end; } l = n - m + 1; for(i=0; i= p) goto tab_conv_list_end; } l = m - 1; for(i=l-1; i>=0; i--) { sum = 0.0; for(j=0, k=i-1; j= p) goto tab_conv_list_end; } } tab_conv_list_end: outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } else { post("tab_conv-ERROR: list need 5 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_convolute + convolution_window_width"); } } static void tab_conv_free(t_tab_conv *x) { } static void *tab_conv_new(t_symbol *s, int argc, t_atom *argv) { t_tab_conv *x = (t_tab_conv *)pd_new(tab_conv_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_conv-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_conv_setup(void) { tab_conv_class = class_new(gensym("tab_conv"), (t_newmethod)tab_conv_new, (t_method)tab_conv_free, sizeof(t_tab_conv), 0, A_GIMME, 0); class_addbang(tab_conv_class, (t_method)tab_conv_bang); // class_addlist(tab_conv_class, (t_method)tab_conv_list); class_addmethod(tab_conv_class, (t_method)tab_conv_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_conv_class, (t_method)tab_conv_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_conv_class, (t_method)tab_conv_dst, gensym("dst"), A_DEFSYMBOL, 0); } iem_tab/src/tab_get_size.c0000644000175000017500000000361211141230571016277 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_get_size ------------------------------ */ typedef struct _tab_get_size { t_object x_obj; t_symbol *x_sym_src; } t_tab_get_size; static t_class *tab_get_size_class; static void tab_get_size_set(t_tab_get_size *x, t_symbol *s) { x->x_sym_src = s; } static void tab_get_size_bang(t_tab_get_size *x) { int ok_src, size_src; iemarray_t *beg_mem_src; ok_src = iem_tab_check_arrays(gensym("tab_get_size"), x->x_sym_src, &beg_mem_src, &size_src, 0); if(ok_src) { outlet_float(x->x_obj.ob_outlet, (t_float)size_src); } } static void tab_get_size_free(t_tab_get_size *x) { } static void *tab_get_size_new(t_symbol *s, int argc, t_atom *argv) { t_tab_get_size *x = (t_tab_get_size *)pd_new(tab_get_size_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_get_size-ERROR: need 1 symbol argument:"); post(" destination_array_name"); return(0); } x->x_sym_src = src; outlet_new(&x->x_obj, &s_float); return(x); } void tab_get_size_setup(void) { tab_get_size_class = class_new(gensym("tab_get_size"), (t_newmethod)tab_get_size_new, (t_method)tab_get_size_free, sizeof(t_tab_get_size), 0, A_GIMME, 0); class_addbang(tab_get_size_class, (t_method)tab_get_size_bang); class_addmethod(tab_get_size_class, (t_method)tab_get_size_set, gensym("set"), A_DEFSYMBOL, 0); class_addmethod(tab_get_size_class, (t_method)tab_get_size_set, gensym("get"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_get_size_class, gensym("iemhelp2/tab_get_size-help")); } iem_tab/src/tab_le_scalar.c0000644000175000017500000001177611141231101016413 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_le_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] <= compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_le_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_le_scalar; static t_class *tab_le_scalar_class; static void tab_le_scalar_src(t_tab_le_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_le_scalar_float(t_tab_le_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_le_scalar_dst(t_tab_le_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_le_scalar_list(t_tab_le_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float compare; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_le_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_le_scalar_free(t_tab_le_scalar *x) { } static void *tab_le_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_le_scalar *x = (t_tab_le_scalar *)pd_new(tab_le_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_le_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_le_scalar_setup(void) { tab_le_scalar_class = class_new(gensym("tab_le_scalar"), (t_newmethod)tab_le_scalar_new, (t_method)tab_le_scalar_free, sizeof(t_tab_le_scalar), 0, A_GIMME, 0); class_addfloat(tab_le_scalar_class, (t_method)tab_le_scalar_float); class_addlist(tab_le_scalar_class, (t_method)tab_le_scalar_list); class_addmethod(tab_le_scalar_class, (t_method)tab_le_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_le_scalar_class, (t_method)tab_le_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_le_scalar_class, (t_method)tab_le_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_le_scalar_class, gensym("iemhelp2/tab_le_scalar-help")); } iem_tab/src/tab_rfft.c0000644000175000017500000002663411660756044015456 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_rfft ------------------------------ */ /* real time domain FFT to complex spectral domain */ typedef struct _tab_rfft { t_object x_obj; int x_size_src1; int x_size_dst_re; int x_size_dst_im; int x_offset_src1; int x_offset_dst_re; int x_offset_dst_im; int x_fftsize; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst_re; iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src1; t_symbol *x_sym_dst_re; t_symbol *x_sym_dst_im; } t_tab_rfft; static t_class *tab_rfft_class; static void tab_rfft_init(t_tab_rfft *x) { int i, fftsize = x->x_fftsize; t_float f, g; TAB_COMPLEX *sincos = x->x_sin_cos; g = 2.0 * 3.141592653589793 / (t_float)fftsize; for(i=0; ix_fftsize) { x->x_sin_cos = (TAB_COMPLEX *)resizebytes(x->x_sin_cos, x->x_fftsize*sizeof(TAB_COMPLEX), i*sizeof(TAB_COMPLEX)); x->x_fftsize = i; } tab_rfft_init(x); } static void tab_rfft_src(t_tab_rfft *x, t_symbol *s) { x->x_sym_src1 = s; } static void tab_rfft_dst_re(t_tab_rfft *x, t_symbol *s) { x->x_sym_dst_re = s; } static void tab_rfft_dst_im(t_tab_rfft *x, t_symbol *s) { x->x_sym_dst_im = s; } static void tab_rfft_bang(t_tab_rfft *x) { int i, j, k; int ok_src, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im; ok_src = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_src1, &x->x_beg_mem_src1, &x->x_size_src1, fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, fftsize); if(ok_src && ok_dst_re && ok_dst_im) { t_garray *a; vec_src=x->x_beg_mem_src1; vec_dst_re=x->x_beg_mem_dst_re; vec_dst_im=x->x_beg_mem_dst_im; for(k=0; k>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ iemarray_setfloat(vec_dst_im, 0, 0.0); iemarray_setfloat(vec_dst_im, fs2, 0.0); for(i = fs2+1; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, 0.0); iemarray_setfloat(vec_dst_im, i, 0.0); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } static void tab_rfft_list(t_tab_rfft *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst_re, beg_dst_im; int i, j, k; int ok_src, ok_dst_re, ok_dst_im; int w_index, w_inc, i_inc, v_index; int fftsize = x->x_fftsize; int fs1 = fftsize - 1; int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; iemarray_t *vec_src, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst_re = (int)atom_getintarg(1, argc, argv); beg_dst_im = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst_re < 0) beg_dst_re = 0; if(beg_dst_im < 0) beg_dst_im = 0; ok_src = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_src1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+fftsize); ok_dst_re = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, beg_dst_re+fftsize); ok_dst_im = iem_tab_check_arrays(gensym("tab_rfft"), x->x_sym_dst_im, &x->x_beg_mem_dst_im, &x->x_size_dst_im, beg_dst_im+fftsize); if(ok_src && ok_dst_re && ok_dst_im) { t_garray *a; vec_src=x->x_beg_mem_src1 + beg_src; vec_dst_re=x->x_beg_mem_dst_re + beg_dst_re; vec_dst_im=x->x_beg_mem_dst_im + beg_dst_im; for(k=0; k>= 1; } j = 0; for(i=1;i>= 1; } j = j + k; if(i < j) { old1_re = iemarray_getfloat(vec_dst_re, j); old1_im = iemarray_getfloat(vec_dst_im, j); iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); iemarray_setfloat(vec_dst_re, i, old1_re); iemarray_setfloat(vec_dst_im, i, old1_im); } } // g = 2.0f / (t_float)fftsize; /* ein fehler tritt auf beim 0.sample, hier sollte nur mal 1.0 multipliziert werden wenn gelten soll : Energie im zeitfenster == Energie im Frequenz-dichte-fenster g = 1.0f; for(i = 0; i < fs2; i++) { vec_dst_re[i] *= g; vec_dst_im[i] *= g; } */ iemarray_setfloat(vec_dst_im, 0, 0.0); iemarray_setfloat(vec_dst_im, fs2, 0.0); for(i = fs2+1; i < fftsize; i++) { iemarray_setfloat(vec_dst_re, i, 0.0); iemarray_setfloat(vec_dst_im, i, 0.0); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); garray_redraw(a); a = (t_garray *)pd_findbyclass(x->x_sym_dst_im, garray_class); garray_redraw(a); } } else { post("tab_rfft-ERROR: list need 3 float arguments:"); post(" source_offset + destination_real_offset + destination_imag_offset"); } } static void tab_rfft_free(t_tab_rfft *x) { freebytes(x->x_sin_cos, x->x_fftsize * sizeof(TAB_COMPLEX)); } static void *tab_rfft_new(t_symbol *s, int argc, t_atom *argv) { t_tab_rfft *x = (t_tab_rfft *)pd_new(tab_rfft_class); t_symbol *src, *dst_re, *dst_im; int fftsize, i=1; if((argc >= 4) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2) && IS_A_FLOAT(argv,3)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst_re = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst_im = (t_symbol *)atom_getsymbolarg(2, argc, argv); fftsize = (int)atom_getintarg(3, argc, argv); } else { post("tab_rfft-ERROR: need 3 symbols + 1 float arguments:"); post(" source_array_name + destination_real_array_name + destination_imag_array_name + FFT-size"); return(0); } if(fftsize < 8) fftsize = 8; while(i <= fftsize) i *= 2; i /= 2; fftsize = i; x->x_fftsize = fftsize; x->x_sym_src1 = src; x->x_sym_dst_re = dst_re; x->x_sym_dst_im = dst_im; x->x_sin_cos = (TAB_COMPLEX *)getbytes(x->x_fftsize * sizeof(TAB_COMPLEX)); tab_rfft_init(x); outlet_new(&x->x_obj, &s_bang); return(x); } void tab_rfft_setup(void) { tab_rfft_class = class_new(gensym("tab_rfft"), (t_newmethod)tab_rfft_new, (t_method)tab_rfft_free, sizeof(t_tab_rfft), 0, A_GIMME, 0); class_addbang(tab_rfft_class, (t_method)tab_rfft_bang); class_addlist(tab_rfft_class, (t_method)tab_rfft_list); class_addmethod(tab_rfft_class, (t_method)tab_rfft_fftsize, gensym("fftsize"), A_DEFFLOAT, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_dst_re, gensym("dst_re"), A_DEFSYMBOL, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_dst_im, gensym("dst_im"), A_DEFSYMBOL, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_dst_re, gensym("dst1"), A_DEFSYMBOL, 0); class_addmethod(tab_rfft_class, (t_method)tab_rfft_dst_im, gensym("dst2"), A_DEFSYMBOL, 0); } iem_tab/src/tab_le.c0000644000175000017500000001314011141231101015051 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_le ------------------------------ */ /* if(x_beg_mem_src1[i] <= x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_le { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_le; static t_class *tab_le_class; static void tab_le_src1(t_tab_le *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_le_src2(t_tab_le *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_le_dst(t_tab_le *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_le_bang(t_tab_le *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_le_list(t_tab_le *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_le-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_le_free(t_tab_le *x) { } static void *tab_le_new(t_symbol *s, int argc, t_atom *argv) { t_tab_le *x = (t_tab_le *)pd_new(tab_le_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_le-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_le_setup(void) { tab_le_class = class_new(gensym("tab_le"), (t_newmethod)tab_le_new, (t_method)tab_le_free, sizeof(t_tab_le), 0, A_GIMME, 0); class_addbang(tab_le_class, (t_method)tab_le_bang); class_addlist(tab_le_class, (t_method)tab_le_list); class_addmethod(tab_le_class, (t_method)tab_le_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_le_class, (t_method)tab_le_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_le_class, (t_method)tab_le_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_le_class, gensym("iemhelp2/tab_le-help")); } iem_tab/src/tab_gt.c0000644000175000017500000001313511141231101015067 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_gt ------------------------------ */ /* if(x_beg_mem_src1[i] > x_beg_mem_src2[i]) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] = 0.0f; */ typedef struct _tab_gt { t_object x_obj; int x_size_src1; int x_size_src2; int x_size_dst; int x_offset_src1; int x_offset_src2; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_src2; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; } t_tab_gt; static t_class *tab_gt_class; static void tab_gt_src1(t_tab_gt *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_gt_src2(t_tab_gt *x, t_symbol *s) { x->x_sym_scr2 = s; } static void tab_gt_dst(t_tab_gt *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_gt_bang(t_tab_gt *x) { int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); ok_dst = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_src2 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; if(x->x_size_src2 < n) n = x->x_size_src2; vec_src1 = x->x_beg_mem_src1; vec_src2 = x->x_beg_mem_src2; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; i iemarray_getfloat(vec_src2, i)) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_gt_list(t_tab_gt *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; iemarray_t *vec_src1, *vec_src2, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_src2 = (int)atom_getintarg(1, argc, argv); beg_dst = (int)atom_getintarg(2, argc, argv); n = (int)atom_getintarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_src2 < 0) beg_src2 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_src2 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, beg_src2+n); ok_dst = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_src2 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_src2 = x->x_beg_mem_src2 + beg_src2; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; i iemarray_getfloat(vec_src2, i)) iemarray_setfloat(vec_dst, i, 1.0f); else iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_gt-ERROR: list need 4 float arguments:"); post(" source1_offset + source2_offset + destination_offset + number_of_samples_to_compare"); } } static void tab_gt_free(t_tab_gt *x) { } static void *tab_gt_new(t_symbol *s, int argc, t_atom *argv) { t_tab_gt *x = (t_tab_gt *)pd_new(tab_gt_class); t_symbol *src1, *src2, *dst; if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); } else if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else { post("tab_gt-ERROR: need 3 symbols arguments:"); post(" source1_array_name + source2_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_scr2 = src2; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_gt_setup(void) { tab_gt_class = class_new(gensym("tab_gt"), (t_newmethod)tab_gt_new, (t_method)tab_gt_free, sizeof(t_tab_gt), 0, A_GIMME, 0); class_addbang(tab_gt_class, (t_method)tab_gt_bang); class_addlist(tab_gt_class, (t_method)tab_gt_list); class_addmethod(tab_gt_class, (t_method)tab_gt_src1, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_gt_class, (t_method)tab_gt_src2, gensym("src2"), A_DEFSYMBOL, 0); class_addmethod(tab_gt_class, (t_method)tab_gt_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_gt_class, gensym("iemhelp2/tab_gt-help")); } iem_tab/src/tab_counter.c0000644000175000017500000001314411141231101016134 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_counter ------------------------------ */ /* for(i=0; ix_sym_scr1 = s; } static void tab_counter_bang(t_tab_counter *x) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_counter_dst(t_tab_counter *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_counter_list(t_tab_counter *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_counter-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_add + add_scalar"); } } static void tab_counter_reset(t_tab_counter *x) { int beg_dst; int i, n; int ok_dst; iemarray_t *vec_dst; ok_dst = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_dst) { n = x->x_size_dst; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_counter_free(t_tab_counter *x) { } static void *tab_counter_new(t_symbol *s, int argc, t_atom *argv) { t_tab_counter *x = (t_tab_counter *)pd_new(tab_counter_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_counter-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_counter_setup(void) { tab_counter_class = class_new(gensym("tab_counter"), (t_newmethod)tab_counter_new, (t_method)tab_counter_free, sizeof(t_tab_counter), 0, A_GIMME, 0); class_addbang(tab_counter_class, (t_method)tab_counter_bang); class_addlist(tab_counter_class, (t_method)tab_counter_list); class_addmethod(tab_counter_class, (t_method)tab_counter_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_counter_class, (t_method)tab_counter_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_counter_class, (t_method)tab_counter_dst, gensym("dst"), A_DEFSYMBOL, 0); class_addmethod(tab_counter_class, (t_method)tab_counter_reset, gensym("reset"), 0); // class_sethelpsymbol(tab_counter_class, gensym("iemhelp2/tab_counter-help")); } iem_tab/src/tab_mul_scalar.c0000644000175000017500000001130711203010664016606 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_mul_scalar ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i]*m */ typedef struct _tab_mul_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_mul_scalar; static t_class *tab_mul_scalar_class; static void tab_mul_scalar_src(t_tab_mul_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_mul_scalar_float(t_tab_mul_scalar *x, t_floatarg m) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_mul_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_mul_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_mul_scalar_dst(t_tab_mul_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_mul_scalar_list(t_tab_mul_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float m; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); m = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_mul_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_mul_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_mul_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_mul + mul_scalar"); } } static void tab_mul_scalar_free(t_tab_mul_scalar *x) { } static void *tab_mul_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_mul_scalar *x = (t_tab_mul_scalar *)pd_new(tab_mul_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_mul_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_mul_scalar_setup(void) { tab_mul_scalar_class = class_new(gensym("tab_mul_scalar"), (t_newmethod)tab_mul_scalar_new, (t_method)tab_mul_scalar_free, sizeof(t_tab_mul_scalar), 0, A_GIMME, 0); class_addfloat(tab_mul_scalar_class, (t_method)tab_mul_scalar_float); class_addlist(tab_mul_scalar_class, (t_method)tab_mul_scalar_list); class_addmethod(tab_mul_scalar_class, (t_method)tab_mul_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_mul_scalar_class, (t_method)tab_mul_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_mul_scalar_class, (t_method)tab_mul_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_mul_scalar_class, gensym("iemhelp2/tab_mul_scalar-help")); } iem_tab/src/VC6/0000755000175000017500000000000012527356720014106 5ustar zmoelnigzmoelnigiem_tab/src/VC6/iem_tab.dsp0000644000175000017500000000474511603066337016224 0ustar zmoelnigzmoelnig# Microsoft Developer Studio Project File - Name="iem_tab" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) External Target" 0x0106 CFG=iem_tab - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "iem_tab.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "iem_tab.mak" CFG="iem_tab - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "iem_tab - Win32 Release" (basierend auf "Win32 (x86) External Target") !MESSAGE "iem_tab - Win32 Debug" (basierend auf "Win32 (x86) External Target") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "iem_tab - Win32 Release" # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_tab.exe" # PROP Bsc_Name "iem_tab.bsc" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "iem_tab - Win32 Debug" # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_tab.exe" # PROP Bsc_Name "iem_tab.bsc" # PROP Target_Dir "" !ENDIF # Begin Target # Name "iem_tab - Win32 Release" # Name "iem_tab - Win32 Debug" !IF "$(CFG)" == "iem_tab - Win32 Release" !ELSEIF "$(CFG)" == "iem_tab - Win32 Debug" !ENDIF # Begin Source File SOURCE=.\makefile_win # End Source File # End Target # End Project iem_tab/src/VC6/makefile_win0000644000175000017500000000305111603066337016456 0ustar zmoelnigzmoelnig all: ..\iem_tab.dll VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio\Vc98" PD_INST_PATH = "C:\Programme\pd" PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -DPA_LITTLE_ENDIAN PD_WIN_L_FLAGS = /nologo PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NODEFAULTLIB:uuid \ $(VIS_CPP_PATH)\lib\libc.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_CPP_PATH)\lib\kernel32.lib \ $(VIS_CPP_PATH)\lib\wsock32.lib \ $(VIS_CPP_PATH)\lib\winmm.lib \ $(PD_INST_PATH)\bin\pd.lib SRC = tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c OBJ = $(SRC:.c=.obj) .c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c ..\iem_tab.dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:iem_tab_setup \ /out:..\iem_tab.dll $(OBJ) $(PD_WIN_LIB) clean: del *.obj iem_tab/src/VC6/iem_tab.dsw0000644000175000017500000000106511603066337016223 0ustar zmoelnigzmoelnigMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "iem_tab"=.\iem_tab.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### iem_tab/src/tab_sum.c0000644000175000017500000000630711141231101015264 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_sum ------------------------------ */ /* sum = 0.0f; */ /* for(i=0; ix_sym_scr1 = s; } static void tab_sum_bang(t_tab_sum *x) { int i, n; int ok_src; iemarray_t *vec_src; t_float sum=0.0f; ok_src = iem_tab_check_arrays(gensym("tab_sum"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; vec_src = x->x_beg_mem_src1; if(n) { for(i=0; ix_sum_out, sum); outlet_bang(x->x_bang_out); } } } static void tab_sum_list(t_tab_sum *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src; iemarray_t *vec_src; t_float sum=0.0f; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_sum"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; ix_sum_out, sum); outlet_bang(x->x_bang_out); } } } else { post("tab_sum-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_sum-value"); } } static void tab_sum_free(t_tab_sum *x) { } static void *tab_sum_new(t_symbol *s, int argc, t_atom *argv) { t_tab_sum *x = (t_tab_sum *)pd_new(tab_sum_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_sum-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_sym_scr1 = src; x->x_bang_out = outlet_new(&x->x_obj, &s_bang); x->x_sum_out = outlet_new(&x->x_obj, &s_float); return(x); } void tab_sum_setup(void) { tab_sum_class = class_new(gensym("tab_sum"), (t_newmethod)tab_sum_new, (t_method)tab_sum_free, sizeof(t_tab_sum), 0, A_GIMME, 0); class_addbang(tab_sum_class, (t_method)tab_sum_bang); class_addlist(tab_sum_class, (t_method)tab_sum_list); class_addmethod(tab_sum_class, (t_method)tab_sum_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_sum_class, (t_method)tab_sum_src, gensym("src1"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_sum_class, gensym("iemhelp2/tab_sum-help")); } iem_tab/src/makefile_d_fat0000644000175000017500000000265711660761146016356 0ustar zmoelnigzmoelnigcurrent: all .SUFFIXES: .d_fat PD_INSTALL_PATH = "/Applications/Pd.app/Contents/Resources" INCLUDE = -I. -I$(PD_INSTALL_PATH)/src CFLAGS =-DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch LFLAGS = -bundle -undefined suppress -flat_namespace # the sources SRC = \ tab_abs.c \ tab_add.c \ tab_add_scalar.c \ tab_carth2polar.c \ tab_complex_inv.c \ tab_complex_mul.c \ tab_const.c \ tab_conv.c \ tab_copy.c \ tab_counter.c \ tab_cross_corr.c \ tab_dbtopow.c \ tab_dbtorms.c \ tab_div.c \ tab_eq.c \ tab_eq_scalar.c \ tab_fft.c \ tab_find_exact_peaks.c \ tab_find_peaks.c \ tab_ge.c \ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \ tab_lt.c \ tab_lt_scalar.c \ tab_max_index.c \ tab_min_index.c \ tab_min_max.c \ tab_mul.c \ tab_mul_scalar.c \ tab_ne.c \ tab_ne_scalar.c \ tab_powtodb.c \ tab_reverse.c \ tab_rfft.c \ tab_rifft.c \ tab_rmstodb.c \ tab_sqrt.c \ tab_sub.c \ tab_sum.c \ iem_tab.c TARGET = iem_tab.d_fat OBJ = $(SRC:.c=.o) # # ------------------ targets ------------------------------------ # clean: rm ../$(TARGET) rm *.o all: $(OBJ) @echo :: $(OBJ) $(CC) -arch i386 -arch ppc $(LFLAGS) -o $(TARGET) *.o strip -S -x $(TARGET) mv $(TARGET) .. $(OBJ) : %.o : %.c touch $*.c $(CC) -arch i386 -arch ppc $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c iem_tab/src/tab_abs.c0000644000175000017500000001046311141231101015223 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" #include /* -------------------------- tab_abs ------------------------------ */ /* x_beg_mem_dst[i] = abs(x_beg_mem_src1[i]) */ typedef struct _tab_abs { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_abs; static t_class *tab_abs_class; static void tab_abs_src(t_tab_abs *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_abs_dst(t_tab_abs *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_abs_bang(t_tab_abs *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_abs_list(t_tab_abs *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_abs-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_abs"); } } static void tab_abs_free(t_tab_abs *x) { } static void *tab_abs_new(t_symbol *s, int argc, t_atom *argv) { t_tab_abs *x = (t_tab_abs *)pd_new(tab_abs_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_abs-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_abs_setup(void) { tab_abs_class = class_new(gensym("tab_abs"), (t_newmethod)tab_abs_new, (t_method)tab_abs_free, sizeof(t_tab_abs), 0, A_GIMME, 0); class_addbang(tab_abs_class, (t_method)tab_abs_bang); class_addlist(tab_abs_class, (t_method)tab_abs_list); class_addmethod(tab_abs_class, (t_method)tab_abs_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_abs_class, (t_method)tab_abs_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_abs_class, (t_method)tab_abs_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_abs_class, gensym("iemhelp2/tab_abs-help")); } iem_tab/src/tab_lt_scalar.c0000644000175000017500000001177311141231101016427 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_lt_scalar ------------------------------ */ /* if(x_beg_mem_src1[i] < compare) */ /* x_beg_mem_dst[i] = 1.0f; */ /* else */ /* x_beg_mem_dst[i] += 0.0f; */ typedef struct _tab_lt_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_lt_scalar; static t_class *tab_lt_scalar_class; static void tab_lt_scalar_src(t_tab_lt_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_lt_scalar_float(t_tab_lt_scalar *x, t_floatarg compare) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_lt_scalar_dst(t_tab_lt_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_lt_scalar_list(t_tab_lt_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; t_float compare; iemarray_t *vec_src1, *vec_dst; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); compare = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_lt_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_compare + compare_scalar"); } } static void tab_lt_scalar_free(t_tab_lt_scalar *x) { } static void *tab_lt_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_lt_scalar *x = (t_tab_lt_scalar *)pd_new(tab_lt_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_lt_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_lt_scalar_setup(void) { tab_lt_scalar_class = class_new(gensym("tab_lt_scalar"), (t_newmethod)tab_lt_scalar_new, (t_method)tab_lt_scalar_free, sizeof(t_tab_lt_scalar), 0, A_GIMME, 0); class_addfloat(tab_lt_scalar_class, (t_method)tab_lt_scalar_float); class_addlist(tab_lt_scalar_class, (t_method)tab_lt_scalar_list); class_addmethod(tab_lt_scalar_class, (t_method)tab_lt_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_lt_scalar_class, (t_method)tab_lt_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_lt_scalar_class, (t_method)tab_lt_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_lt_scalar_class, gensym("iemhelp2/tab_lt_scalar-help")); } iem_tab/src/tab_copy.c0000644000175000017500000001046211141231101015427 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i] */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_copy ------------------------------ */ typedef struct _tab_copy { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_copy; static t_class *tab_copy_class; static void tab_copy_src(t_tab_copy *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_copy_dst(t_tab_copy *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_copy_bang(t_tab_copy *x) { int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; ok_src = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_copy_list(t_tab_copy *x, t_symbol *s, int argc, t_atom *argv) { int beg_src, beg_dst; int i, n; int ok_src, ok_dst; iemarray_t *vec_src, *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_src = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); if(beg_src < 0) beg_src = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); ok_dst = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src && ok_dst) { vec_src = x->x_beg_mem_src1 + beg_src; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_copy-ERROR: list need 3 float arguments:"); post(" source_offset + destination_offset + number_of_samples_to_copy"); } } static void tab_copy_free(t_tab_copy *x) { } static void *tab_copy_new(t_symbol *s, int argc, t_atom *argv) { t_tab_copy *x = (t_tab_copy *)pd_new(tab_copy_class); t_symbol *src, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src; } else { post("tab_copy-ERROR: need 2 symbols arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_copy_setup(void) { tab_copy_class = class_new(gensym("tab_copy"), (t_newmethod)tab_copy_new, (t_method)tab_copy_free, sizeof(t_tab_copy), 0, A_GIMME, 0); class_addbang(tab_copy_class, (t_method)tab_copy_bang); class_addlist(tab_copy_class, (t_method)tab_copy_list); class_addmethod(tab_copy_class, (t_method)tab_copy_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_copy_class, (t_method)tab_copy_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_copy_class, (t_method)tab_copy_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_copy_class, gensym("iemhelp2/tab_copy-help")); } iem_tab/src/tab_mls.c0000644000175000017500000001156311141231101015253 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_mls ------------------------------ */ typedef struct _tab_mls { t_object x_obj; int x_size_dst; int x_offset_dst; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_dst; } t_tab_mls; static t_class *tab_mls_class; static int tab_mls_exp2(int mls_order) { int i, j=1; for(i=0; i> 1; exor = 0; for(j=0; j>= 1; } if(exor & 1) { iemarray_setfloat(vec, i, 1.0f); work1 = work2 | source; } else { iemarray_setfloat(vec, i, -1.0f); work1 = work2; } } return; } static void tab_mls_dst(t_tab_mls *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_mls_float(t_tab_mls *x, t_floatarg fmls_order) { int mls_order=(int)fmls_order; int ok_dst, mls_size; mls_size = tab_mls_exp2(mls_order) - 1; ok_dst = iem_tab_check_arrays(gensym("tab_mls"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, mls_size); if(ok_dst) { if((mls_order >= 3) && (mls_order <= 20)) { t_garray *a; tab_mls_calc(x->x_beg_mem_dst, mls_order); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_mls_list(t_tab_mls *x, t_symbol *s, int argc, t_atom *argv) { int beg_dst; int i, n; int ok_dst; t_float c; iemarray_t *vec_dst; if((argc >= 3) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2)) { beg_dst = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); c = (t_float)atom_getfloatarg(2, argc, argv); if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_dst = iem_tab_check_arrays(gensym("tab_mls"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_dst) { vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_mls-ERROR: list need 3 float arguments:"); post(" destination_offset + number_of_samples_to_copy + constant-value"); } } static void tab_mls_free(t_tab_mls *x) { } static void *tab_mls_new(t_symbol *s, int argc, t_atom *argv) { t_tab_mls *x = (t_tab_mls *)pd_new(tab_mls_class); t_symbol *dst; t_float time; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { dst = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_mls-ERROR: need 1 symbol argument:"); post(" destination_array_name"); return(0); } x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_mls_setup(void) { tab_mls_class = class_new(gensym("tab_mls"), (t_newmethod)tab_mls_new, (t_method)tab_mls_free, sizeof(t_tab_mls), 0, A_GIMME, 0); class_addfloat(tab_mls_class, (t_method)tab_mls_float); class_addlist(tab_mls_class, (t_method)tab_mls_list); class_addmethod(tab_mls_class, (t_method)tab_mls_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_mls_class, gensym("iemhelp2/tab_mls-help")); } iem_tab/src/iem_tab.c0000644000175000017500000000723511660755610015261 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2011 */ #include "m_pd.h" #include "iemlib.h" int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, iemarray_t **beg_mem, int *array_size, int max_index) { int ok=1; t_garray *a; if(!(a = (t_garray *)pd_findbyclass(array_name, garray_class))) { error("%s: no such array", array_name->s_name); ok = 0; } else if(!iemarray_getarray(a, array_size, beg_mem)) { error("%s: bad template for %s", array_name->s_name, obj_name->s_name); ok = 0; } else if(*array_size < max_index) { error("%s: bad array-size: %d", array_name->s_name, *array_size); ok = 0; } return(ok); } // Georg Holzmann: #ifdef IEMTAB_SINGLE_OBJ // for single externals disable the iem_tab object #else // build as library static t_class *iem_tab_class; static void *iem_tab_new(void) { t_object *x = (t_object *)pd_new(iem_tab_class); return (x); } void tab_abs_setup(void); void tab_add_setup(void); void tab_add_scalar_setup(void); void tab_carth2polar_setup(void); void tab_complex_inv_setup(void); void tab_complex_mul_setup(void); void tab_const_setup(void); void tab_conv_setup(void); void tab_copy_setup(void); void tab_counter_setup(void); void tab_cross_corr_setup(void); void tab_dbtopow_setup(void); void tab_dbtorms_setup(void); void tab_div_setup(void); void tab_eq_setup(void); void tab_eq_scalar_setup(void); void tab_fft_setup(void); void tab_find_exact_peaks_setup(void); void tab_find_peaks_setup(void); void tab_ge_setup(void); void tab_ge_scalar_setup(void); void tab_get_size_setup(void); void tab_gt_setup(void); void tab_gt_scalar_setup(void); void tab_ifft_setup(void); void tab_le_setup(void); void tab_le_scalar_setup(void); void tab_lt_setup(void); void tab_lt_scalar_setup(void); void tab_max_index_setup(void); void tab_min_index_setup(void); void tab_min_max_setup(void); void tab_mul_setup(void); void tab_mul_scalar_setup(void); void tab_ne_setup(void); void tab_ne_scalar_setup(void); void tab_powtodb_setup(void); void tab_reverse_setup(void); void tab_rfft_setup(void); void tab_rifft_setup(void); void tab_rmstodb_setup(void); void tab_sqrt_setup(void); void tab_sub_setup(void); void tab_sum_setup(void); /* ------------------------ setup routine ------------------------- */ void iem_tab_setup(void) { iem_tab_class = class_new(gensym("iem_tab"), iem_tab_new, 0, sizeof(t_object), CLASS_NOINLET, 0); tab_abs_setup(); tab_add_setup(); tab_add_scalar_setup(); tab_carth2polar_setup(); tab_complex_inv_setup(); tab_complex_mul_setup(); tab_const_setup(); tab_conv_setup(); tab_copy_setup(); tab_counter_setup(); tab_cross_corr_setup(); tab_dbtopow_setup(); tab_dbtorms_setup(); tab_div_setup(); tab_eq_setup(); tab_eq_scalar_setup(); tab_fft_setup(); tab_find_exact_peaks_setup(); tab_find_peaks_setup(); tab_ge_setup(); tab_ge_scalar_setup(); tab_gt_setup(); tab_gt_scalar_setup(); tab_get_size_setup(); tab_ifft_setup(); tab_le_setup(); tab_le_scalar_setup(); tab_lt_setup(); tab_lt_scalar_setup(); tab_max_index_setup(); tab_min_index_setup(); tab_min_max_setup(); tab_mul_setup(); tab_mul_scalar_setup(); tab_ne_setup(); tab_ne_scalar_setup(); tab_powtodb_setup(); tab_reverse_setup(); tab_rfft_setup(); tab_rifft_setup(); tab_rmstodb_setup(); tab_sqrt_setup(); tab_sub_setup(); tab_sum_setup(); post("iem_tab (R-1.20) library loaded! (c) Thomas Musil 11.2011"); post(" musil%ciem.at iem KUG Graz Austria", '@'); } #endif // library iem_tab/src/iemlib.h0000644000175000017500000000762412163234742015126 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2012 */ #ifndef __IEMLIB_H__ #define __IEMLIB_H__ #define IS_A_NULL(atom,index) ((atom+index)->a_type == A_NULL) #define IS_A_POINTER(atom,index) ((atom+index)->a_type == A_POINTER) #define IS_A_FLOAT(atom,index) ((atom+index)->a_type == A_FLOAT) #define IS_A_SYMBOL(atom,index) ((atom+index)->a_type == A_SYMBOL) #define IS_A_DOLLAR(atom,index) ((atom+index)->a_type == A_DOLLAR) #define IS_A_DOLLSYM(atom,index) ((atom+index)->a_type == A_DOLLSYM) #define IS_A_SEMI(atom,index) ((atom+index)->a_type == A_SEMI) #define IS_A_COMMA(atom,index) ((atom+index)->a_type == A_COMMA) #define SETNULL(atom) ((atom)->a_type = A_NULL) /* now miller's code starts : for 4 point interpolation for lookup tables for denormal floats */ #ifdef MSW int sys_noloadbang; //t_symbol *iemgui_key_sym=0; #include #else extern int sys_noloadbang; //extern t_symbol *iemgui_key_sym; #include #endif #define DEFDELVS 64 #define XTRASAMPS 4 #define SAMPBLK 4 #define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */ /* machine-dependent definitions. These ifdefs really should have been by CPU type and not by operating system! */ #ifdef IRIX /* big-endian. Most significant byte is at low address in memory */ #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */ #ifdef MSW /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 #define int32 long #endif /* MSW */ #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) #include #endif #if defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(ANDROID) #include #endif #if defined(__unix__) || defined(__APPLE__) #if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) #error No byte order defined #endif #if BYTE_ORDER == LITTLE_ENDIAN #define HIOFFSET 1 #define LOWOFFSET 0 #else #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #endif /* __BYTE_ORDER */ #include #define int32 int32_t #endif /* __unix__ or __APPLE__*/ union tabfudge_d { double tf_d; int32 tf_i[2]; }; union tabfudge_f { float tf_f; long tf_l; }; #if defined __i386__ || defined __x86_64__ #define IEM_DENORMAL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */ #else #define IEM_DENORMAL(f) 0 #endif /* on 64bit systems we cannot use garray_getfloatarray... */ #if ((defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 40)) # define iemarray_t t_word # define iemarray_getarray garray_getfloatwords # define iemarray_getfloat(pointer, index) (pointer[index].w_float) # define iemarray_setfloat(pointer, index, fvalue) (pointer[index].w_float = fvalue) #else # define iemarray_t t_float # define iemarray_getarray garray_getfloatarray # define iemarray_getfloat(pointer, index) (pointer[index]) # define iemarray_setfloat(pointer, index, fvalue) (pointer[index] = fvalue) #endif #endif iem_tab/src/tab_min_max.c0000644000175000017500000000734411141231101016112 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_min_max ------------------------------ */ typedef struct _tab_min_max { t_object x_obj; int x_size_src1; int x_offset_src1; iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_min_out; void *x_max_out; } t_tab_min_max; static t_class *tab_min_max_class; static void tab_min_max_src(t_tab_min_max *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_min_max_bang(t_tab_min_max *x) { int i, n; int ok_src; iemarray_t *vec_src; t_float min=1.0e37, max=-1.0e37; ok_src = iem_tab_check_arrays(gensym("tab_min_max"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); if(ok_src) { n = x->x_size_src1; vec_src = x->x_beg_mem_src1; if(n) { for(i=0; i max) max = iemarray_getfloat(vec_src, i); if(iemarray_getfloat(vec_src, i) < min) min = iemarray_getfloat(vec_src, i); } outlet_float(x->x_max_out, max); outlet_float(x->x_min_out, min); outlet_bang(x->x_bang_out); } } } static void tab_min_max_list(t_tab_min_max *x, t_symbol *s, int argc, t_atom *argv) { int beg_src; int i, n; int ok_src; iemarray_t *vec_src; t_float min=1.0e37, max=-1.0e37; if((argc >= 2) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1)) { beg_src = (int)atom_getintarg(0, argc, argv); n = (int)atom_getintarg(1, argc, argv); if(beg_src < 0) beg_src = 0; if(n < 0) n = 0; ok_src = iem_tab_check_arrays(gensym("tab_min_max"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src+n); if(ok_src) { vec_src = x->x_beg_mem_src1 + beg_src; if(n) { for(i=0; i max) max = iemarray_getfloat(vec_src, i); if(iemarray_getfloat(vec_src, i) < min) min = iemarray_getfloat(vec_src, i); } outlet_float(x->x_max_out, max); outlet_float(x->x_min_out, min); outlet_bang(x->x_bang_out); } } } else { post("tab_min_max-ERROR: list need 2 float arguments:"); post(" source_offset + number_of_samples_to_calc_min_max"); } } static void tab_min_max_free(t_tab_min_max *x) { } static void *tab_min_max_new(t_symbol *s, int argc, t_atom *argv) { t_tab_min_max *x = (t_tab_min_max *)pd_new(tab_min_max_class); t_symbol *src; if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src = (t_symbol *)atom_getsymbolarg(0, argc, argv); } else { post("tab_min_max-ERROR: need 1 symbol argument:"); post(" source_array_name"); return(0); } x->x_sym_scr1 = src; x->x_bang_out = outlet_new(&x->x_obj, &s_bang); x->x_min_out = outlet_new(&x->x_obj, &s_float); x->x_max_out = outlet_new(&x->x_obj, &s_float); return(x); } void tab_min_max_setup(void) { tab_min_max_class = class_new(gensym("tab_min_max"), (t_newmethod)tab_min_max_new, (t_method)tab_min_max_free, sizeof(t_tab_min_max), 0, A_GIMME, 0); class_addbang(tab_min_max_class, (t_method)tab_min_max_bang); class_addlist(tab_min_max_class, (t_method)tab_min_max_list); class_addmethod(tab_min_max_class, (t_method)tab_min_max_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_min_max_class, (t_method)tab_min_max_src, gensym("src1"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_min_max_class, gensym("iemhelp2/tab_min_max-help")); } iem_tab/src/tab_add_scalar.c0000644000175000017500000001133011203010664016535 0ustar zmoelnigzmoelnig/* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ #include "m_pd.h" #include "iemlib.h" #include "iem_tab.h" /* -------------------------- tab_add_scalar ------------------------------ */ /* x_beg_mem_dst[i] = x_beg_mem_src1[i] + add */ typedef struct _tab_add_scalar { t_object x_obj; int x_size_src1; int x_size_dst; int x_offset_src1; int x_offset_dst; iemarray_t *x_beg_mem_src1; iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_add_scalar; static t_class *tab_add_scalar_class; static void tab_add_scalar_src(t_tab_add_scalar *x, t_symbol *s) { x->x_sym_scr1 = s; } static void tab_add_scalar_float(t_tab_add_scalar *x, t_floatarg add) { int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; ok_src1 = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); if(ok_src1 && ok_dst) { if(x->x_size_src1 < x->x_size_dst) n = x->x_size_src1; else n = x->x_size_dst; vec_src1 = x->x_beg_mem_src1; vec_dst = x->x_beg_mem_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } static void tab_add_scalar_dst(t_tab_add_scalar *x, t_symbol *s) { x->x_sym_dst = s; } static void tab_add_scalar_list(t_tab_add_scalar *x, t_symbol *s, int argc, t_atom *argv) { int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; iemarray_t *vec_src1, *vec_dst; t_float add; if((argc >= 4) && IS_A_FLOAT(argv,0) && IS_A_FLOAT(argv,1) && IS_A_FLOAT(argv,2) && IS_A_FLOAT(argv,3)) { beg_src1 = (int)atom_getintarg(0, argc, argv); beg_dst = (int)atom_getintarg(1, argc, argv); n = (int)atom_getintarg(2, argc, argv); add = (t_float)atom_getfloatarg(3, argc, argv); if(beg_src1 < 0) beg_src1 = 0; if(beg_dst < 0) beg_dst = 0; if(n < 0) n = 0; ok_src1 = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, beg_src1+n); ok_dst = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, beg_dst+n); if(ok_src1 && ok_dst) { vec_src1 = x->x_beg_mem_src1 + beg_src1; vec_dst = x->x_beg_mem_dst + beg_dst; if(n) { t_garray *a; for(i=0; ix_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); } } } else { post("tab_add_scalar-ERROR: list need 4 float arguments:"); post(" source1_offset + destination_offset + number_of_samples_to_add + add_scalar"); } } static void tab_add_scalar_free(t_tab_add_scalar *x) { } static void *tab_add_scalar_new(t_symbol *s, int argc, t_atom *argv) { t_tab_add_scalar *x = (t_tab_add_scalar *)pd_new(tab_add_scalar_class); t_symbol *src1, *dst; if((argc >= 2) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = (t_symbol *)atom_getsymbolarg(1, argc, argv); } else if((argc >= 1) && IS_A_SYMBOL(argv,0)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); dst = src1; } else { post("tab_add_scalar-ERROR: need 2 symbol arguments:"); post(" source_array_name + destination_array_name"); return(0); } x->x_sym_scr1 = src1; x->x_sym_dst = dst; outlet_new(&x->x_obj, &s_bang); return(x); } void tab_add_scalar_setup(void) { tab_add_scalar_class = class_new(gensym("tab_add_scalar"), (t_newmethod)tab_add_scalar_new, (t_method)tab_add_scalar_free, sizeof(t_tab_add_scalar), 0, A_GIMME, 0); class_addfloat(tab_add_scalar_class, (t_method)tab_add_scalar_float); class_addlist(tab_add_scalar_class, (t_method)tab_add_scalar_list); class_addmethod(tab_add_scalar_class, (t_method)tab_add_scalar_src, gensym("src1"), A_DEFSYMBOL, 0); class_addmethod(tab_add_scalar_class, (t_method)tab_add_scalar_src, gensym("src"), A_DEFSYMBOL, 0); class_addmethod(tab_add_scalar_class, (t_method)tab_add_scalar_dst, gensym("dst"), A_DEFSYMBOL, 0); // class_sethelpsymbol(tab_add_scalar_class, gensym("iemhelp2/tab_add_scalar-help")); }