annotate examples/MSP/test/xtract-test @ 119:75e14c9881ee

- Committed patch by Chris Cannam to avoid reading past the end of an array in peak detection routine in xtract_peak_spectrum()
author Jamie Bullock <jamie@postlude.co.uk>
date Tue, 11 Nov 2008 11:55:55 +0000
parents 85329d9583b7
children
rev   line source
jamie@81 1 max v2;
jamie@81 2 #N vpatcher 22 65 823 798;
jamie@81 3 #P origin -203 -11;
jamie@81 4 #P window setfont "Sans Serif" 9.;
jamie@81 5 #P newex 154 177 46 196617 / 1000.;
jamie@81 6 #P newex 19 349 39 196617 noise~;
jamie@81 7 #P flonum 79 206 88 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 8 #P newex 79 180 71 196617 expr log($f1);
jamie@81 9 #P message 377 385 68 196617 /braun/5 \$1;
jamie@81 10 #P message 305 385 68 196617 /braun/4 \$1;
jamie@81 11 #P message 229 385 68 196617 /braun/3 \$1;
jamie@81 12 #P message 155 386 68 196617 /braun/2 \$1;
jamie@81 13 #P flonum 657 181 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 14 #P flonum 511 176 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 15 #P flonum 426 179 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 16 #P flonum 334 180 63 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 17 #P flonum 594 180 55 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 18 #P newex 0 378 69 196617 send~ source;
jamie@81 19 #P newex 425 150 72 196617 r irregularity;
jamie@81 20 #P newex 508 151 72 196617 r fundamental;
jamie@81 21 #P newex 656 151 57 196617 r variance;
jamie@81 22 #P newex 223 151 104 196617 r standard_deviation;
jamie@81 23 #P newex 593 150 55 196617 r centroid;
jamie@81 24 #P newex 79 148 55 196617 r kurtosis;
jamie@81 25 #P newex 332 151 80 196617 r inharmonicity;
jamie@81 26 #P newex 154 151 61 196617 r skewness;
jamie@81 27 #N vpatcher 9 59 787 818;
jamie@81 28 #P window setfont "Sans Serif" 9.;
jamie@81 29 #P newex 622 460 37 196617 pack f;
jamie@81 30 #P window linecount 1;
jamie@81 31 #P newex 213 260 83 196617 receive~ source;
jamie@81 32 #P newex 213 290 35 196617 *~ 1.;
jamie@81 33 #P newex 516 261 72 196617 s irregularity;
jamie@81 34 #P newex 226 390 72 196617 s fundamental;
jamie@81 35 #P newex 557 514 57 196617 s variance;
jamie@81 36 #P newex 364 560 104 196617 s standard_deviation;
jamie@81 37 #P newex 312 444 55 196617 s centroid;
jamie@81 38 #P newex 183 688 55 196617 s kurtosis;
jamie@81 39 #P newex 70 468 80 196617 s inharmonicity;
jamie@81 40 #P newex 7 689 61 196617 s skewness;
jamie@81 41 #P newex 71 423 95 196617 receive~ spectrum;
jamie@81 42 #P message 213 426 40 196617 list \$1;
jamie@81 43 #P newex 70 445 153 196617 xtract~ spectral_inharmonicity;
jamie@81 44 #P newex 529 403 62 196617 poke~ mags;
jamie@81 45 #P newex 436 265 27 196617 / 2.;
jamie@81 46 #P newex 470 207 29 196617 * 2.;
jamie@81 47 #P newex 555 378 85 196617 count~ 0 1024 1;
jamie@81 48 #P newex 470 232 111 196617 poly~ magspec vs 512;
jamie@81 49 #P newex 7 667 134 196617 xtract~ spectral_skewness;
jamie@81 50 #P newex 7 644 95 196617 receive~ spectrum;
jamie@81 51 #P newex 408 337 44 196617 pack f f;
jamie@81 52 #P newex 183 667 128 196617 xtract~ spectral_kurtosis;
jamie@81 53 #P newex 183 644 95 196617 receive~ spectrum;
jamie@81 54 #P newex 301 559 44 196617 pack f f;
jamie@81 55 #P newex 333 513 95 196617 receive~ spectrum;
jamie@81 56 #P message 502 514 40 196617 list \$1;
jamie@81 57 #P newex 335 533 177 196617 xtract~ spectral_standard_deviation;
jamie@81 58 #P newex 502 467 95 196617 receive~ spectrum;
jamie@81 59 #P newex 442 403 81 196617 send~ spectrum;
jamie@81 60 #P newex 502 488 130 196617 xtract~ spectral_variance;
jamie@81 61 #P newex 213 360 58 196617 xtract~ f0;
jamie@81 62 #P newex 394 234 47 196617 * 1000.;
jamie@81 63 #P newex 394 212 31 196617 !/ 0.;
jamie@81 64 #P newex 324 80 27 196617 i 10;
jamie@81 65 #P newex 304 57 30 196617 t b b;
jamie@81 66 #P newex 304 35 48 196617 loadbang;
jamie@81 67 #P newex 318 169 27 196617 / 0.;
jamie@81 68 #P newex 301 326 27 196617 *~;
jamie@81 69 #P newex 318 274 46 196617 phasor~;
jamie@81 70 #P newex 318 298 87 196617 wave~ hann 0. 0.;
jamie@81 71 #P newex 304 130 54 196617 dspstate~;
jamie@81 72 #P newex 324 103 73 196617 adstatus sigvs;
jamie@81 73 #B color 5;
jamie@81 74 #P newex 301 405 128 196617 xtract~ spectral_centroid;
jamie@81 75 #P newex 301 360 117 196617 xtract~ spectrum 1024;
jamie@81 76 #P comment 406 300 109 196617 //windowing function;
jamie@81 77 #P window linecount 0;
jamie@81 78 #P comment 46 52 100 196617 //basic feature cascade;
jamie@81 79 #P comment 596 233 100 196617 //poly~ used to reduce down to half-block size to get just magnitudes;
jamie@81 80 #P comment 598 406 140 196617 //mags is inside the poly~;
jamie@81 81 #P connect 28 0 29 0;
jamie@81 82 #P connect 29 0 38 0;
jamie@81 83 #P connect 37 0 35 0;
jamie@81 84 #P connect 35 0 39 0;
jamie@81 85 #P connect 24 0 29 1;
jamie@81 86 #P connect 25 0 26 0;
jamie@81 87 #P connect 26 0 40 0;
jamie@81 88 #P connect 47 0 46 0;
jamie@81 89 #P connect 46 0 17 0;
jamie@81 90 #P connect 17 0 36 0;
jamie@81 91 #P connect 36 0 35 1;
jamie@81 92 #P connect 17 0 44 0;
jamie@81 93 #P connect 46 0 10 0;
jamie@81 94 #P connect 10 0 4 0;
jamie@81 95 #P connect 4 0 5 0;
jamie@81 96 #P connect 5 0 24 0;
jamie@81 97 #P connect 24 0 26 1;
jamie@81 98 #P connect 12 0 13 0;
jamie@81 99 #P connect 13 0 7 0;
jamie@81 100 #P connect 5 0 41 0;
jamie@81 101 #P connect 7 1 11 0;
jamie@81 102 #P connect 11 0 9 0;
jamie@81 103 #P connect 9 0 8 0;
jamie@81 104 #P connect 8 0 10 1;
jamie@81 105 #P connect 13 1 14 0;
jamie@81 106 #P connect 14 0 6 0;
jamie@81 107 #P connect 7 3 11 1;
jamie@81 108 #P connect 23 0 21 0;
jamie@81 109 #P connect 21 0 24 1;
jamie@81 110 #P connect 21 0 42 0;
jamie@81 111 #P connect 7 1 15 0;
jamie@81 112 #P connect 15 0 16 0;
jamie@81 113 #P connect 16 0 8 2;
jamie@81 114 #P connect 11 0 27 0;
jamie@81 115 #P connect 27 0 4 1;
jamie@81 116 #P connect 7 3 15 1;
jamie@81 117 #P connect 16 0 33 0;
jamie@81 118 #P connect 4 0 19 0;
jamie@81 119 #P connect 11 0 32 0;
jamie@81 120 #P connect 32 0 30 0;
jamie@81 121 #P connect 20 0 18 0;
jamie@81 122 #P connect 18 0 22 0;
jamie@81 123 #P connect 22 0 21 1;
jamie@81 124 #P connect 30 0 45 0;
jamie@81 125 #P connect 4 0 34 0;
jamie@81 126 #P connect 31 0 34 1;
jamie@81 127 #P connect 18 0 43 0;
jamie@81 128 #P connect 33 0 30 1;
jamie@81 129 #P connect 5 0 48 0;
jamie@81 130 #P connect 48 0 18 1;
jamie@81 131 #P pop;
jamie@81 132 #P newobj 594 83 37 196617 p guts;
jamie@81 133 #P newex 0 269 38 196617 * 100;
jamie@81 134 #P slider 0 116 15 128 0 1;
jamie@81 135 #P number 0 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
jamie@81 136 #P message 79 386 68 196617 /braun/1 \$1;
jamie@81 137 #P newex 79 476 120 196617 udpsend 127.0.0.1 4444;
jamie@81 138 #N vpatcher 10 59 364 406;
jamie@81 139 #P window setfont "Sans Serif" 9.;
jamie@81 140 #P newex 47 33 48 196617 loadbang;
jamie@81 141 #P window linecount 1;
jamie@81 142 #P newex 87 102 27 196617 t i i;
jamie@81 143 #P newex 87 258 43 196617 pack i f;
jamie@81 144 #P newex 87 80 27 196617 - 1;
jamie@81 145 #P newex 47 59 51 196617 Uzi 1024;
jamie@81 146 #P newex 87 283 59 196617 peek~ hann;
jamie@81 147 #P newex 120 227 38 196617 + 0.5;
jamie@81 148 #P newex 120 206 42 196617 * -0.5;
jamie@81 149 #P newex 104 126 46 196617 / 1023.;
jamie@81 150 #P newex 120 161 47 196617 * 6.283;
jamie@81 151 #P newex 120 183 23 196617 cos;
jamie@81 152 #P window linecount 0;
jamie@81 153 #P comment 182 38 100 196617 //makes a hanning window in a buffer called hann;
jamie@81 154 #P connect 11 0 7 0;
jamie@81 155 #P connect 7 2 8 0;
jamie@81 156 #P connect 8 0 10 0;
jamie@81 157 #P connect 10 0 9 0;
jamie@81 158 #P connect 9 0 6 0;
jamie@81 159 #P connect 10 1 3 0;
jamie@81 160 #P connect 3 0 2 0;
jamie@81 161 #P connect 2 0 1 0;
jamie@81 162 #P connect 1 0 4 0;
jamie@81 163 #P connect 4 0 5 0;
jamie@81 164 #P connect 5 0 9 1;
jamie@81 165 #P pop;
jamie@81 166 #P newobj 550 35 80 196617 p make_hanning;
jamie@81 167 #P newex 533 57 97 196617 buffer~ hann 23.22;
jamie@81 168 #P user ezdac~ 648 37 692 70 0;
jamie@81 169 #P newex 0 321 55 196617 saw~ 440;
jamie@81 170 #P connect 7 0 8 0;
jamie@81 171 #P connect 8 0 6 0;
jamie@81 172 #P connect 6 0 0 0;
jamie@81 173 #P connect 0 0 18 0;
jamie@81 174 #P connect 30 0 18 0;
jamie@81 175 #P connect 12 0 28 0;
jamie@81 176 #P connect 28 0 29 0;
jamie@81 177 #P connect 28 0 5 0;
jamie@81 178 #P connect 27 0 4 0;
jamie@81 179 #P connect 26 0 4 0;
jamie@81 180 #P connect 25 0 4 0;
jamie@81 181 #P connect 24 0 4 0;
jamie@81 182 #P connect 5 0 4 0;
jamie@81 183 #P connect 10 0 31 0;
jamie@81 184 #P connect 11 0 24 0;
jamie@81 185 #P connect 17 0 25 0;
jamie@81 186 #P connect 16 0 26 0;
jamie@81 187 #P connect 11 0 20 0;
jamie@81 188 #P connect 13 0 27 0;
jamie@81 189 #P connect 17 0 21 0;
jamie@81 190 #P connect 16 0 22 0;
jamie@81 191 #P connect 13 0 19 0;
jamie@81 192 #P connect 15 0 23 0;
jamie@81 193 #P pop;