Forums > MaxMSP

ftm: getting values from fft into sdif file

June 10, 2008 | 8:23 pm

Hi I’m using ftm objects to slice up an audio signal and get a fft. The included patch shows that. I would like to take this information and use it to make chromagram vectors. My question is how to you get the numerical values from the fft? I suppose you can export them to an sdif file. However, I don’t really understand what an sdif file is or how to export/import/use it. Any guidance would be appreciated.

#P origin -3 0;
#P user ftm.mess 90 211 58 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 "_($1 mul 2)";
#P user ftm.vecdisplay 90 237 278 188 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 127;
#P user ftm.mess 90 185 66 15 3 9 255 255 255 0 0 0 1 2 0 0 0 –> 0;
#T _#line "_($1 clogabs)";
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 90 23 77 196617 open , loop 1 , 1;
#N sfplay~ 1 120960 0 ;
#P newobj 90 42 44 196617 sfplay~;
#P message 322 113 27 196617 stop;
#P message 252 113 65 196617 startwindow;
#P newex 215 112 30 196617 dac~;
#P user gain~ 90 62 29 28 158 0 1.071519 7.94321 10.;
#P window linecount 4;
#P comment 123 61 52 196617 adjust the sound level with this fader;
#P user panel 247 105 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 379 314 39 18 3 9 –> 0;
#T _#def 0 _4096 size local;
#P window linecount 1;
#N gbr.fft $size @mode real –> 0;
#P newobj 90 164 122 196617 gbr.fft $size @mode real;
#N gbr.wind= hann –> 0;
#P newobj 90 141 78 196617 gbr.wind= hann;
#N gbr.slice~ $N $Nhop –> 0;
#P newobj 90 119 100 196617 gbr.slice~ $N $Nhop;
#P user ftm.object 379 272 39 18 3 9 –> 0;
#T _#def 0 _2048 N local;
#P user ftm.object 379 293 33 18 3 9 –> 0;
#T _#def 0 _256 Nhop local;
#T _#scope end;
#P comment 161 188 232 196617 log of abs value of complex number;
#P comment 154 212 100 196617 scaling;
#P connect 15 0 14 0;
#P connect 14 0 10 0;
#P connect 10 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 16 0;
#P connect 16 0 18 0;
#P connect 18 0 17 0;
#P connect 10 0 11 0;
#P hidden connect 13 0 11 0;
#P hidden connect 12 0 11 0;
#P connect 10 0 11 1;
#P pop;


June 11, 2008 | 9:53 am

Hi kernel,

that discussion will be much richer on the ftm mailing list, to which I’m
crossposting this.

v1025kernel wrote:
> Hi I’m using ftm objects to slice up an audio signal and get a fft.

Good choice! =-)

> The included patch shows that. I would like to take this information and use
it to make chromagram vectors. My question is how to you get the numerical
values from the fft?

direct answer: indexing with $myfmat[row column] or iterating over all values
with ftm.iter

problem-specific answer: look at gbr.bands, mnm.xmul with a kernel corresponding
to the chroma bands, and so on.

> I suppose you can export them to an sdif file. However, I
don’t really understand what an sdif file is or how to export/import/use it. Any
guidance would be appreciated.

Look at the ftm.sdif.help and urls cited therein.

Cheers…
…Diemo

> #P origin -3 0;
> #P user ftm.mess 90 211 58 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 "_($1 mul 2)";
> #P user ftm.vecdisplay 90 237 278 188 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 127;
> #P user ftm.mess 90 185 66 15 3 9 255 255 255 0 0 0 1 2 0 0 0 –> 0;
> #T _#line "_($1 clogabs)";
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 90 23 77 196617 open , loop 1 , 1;
> #N sfplay~ 1 120960 0 ;
> #P newobj 90 42 44 196617 sfplay~;
> #P message 322 113 27 196617 stop;
> #P message 252 113 65 196617 startwindow;
> #P newex 215 112 30 196617 dac~;
> #P user gain~ 90 62 29 28 158 0 1.071519 7.94321 10.;
> #P window linecount 4;
> #P comment 123 61 52 196617 adjust the sound level with this fader;
> #P user panel 247 105 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 379 314 39 18 3 9 –> 0;
> #T _#def 0 _4096 size local;
> #P window linecount 1;
> #N gbr.fft $size @mode real –> 0;
> #P newobj 90 164 122 196617 gbr.fft $size @mode real;
> #N gbr.wind= hann –> 0;
> #P newobj 90 141 78 196617 gbr.wind= hann;
> #N gbr.slice~ $N $Nhop –> 0;
> #P newobj 90 119 100 196617 gbr.slice~ $N $Nhop;
> #P user ftm.object 379 272 39 18 3 9 –> 0;
> #T _#def 0 _2048 N local;
> #P user ftm.object 379 293 33 18 3 9 –> 0;
> #T _#def 0 _256 Nhop local;
> #T _#scope end;
> #P comment 161 188 232 196617 log of abs value of complex number;
> #P comment 154 212 100 196617 scaling;
> #P connect 15 0 14 0;
> #P connect 14 0 10 0;
> #P connect 10 0 4 0;
> #P connect 4 0 5 0;
> #P connect 5 0 6 0;
> #P connect 6 0 16 0;
> #P connect 16 0 18 0;
> #P connect 18 0 17 0;
> #P connect 10 0 11 0;
> #P hidden connect 13 0 11 0;
> #P hidden connect 12 0 11 0;
> #P connect 10 0 11 1;
> #P pop;
>
>
>


Diemo Schwarz, PhD — http://diemo.concatenative.net
Real-Time Music Interaction Team — http://imtr.ircam.fr
IRCAM – Centre Pompidou — 1, place Igor-Stravinsky, 75004 Paris, France
Phone +33-1-4478-4879 — Fax +33-1-4478-1540


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