Forums > MaxMSP

[Sharing is Fun] LCD Sonogram

April 13, 2008 | 9:26 pm

////////// MAIN PATCH \\\\\
#P window setfont "Sans Serif" 9.;
#P number 696 272 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user spectroscope~ 225 217 300 100 20 0 1 0 1 1 0 1 0 0 0 0;
#X frgb 224 224 224;
#X brgb 255 255 255;
#X rgb2 0 0 0;
#X rgb3 243 204 204;
#X rgb4 255 0 0;
#X rgb5 184 184 184;
#X rgb6 0 0 0;
#X rgb7 0 0 0;
#X rgb8 255 255 255;
#X rgb9 255 0 0;
#X rgb10 255 191 0;
#X rgb11 0 191 127;
#X rgb12 127 0 127;
#X rgb13 0 0 0;
#X range 0. 1.2;
#X domain 0. 22050.;
#X done;
#P window linecount 1;
#P comment 843 388 81 9109513 < < Analysis Brain;
#P message 211 51 26 9109513 0.5;
#P newex 211 23 45 9109513 loadbang;
#P user multiSlider 211 116 13 100 0. 2. 1 2681 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 702 387 140 9109513 pfft~ BF.PFFT-Analysis~ 512 2;
#P flonum 294 364 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 294 388 50 9109513 / 500.;
#P user lcd 225 116 300 100 0 1 1 0 1;
#P message 47 51 50 9109513 300 100;
#P newex 47 89 55 9109513 s $0_size;
#P newex 701 315 50 9109513 io;
#P toggle 186 363 15 0;
#P flonum 211 326 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 211 356 50 9109513 pow 4.;
#P number 294 420 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 254 447 50 9109513 metro 10;
#P newex 254 469 61 9109513 s redraw;
#P newex 225 89 50 9109513 r $0_LCD;
#N vpatcher 167 80 1070 737;
#P origin 0 7;
#P window setfont "Sans Serif" 9.;
#P newex 155 138 50 9109513 + 1;
#P message 82 112 14 9109513 0;
#P newex 305 434 27 9109513 !- 1.;
#P newex 305 391 466 9109513 * 1.;
#N comlet (float) Contrast;
#P inlet 761 39 15 0;
#P newex 305 455 59 9109513 slide 2. 2.;
#P newex 573 516 33 9109513 * 255.;
#B color 12;
#P newex 439 516 33 9109513 * 255.;
#B color 6;
#P newex 305 516 33 9109513 * 255.;
#B color 1;
#P newex 171 411 52 9109513 !- 100.;
#N counter 0 0 500;
#X flags 0 0;
#P newobj 37 450 73 9109513 counter 0 0 500;
#P newex 37 546 548 9109513 pak 0 0 0. 0. 0.;
#P message 37 579 110 9109513 setpixel $1 $2 $3 $4 $5;
#P newex 115 160 50 9109513 uzi 500;
#P newex 82 82 43 9109513 t b i;
#N comlet (int) Render On / Off;
#P inlet 57 39 17 0;
#P newex 115 112 50 9109513 gate;
#P newex 155 82 41 9109513 r redraw;
#P newex 37 608 50 9109513 s $0_LCD;
#P newex 305 370 61 9109513 peek~ deux;
#P newex 271 316 455 9109513 scale 0. 99. 0. 512. 1.1;
#P newex 171 196 27 9109513 – 1;
#P newex 97 60 126 9109513 unpack;
#P newex 97 39 126 9109513 r $0_size;
#P comment 363 570 169 9109513 Colors are HERE = Red / Green / Blue;
#P fasten 11 1 14 0 140 304 42 304;
#P lcolor 7;
#P connect 14 0 13 0;
#P connect 13 0 12 0;
#P connect 12 0 6 0;
#P connect 9 0 10 0;
#P connect 10 0 23 0;
#P connect 23 0 14 3;
#P connect 1 0 2 0;
#P connect 2 0 14 4;
#P connect 10 1 8 0;
#P connect 8 0 11 0;
#P connect 7 0 8 1;
#P connect 2 1 24 0;
#P connect 24 0 11 1;
#P connect 11 2 3 0;
#P connect 3 0 15 0;
#P connect 15 0 13 1;
#P connect 2 1 15 1;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 21 0;
#P connect 21 0 22 0;
#P connect 22 0 19 0;
#P connect 19 0 16 0;
#P connect 16 0 13 2;
#P fasten 19 0 17 0 310 495 444 495;
#P connect 17 0 13 3;
#P connect 2 1 4 2;
#P fasten 19 0 18 0 310 495 578 495;
#P connect 18 0 13 4;
#P connect 20 0 21 1;
#P pop 1;
#P newobj 186 469 35 9109513 p draw;
#P user ezdac~ 649 387 693 420 0;
#P newex 702 407 140 9109513 buffer~ deux 5.804989;
#P comment 725 352 78 9109513 Audio Input Here;
#P comment 367 364 120 9109513 "Buffer" Size (Milliseconds);
#P comment 129 363 56 9109513 Start / Stop;
#P comment 121 471 64 9109513 LCD Brain >>;
#P hidden connect 14 0 25 0;
#P connect 14 0 5 0;
#P connect 14 0 20 0;
#P connect 26 0 14 0;
#P connect 21 0 12 0;
#P fasten 22 0 16 0 216 45 52 45;
#P connect 16 0 15 0;
#P connect 13 0 6 0;
#P connect 22 0 23 0;
#P connect 23 0 21 0;
#P connect 12 0 11 0;
#P connect 11 0 6 1;
#P connect 7 0 17 0;
#P connect 13 0 9 0;
#P connect 9 0 8 0;
#P connect 19 0 18 0;
#P connect 18 0 10 0;
#P connect 10 0 9 1;
#P window clipboard copycount 27;

