Forums > MaxMSP

help with FFT patch

June 15, 2009 | 3:53 pm

hey board;

i’m trying to understand the FFT objects, an managed to put this patch together.

i guess the rumbling sound is because i dont have proper windowing on each FFT cycle.. thing is i don’t know where to put the window function!

here’s the patch. any thoughts would be awesome!

max v2;
#N vpatcher 348 87 822 433;
#P button 208 67 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 225 67 48 196617 loadbang;
#P newex 225 262 82 196617 buffer~ hann 24;
#P newex 225 242 59 196617 poke~ hann;
#P newex 249 199 40 196617 +~ 0.5;
#P newex 249 177 46 196617 *~ -0.5;
#P newex 249 156 40 196617 cycle~;
#P newex 279 132 49 196617 /~ 1024;
#P newex 225 99 40 196617 count~;
#P newex 6 222 151 196617 *~;
#P newex 64 262 55 196617 send~ au2;
#P newex 5 262 55 196617 send~ au1;
#P newex 5 199 133 196617 fft~ 1024 1024;
#P newex 101 155 53 196617 cartopol~;
#P message 133 89 41 196617 loop $1;
#P message 37 89 41 196617 loop $1;
#P window linecount 2;
#P message 60 25 51 196617 ; dsp set 0;
#B color 6;
#P message 5 25 51 196617 ; dsp set 1;
#B color 6;
#P window linecount 1;
#N vpatcher 30 89 630 489;
#P button 157 110 15 0;
#P window setfont "Sans Serif" 9.;
#P message 157 128 20 196617 15;
#P newex 135 146 32 196617 line~;
#P button 233 132 15 0;
#P message 233 150 20 196617 15;
#P newex 211 168 32 196617 line~;
#P newex 180 208 41 196617 *~ 0.5;
#B color 4;
#P newex 134 188 41 196617 *~ 0.5;
#B color 4;
#P newex 157 85 64 196617 unpack 0. 0.;
#B color 4;
#P newex 180 188 69 196617 receive~ au2;
#B color 4;
#P newex 134 167 69 196617 receive~ au1;
#B color 4;
#P outlet 180 239 15 0;
#P outlet 134 239 15 0;
#P inlet 157 64 15 0;
#P connect 3 0 6 0;
#P connect 6 0 1 0;
#P fasten 5 0 11 0 162 105 140 105;
#P connect 0 0 5 0;
#P connect 5 0 13 0;
#P connect 13 0 12 0;
#P connect 12 0 11 1;
#P connect 11 0 6 1;
#P connect 4 0 7 0;
#P connect 7 0 2 0;
#P connect 5 1 8 0;
#P connect 8 0 7 1;
#P connect 5 1 10 0;
#P connect 10 0 9 0;
#P connect 9 0 8 1;
#P pop;
#P newobj 165 243 33 196617 p pan;
#P user multiSlider 165 155 33 84 0. 0.5 2 2681 15 0 0 1 0 0 0;
#M frgb 255 96 75;
#M brgb 255 247 207;
#M rgb2 127 127 127;
#M rgb3 255 255 255;
#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 165 263 33 196617 dac~;
#B color 4;
#P newex 127 177 27 196617 *~;
#P newex 5 154 27 196617 *~;
#P newex 101 134 96 196617 fft~ 1024 1024;
#P newex 5 134 82 196617 fft~ 1024 1024;
#P toggle 101 67 15 0;
#P toggle 5 67 15 0;
#P newex 101 89 29 196617 sig~;
#P newex 5 89 29 196617 sig~;
#P newex 101 113 93 196617 groove~ sample_2;
#P newex 5 113 93 196617 groove~ sample_1;
#P message 208 25 43 196617 replace;
#P message 115 25 43 196617 replace;
#P newex 208 44 90 196617 buffer~ sample_2;
#P newex 115 44 90 196617 buffer~ sample_1;
#P connect 8 0 6 0;
#P fasten 19 0 4 0 42 109 10 109;
#P connect 6 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 22 0;
#P connect 22 0 23 0;
#P fasten 21 0 12 1 106 175 34 175 34 153 27 153;
#P fasten 8 0 19 0 10 85 42 85;
#P connect 22 0 24 0;
#P connect 9 0 7 0;
#P fasten 20 0 5 0 138 109 106 109;
#P connect 7 0 5 0;
#P connect 5 0 11 0;
#P connect 11 0 21 0;
#P connect 2 0 0 0;
#P fasten 10 1 13 0 46 175 132 175;
#P connect 13 0 22 1;
#P fasten 9 0 20 0 106 85 138 85;
#P connect 11 1 21 1;
#P connect 21 1 13 1;
#P connect 15 0 16 0;
#P connect 16 0 14 0;
#P connect 16 1 14 1;
#P connect 3 0 1 0;
#P connect 33 0 26 0;
#P connect 34 0 26 0;
#P connect 30 0 31 0;
#P connect 28 0 29 0;
#P connect 29 0 30 0;
#P fasten 26 0 31 1 230 229 254 229;
#P fasten 26 0 27 0 230 124 284 124;
#P connect 27 0 28 1;
#P pop;


June 15, 2009 | 3:56 pm

oh yeah, i included a hann function for fun.


June 16, 2009 | 1:25 am

Strange, you are using fft~, then fft~ again. Don’t you want an ifft~ instead?
Why don’t you start with a tutorial, then try to build from that?
J-F.


June 19, 2009 | 7:12 am

You should definitely look into pfft~, way more convenient. Whenever I do fft based processing I never even think of touching fft~ and ifft~…

Stefan


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