Forums > MaxMSP

simple max and ftm question

June 12, 2008 | 7:48 pm

I recently posted my patch producing a power spectrum via ftm gabor objects. I’ve updated it to print the fft vector [each slice] using ftm.iter. When I push the button, the values print. I have two questions:

[1] how can i continually print the vector values? I know there’s a lot of them, and i may not need them to print in the end, but I’d like to see the entire matrix, or collection of vectors. Using a window size of 1024 and hop size of 512, I think i should be getting a new vector every 11.6 ms. And so I’d like to print every 11.6 ms.

[2] i’ve done all this work, i just want to check if the values are correct. is there a way to know if those are the the fft values being printed? Looking at the patch, gbr.preemphasis, which is where the values are be printed, occurs before the gbr.fft operation. I did this because that’s how it was on the tutorial.

many thanks.

#P origin -3 14;
#P window setfont "Sans Serif" 20.;
#P window linecount 2;
#P comment 403 315 236 196628 Are the values being printed the fft values?;
#P user panel 400 307 241 70;
#X brgb 255 125 125;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user ftm.mess 474 246 50 15 3 9 255 255 255 0 0 0 1 2 0 0 0 –> 0;
#T _#ftm version 2 3;
#T _#scope begin;
#T _#absargs $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line _{$*};
#P user ftm.mess 474 275 127 15 3 9 255 255 255 0 0 0 1 2 0 0 0 –> 0;
#T _#line "_(print column $2 —> $1)";
#P button 475 132 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N ftm.iter @mode col –> 0;
#P newobj 475 217 96 196617 ftm.iter @mode col;
#N ftm.print got –> 0;
#P newobj 178 152 68 196617 ftm.print got;
#P user ftm.object 475 166 36 18 3 9 –> 0;
#T _#obj 1 fmat;
#T _#def 0 _fmat preemph local;
#N gbr.preemphasis @out $preemph –> 0;
#P newobj 32 127 156 196617 gbr.preemphasis @out $preemph;
#P user ftm.vecdisplay 32 211 282 177 0. 5000. 22050. 231 231 231 0 1 1 -9. 0. 0 116 2 1 0. 1. 0 0 0 1 0. 1. 0 113 132 1 0. 1. 90 101 255 1 0. 1. 124 255 132;
#T open 130;
#P user ftm.mess 32 193 110 15 3 9 255 255 255 0 0 0 1 2 0 0 0 –> 0;
#T _#line "_((($1 clogabs) mul 2))";
#P message 32 9 77 196617 open , loop 1 , 1;
#N sfplay~ 1 120960 0 ;
#P newobj 32 28 44 196617 sfplay~;
#P message 269 99 27 196617 stop;
#P message 199 99 65 196617 startwindow;
#P newex 157 98 30 196617 dac~;
#P user gain~ 32 48 29 28 158 0 1.071519 7.94321 10.;
#P window linecount 2;
#P comment 65 47 35 196617 sound level;
#P user panel 194 91 107 30;
#X brgb 191 210 255;
#X frgb 0 85 232;
#X border 1;
#X rounded 12;
#X shadow 0;
#X done;
#P user ftm.object 321 309 39 18 3 9 –> 0;
#T _#def 0 _1024 size local;
#P window linecount 1;
#N gbr.fft $size @mode real –> 0;
#P newobj 32 172 122 196617 gbr.fft $size @mode real;
#N gbr.wind= hann –> 0;
#P newobj 32 149 78 196617 gbr.wind= hann;
#N gbr.slice~ $N $Nhop –> 0;
#P newobj 32 105 100 196617 gbr.slice~ $N $Nhop;
#P user ftm.object 321 267 39 18 3 9 –> 0;
#T _#def 0 _1024 N local;
#P user ftm.object 321 288 33 18 3 9 –> 0;
#T _#def 0 _512 Nhop local;
#T _#scope end;
#P comment 152 194 246 196617 log of abs value of complex number x scaling value;
#P comment 493 132 100 196617 vector of values;
#P window setfont "Sans Serif" 20.;
#P window linecount 2;
#P comment 401 66 236 196628 How can I continually print the vector values?;
#P user panel 398 58 241 70;
#X brgb 255 125 125;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 17 0 16 0;
#P connect 16 0 12 0;
#P connect 12 0 6 0;
#P connect 6 0 20 0;
#P connect 20 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 18 0;
#P connect 18 0 19 0;
#P connect 12 0 13 0;
#P hidden connect 15 0 13 0;
#P hidden connect 14 0 13 0;
#P connect 12 0 13 1;
#P connect 20 1 22 0;
#P connect 23 0 26 0;
#P connect 26 0 25 0;
#P connect 24 0 21 0;
#P connect 21 0 23 0;
#P connect 23 1 25 1;
#P pop;


Viewing 1 post (of 1 total)