////////// PFFT SUBPATCH – Save as BF.PFFT-Analysis~ \\\\\

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 24 200 170 9109513 poke~ deux;
#P newex 24 22 91 9109513 fftin~ 1;
#P newex 25 106 50 9109513 cartopol~;
#P connect 1 2 2 1;
#P connect 1 1 0 1;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P window clipboard copycount 3;

————————————————————–

I share this patch because I’m stuck with the colors adding.
The monochrome mode works… A lot of tweekings can be achieve but my main problem is now the colors, I have no idea on how to do this.

I tried to change colors independently, with different exponential coefficient but without significant results. Maybe a combination of [split]…

Thanks in advance for any help.


April 13, 2008 | 10:22 pm

Colorful, with subsampling:

— Subpatch 1: spectr-fftsub —

max v2;
#N vpatcher 1120 504 1426 923;
#P window setfont "Sans Serif" 9.;
#P newex 65 165 35 196617 sqrt~;
#P comment 25 55 238 196617 Buffer = $1;
#P comment 25 43 238 196617 FFT size = implicit;
#P window setfont "Sans Serif" 12.;
#P comment 25 26 238 196620 Spectrum analysis , pfft~ subpatch;
#P user panel 11 21 268 68;
#X brgb 245 167 85;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P newex 65 280 41 196617 *~ 1.;
#P newex 96 253 36 196617 !- 1.;
#N in 2;
#P newobj 164 221 25 196617 in 2;
#P newex 65 320 92 196617 +~;
#P newex 147 281 41 196617 *~ 0.;
#P newex 147 167 84 196617 index~ $1;
#P newex 65 367 159 196617 poke~ $1;
#P newex 65 133 51 196617 cartopol~;
#P newex 65 100 92 196617 fftin~ 1 hamming;
#P comment 163 208 59 196617 integration;
#P connect 1 0 2 0;
#P connect 2 0 14 0;
#P connect 14 0 9 0;
#P connect 9 0 6 0;
#P connect 6 0 3 0;
#P fasten 7 0 8 0 169 245 101 245;
#P connect 8 0 9 1;
#P connect 1 1 2 1;
#P fasten 1 2 3 1 152 142 247 142 247 347 144 347;
#P connect 1 2 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 1;
#P fasten 7 0 5 1 169 245 183 245;
#P pop;

— Subpatch 1: spectr-down —

max v2;
#N vpatcher 814 504 1119 774;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 98 115 44 196617 overlap;
#N in 2;
#P newobj 109 130 25 196617 in 2;
#P objectname IN2[1];
#N thispatcher;
#Q end;
#P newobj 109 191 61 196617 thispatcher;
#N vpatcher 513 131 1215 447;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 26 108 92 196617 expr pow(2\,$i1);
#P newex 26 87 50 196617 int;
#P newex 26 66 96 196617 expr ln($i1)/ln(2.);
#P window linecount 0;
#P newex 26 224 140 196617 print fft-overlap-changed-to;
#P window linecount 1;
#P newex 582 187 31 196617 adc~;
#P comment 266 90 327 196617 we use a script to rewrite the pfft~ object;
#P comment 266 78 327 196617 As we can’t dynamically change pfft~ parameters ,;
#P window setfont "Sans Serif" 12.;
#P comment 266 61 244 196620 Change pfft~ overlap;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 26 138 566 196617 t i b i b stop;
#P inlet 26 42 15 0;
#P message 443 171 92 196617 script delete PFFT;
#P window linecount 2;
#P message 165 194 135 196617 script connect IN1 0 PFFT 0 , script connect IN2 0 PFFT 1;
#P newex 304 194 224 196617 sprintf script new PFFT newex 24 220 218 196617 pfft~ spectr-fftsub $1 %d 0 0 args $2;
#P outlet 185 249 15 0;
#P window linecount 0;
#P comment 12 29 44 196617 overlap;
#P comment 551 209 121 196617 Doing this while dsp is running would crash Max;
#P comment 76 88 134 196617 ajust to higher power of 2;
#P connect 7 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 8 0;
#P connect 8 0 13 0;
#P connect 8 1 5 0;
#P fasten 6 0 3 0 448 235 190 235;
#P fasten 5 0 3 0 170 235 190 235;
#P fasten 4 0 3 0 309 235 190 235;
#P connect 8 2 4 0;
#P connect 8 3 6 0;
#P connect 8 4 12 0;
#P pop;
#P newobj 109 171 87 196617 p change-overlap;
#P comment 19 55 244 196617 Buffer = $2;
#P comment 19 43 244 196617 FFT size = $1;
#P window setfont "Sans Serif" 12.;
#P comment 19 26 244 196620 Spectrum analysis , poly~ downsampler;
#P user panel 8 21 268 68;
#X brgb 245 167 85;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#N in 3;
#P newobj 232 130 25 196617 in 3;
#P objectname IN2;
#P comment 213 115 59 196617 integration;
#N in~ 1;
#P newobj 24 130 33 196617 in~ 1;
#P objectname IN1;
#P comment 24 115 32 196617 input;
#P newex 24 220 218 196617 pfft~ spectr-fftsub $1 2 0 0 args $2;
#P objectname PFFT;
#P connect 2 0 0 0;
#P connect 11 0 9 0;
#P connect 9 0 10 0;
#P connect 4 0 0 1;
#P pop;

— Subpatch 3: spectr-analyze —

max v2;
#N vpatcher 358 504 813 774;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 174 146 61 196617 send DECIM;
#P newex 155 196 27 196617 * 2;
#P comment 35 55 238 196617 Buffer = $2;
#P comment 35 43 238 196617 FFT size = $1;
#P window setfont "Sans Serif" 12.;
#P comment 35 26 238 196620 Spectrum analysis , toplevel;
#P user panel 21 21 268 68;
#X brgb 245 167 85;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P newex 336 103 68 196617 send FFTSIZE;
#P comment 253 100 59 196617 integration;
#N comlet (float) Integration;
#P inlet 274 113 15 0;
#P button 329 38 15 0;
#P newex 329 58 48 196617 loadbang;
#P newex 329 150 27 196617 / 2.;
#P message 329 190 43 196617 size $1;
#P flonum 329 171 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 329 122 66 196617 sampstoms~;
#P newex 329 208 88 196617 buffer~ $2;
#P message 329 80 48 196617 $1;
#P newex 65 177 31 196617 adc~;
#P newex 65 146 100 196617 t start i i;
#P comment 101 100 72 196617 downsampling;
#N comlet (integer) Downsampling;
#P inlet 125 113 15 0;
#P message 110 178 48 196617 down $1;
#P newex 36 223 249 196617 poly~ spectr-down args $1 $2;
#N comlet (signal) Input;
#P inlet 36 113 15 0;
#P comment 27 100 36 196617 signal;
#P comment 332 228 78 196617 Allocate buffer;
#P window linecount 2;
#P comment 4 149 38 196617 FILTER HERE;
#P window linecount 1;
#P comment 48 195 65 196617 retstart dsp;
#P window linecount 2;
#P comment 184 192 80 196617 overlap is twice downsampling;
#P connect 5 0 6 0;
#P fasten 7 0 6 0 115 213 41 213;
#P fasten 8 0 10 0 130 134 70 134;
#P connect 10 0 11 0;
#P connect 10 1 7 0;
#P connect 10 2 27 0;
#P connect 27 0 6 1;
#P fasten 8 0 28 0 130 134 179 134;
#P connect 20 0 6 2;
#P connect 19 0 18 0;
#P connect 18 0 12 0;
#P connect 12 0 14 0;
#P fasten 14 1 17 0 390 144 334 144;
#P connect 17 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 13 0;
#P connect 12 0 22 0;
#P pop;

— Main patch —

max v2;
#N vpatcher 469 44 1152 478;
#P window setfont "Sans Serif" 9.;
#P comment 321 22 32 196617 GAIN;
#P number 319 36 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 472 502 1113 1033;
#P user led 463 385 17 17 0 150;
#P window setfont "Sans Serif" 9.;
#P newex 463 360 32 196617 sel 1;
#P newex 463 336 69 196617 >;
#P number 463 314 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 463 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 463 291 40 196617 / 512.;
#P button 475 218 15 0;
#P window linecount 1;
#P newex 463 247 35 196617 timer;
#P newex 74 100 131 196617 spectr-analyze 512 SPBUF;
#P newex 335 77 66 196617 split 10 100;
#N comlet connect to lcd;
#P outlet 254 449 15 0;
#N vpatcher 682 474 977 782;
#P window setfont "Sans Serif" 9.;
#P newex 39 32 48 196617 loadbang;
#P newex 166 230 42 196617 pack i i;
#N vtable 128 30 89 240 256 4 128 B;
#P newobj 166 252 41 196617 table B;
#P newex 113 230 42 196617 pack i i;
#N vtable 128 20 74 230 241 4 128 G;
#P newobj 113 252 41 196617 table G;
#P newex 60 230 42 196617 pack i i;
#N vtable 128 20 74 230 241 4 128 R;
#P newobj 60 252 41 196617 table R;
#P newex 198 183 37 196617 >> 8;
#P newex 145 183 37 196617 >> 8;
#P newex 92 183 37 196617 >> 8;
#P number 39 159 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 92 159 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 145 159 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 198 159 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 39 133 170 196617 cycle 4;
#P newex 39 106 51 196617 route set;
#P message 39 57 33 196617 dump;
#P newex 39 79 99 196617 text SPECTRO.CLUT;
#P window setfont "Sans Serif" 14.;
#P comment 116 31 119 196622 Color Lookup Table loader;
#P connect 18 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 8 0;
#P fasten 8 0 13 0 44 219 65 219;
#P connect 13 0 12 0;
#P connect 4 1 7 0;
#P connect 7 0 9 0;
#P connect 9 0 13 1;
#P fasten 8 0 15 0 44 219 118 219;
#P connect 15 0 14 0;
#P connect 4 2 6 0;
#P connect 6 0 10 0;
#P connect 10 0 15 1;
#P fasten 8 0 17 0 44 219 171 219;
#P connect 17 0 16 0;
#P connect 4 3 5 0;
#P connect 5 0 11 0;
#P connect 11 0 17 1;
#P pop;
#P newobj 330 362 56 196617 p clut.load;
#P newex 271 117 54 196617 dspstate~;
#P comment 327 278 44 196617 row nr.;
#P newex 269 331 39 196617 !- 256;
#P newex 254 272 27 196617 int;
#N vpatcher 360 465 585 658;
#P window setfont "Sans Serif" 9.;
#N vtable 128 30 89 240 256 4 128 B;
#P newobj 146 103 41 196617 table B;
#N vtable 128 20 74 230 241 4 128 G;
#P newobj 93 103 41 196617 table G;
#N vtable 128 20 74 230 241 4 128 R;
#P newobj 40 103 41 196617 table R;
#P outlet 146 135 15 0;
#P outlet 93 135 15 0;
#P outlet 40 134 15 0;
#P inlet 93 34 15 0;
#P comment 53 21 106 196617 pixel value (0 .. 127);
#P connect 1 0 5 0;
#P connect 5 0 2 0;
#P connect 1 0 6 0;
#P connect 6 0 3 0;
#P connect 1 0 7 0;
#P connect 7 0 4 0;
#P pop;
#P newobj 284 362 41 196617 p clut;
#P newex 319 331 93 196617 * 30.;
#P toggle 271 139 15 0;
#P newex 271 158 74 196617 metro 100;
#N counter 0 512;
#X flags 0 0;
#P newobj 271 179 74 196617 counter 0 512;
#P newex 271 219 63 196617 t i b;
#P newex 254 416 84 196617 prepend setpixel;
#P newex 254 389 71 196617 pack i i i i i;
#P newex 324 243 53 196617 Uzi 256 0;
#P newex 319 304 68 196617 peek~ SPBUF;
#P comment 279 202 57 196617 column nr.;
#N comlet (integer) downsample;
#P inlet 134 41 15 0;
#P comment 111 28 64 196617 downsample;
#N comlet (float) Gain;
#P inlet 402 41 15 0;
#P comment 398 28 26 196617 gain;
#N comlet (number) Period;
#P inlet 335 41 15 0;
#P comment 326 28 35 196617 period;
#N comlet (signal) Input;
#P inlet 74 41 15 0;
#P window linecount 0;
#P comment 59 28 44 196617 audio in;
#P comment 246 464 35 196617 to lcd;
#P comment 139 61 37 196617 power of 2;
#P comment 269 73 67 196617 cpu overload protection;
#P comment 482 381 114 196617 OVERRUN: Period is too small (lcd can’t process all messages);
#P connect 5 0 30 0;
#P connect 11 0 30 1;
#P fasten 14 0 23 0 329 267 259 267;
#P connect 23 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 28 0;
#P fasten 14 2 24 0 371 292 274 292;
#P connect 24 0 15 1;
#P connect 26 0 20 0;
#P connect 20 0 19 0;
#P connect 19 0 18 0;
#P connect 18 0 17 0;
#P connect 17 0 23 1;
#P fasten 21 0 22 0 324 353 289 353;
#P connect 22 0 15 2;
#P connect 22 1 15 3;
#P connect 22 2 15 4;
#P fasten 14 2 13 0 371 292 324 292;
#P connect 13 0 21 0;
#P connect 17 1 14 0;
#P connect 7 0 29 0;
#P connect 29 0 19 1;
#P connect 9 0 21 1;
#P connect 32 0 31 0;
#P connect 31 0 34 0;
#P connect 34 0 33 0;
#P connect 33 0 35 0;
#P connect 35 0 36 0;
#P connect 36 0 37 0;
#P connect 37 0 38 0;
#P fasten 18 3 32 0 339 203 480 203;
#P connect 32 0 31 1;
#P fasten 7 0 36 1 340 65 527 65;
#P pop;
#P newobj 139 59 192 196617 p sonogram;
#P window setfont "Sans Serif" 18.;
#P window linecount 0;
#P message 190 376 116 196626;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 428 494 1123 776;
#P window setfont "Sans Serif" 9.;
#P newex 562 176 97 196617 sprintf set %.1f Hz;
#P window linecount 1;
#N vpatcher 986 500 1317 798;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 223 120 62 196617 subsampling ratio;
#P window linecount 1;
#P newex 42 203 184 196617 / 1.;
#P newex 216 41 75 196617 receive DECIM;
#P outlet 42 242 15 0;
#P newex 131 77 27 196617 / 2;
#P newex 42 164 99 196617 * 1.;
#P newex 117 41 54 196617 dspstate~;
#P newex 42 102 30 196617 !- 1.;
#P newex 42 79 40 196617 / 256.;
#P inlet 42 41 15 0;
#P window linecount 2;
#P comment 49 120 62 196617 0 at bottom 1 at top;
#P comment 137 120 62 196617 half sample frequency;
#P window linecount 1;
#P comment 27 258 55 196617 frequency;
#P window linecount 0;
#P comment 24 27 57 196617 coordinate;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 12 0;
#P connect 12 0 10 0;
#P connect 7 1 9 0;
#P connect 9 0 8 1;
#P connect 11 0 12 1;
#P pop;
#P newobj 562 148 49 196617 p y2freq;
#P window linecount 0;
#P newex 520 122 52 196617 unpack i i;
#P outlet 517 223 15 0;
#P newex 520 96 29 196617 gate;
#P message 497 178 22 196617 set;
#P newex 352 125 50 196617 del 10;
#P window linecount 1;
#P message 352 153 83 196617 hidesprite cross;
#P newex 352 97 50 196617 select 0;
#P window linecount 0;
#P newex 50 44 50 196617 loadbang;
#P window linecount 4;
#P message 50 68 150 196617 enablesprites 1 , recordsprite , frgb 0 255 0 , linesegment -512 0 512 0 , linesegment 0 -256 0 256 , closesprite cross;
#P inlet 352 50 15 0;
#P window linecount 1;
#P message 214 153 118 196617 drawsprite cross $1 $2;
#P outlet 214 223 15 0;
#P inlet 214 50 15 0;
#P window linecount 0;
#P comment 191 37 60 196617 mouse x , y;
#P comment 332 37 61 196617 mousedown;
#P comment 205 238 35 196617 to lcd;
#P connect 8 0 7 0;
#P connect 3 0 5 0;
#P fasten 10 0 4 0 357 195 219 195;
#P fasten 7 0 4 0 55 195 219 195;
#P fasten 5 0 4 0 219 195 219 195;
#P connect 6 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 10 0;
#P fasten 9 0 12 0 357 118 502 118;
#P fasten 12 0 14 0 502 208 522 208;
#P fasten 17 0 14 0 567 208 522 208;
#P fasten 6 0 13 0 357 83 525 83;
#P connect 13 0 15 0;
#P fasten 3 0 13 1 219 75 544 75;
#P connect 15 1 16 0;
#P connect 16 0 17 0;
#P pop;
#P newobj 139 352 61 196617 p crosshair;
#P number 259 36 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 71 157 50 196617 select 32;
#P newex 71 135 40 196617 key;
#P toggle 71 180 15 0;
#P user gain~ 21 136 42 37 158 0 1.071519 7.94321 10.;
#P newex 21 211 31 196617 dac~;
#P user umenu 168 36 41 196647 1 64 52 1;
#X add 1;
#X add 2;
#X add 4;
#X add 8;
#X add 16;
#X add 32;
#P user lcd 139 82 512 256 0 1 0 0 1;
#P newex 21 27 31 196617 adc~;
#P comment 258 22 38 196617 PERIOD;
#P comment 155 22 83 196617 DOWNSAMPLING;
#P connect 2 0 6 0;
#P fasten 7 0 5 0 76 199 26 199;
#P connect 6 0 5 0;
#P fasten 6 0 5 1 26 204 47 204;
#P connect 8 0 9 0;
#P connect 9 0 7 0;
#P fasten 2 0 13 0 26 54 144 54;
#P connect 13 0 3 0;
#P fasten 11 0 3 0 144 376 125 376 125 79 144 79;
#P connect 3 0 11 0;
#P fasten 3 2 11 1 478 346 195 346;
#P connect 11 1 12 0;
#P connect 4 1 13 1;
#P connect 10 0 13 2;
#P connect 14 0 13 3;
#P pop;

Some comments in follow-up.


April 13, 2008 | 10:34 pm

Some comment on my LCD sonogram.

spectr-fftsub:
Performs the fft.
Lives of course inside pfft~
Integration (spectral averaging) is not used in the sonogram.

spectr-down:
Subsampled pfft~. Lives in a poly~
I use a script to change overlap.

spectr-analyze:
Hearth of the sonogram.
Embed a poly~ for downsampling.
dsp needs to be stopped before changing downsampling and restarted before.
clut use 3 tables to hold R, G and B curves.
Get my clut here: http://www2.pescadoo.net/temporaire/SPECTRO.CLUT

main patch:
Gain: self explanatory.
Period: ms per column.
YOU CAN EASILY SCREW YOU CPU WITH PERIODS < 10.


April 13, 2008 | 11:24 pm

Powerful stuff, thanks for sharing it. Your cluts work fine, good idea.


April 14, 2008 | 8:32 am

I’ll have to have a look at this on my other computer later, but thanks!
Crazy coincidence that you post this, I was going to ask if there are any
alternative sonograms to the max object, preferably using LCD.
Is the code scalable? If I resize the LCD, will the code accomodate the new
dimensions?

On 14/04/2008, Bertrand Fraysse wrote:
>
>
> Powerful stuff, thanks for sharing it. Your cluts work fine, good idea.
>
>


April 14, 2008 | 10:14 am

In my version, the resize message for the code is on the left, and more precisely in the top left corner. You send a message with
[x y] and then you resize your LCD by giving it the same values.

A question. If I put an interface thing in a bpatcher.
Is there a way to know, inside the bpatcher, its size ?


April 14, 2008 | 2:45 pm

> Crazy coincidence that you post this, I was going to ask
> if there are any alternative sonograms to the max object,
> preferably using LCD.

Funny indeed. April is sonogram’s month.

> Is the code scalable? If I resize the LCD,
> will the code accomodate the new dimensions?

Mine won’t until you change ‘counter 0 512′ to match the new width and ‘spectr-analyze fft_size buffer_name’ to match the new height. Since it is one vertical pixel per frequency bin, you are bound to height = fft-size/2.

Next version will get a zoom fft (spectrum translation around a center frequency) but this requires the low-pass filter which was omitted in this version (‘filter here’ comment in spectr-analyze) because aliasing would be too high.

There are certainly better display solutions with Jitter but i don’t have Jitter.


April 14, 2008 | 4:54 pm

Quote: J.Y.Bernier wrote on Sun, 13 April 2008 23:34
—————————————————-

> YOU CAN EASILY SCREW YOU CPU WITH PERIODS < 10.
—————————————————-

Really? on my macbook pro a period of 1 is fine about 1% cpu usage.

It’s a great patch!

Best,

J.


April 14, 2008 | 9:27 pm


April 16, 2008 | 8:44 pm

Bertrand Fraysse schrieb:
> A question. If I put an interface thing in a bpatcher.
> Is there a way to know, inside the bpatcher, its size ?

Javascript can help:

function bang()
{
if(this.patcher){
if(this.patcher.box){
outlet(0, this.patcher.box.rect);
}
}
}


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


April 17, 2008 | 1:37 pm


Viewing 11 posts - 1 through 11 (of 11 total)