Forums > MaxMSP

peak hold on spectroscope / sweeping frequencies

May 6, 2006 | 8:21 pm

It seems there should be an easy way to do this, but I’m stuck: I want a readout like spectroscope~ (in spectrogram mode), but where the peak frequencies are held until reset. This would give a clear picture of the frequency response, when sweeping frequencies through an object/circuit/room. Ala Spectrafoo, or FuzzMeasure.

Checking the possible messages you can send to spectroscope, I don’t see any peak holding ability… anyone got some clever ideas?

Thanks,
Leigh


May 6, 2006 | 10:32 pm

Hi,

here is one solution using the FTM library. It should be possible to
recreate this using Jitter instead. FTM can be downloaded here:

http://recherche.ircam.fr/equipes/temps-reel/ftm/index.html

Best,
Trond

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 394 203 60 196617 loadmess 1;
#P comment 496 229 120 196617 scaling;
#P comment 496 204 120 196617 complex absolut value;
#P comment 496 179 120 196617 fft;
#P comment 496 154 120 196617 apply window;
#P newex 326 154 78 196617 gbr.wind= hann;
#P user ftm.mess 326 229 64 15 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_($1 mul $2)";
#P newex 326 179 153 196617 gbr.fft @mode real @scale 0.02;
#P flonum 394 229 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 40 104 640 504;
#P window setfont "Sans Serif" 9.;
#P newex 86 112 20 196617 t b;
#P user ftm.mess 109 114 50 15 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_set $1";
#P user ftm.object 109 137 36 18 3 9;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#scope begin;
#T _#obj 1 fmat;
#T _#def 0 _fmat reg1 local;
#T _#scope end;
#N vpatcher 541 67 908 403;
#P outlet 60 275 15 0;
#P inlet 323 60 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 60 137 74 196617 ftm.copy fmat;
#P user ftm.mess 229 199 104 17 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_($1 mul $2)";
#P inlet 60 60 15 0;
#P user ftm.mess 60 199 64 15 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_($1 mul $2)";
#P newex 229 165 60 196617 mnm.mm lt;
#P newex 114 169 63 196617 mnm.mm ge;
#P user ftm.mess 60 243 63 15 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_($1 add $2)";
#P connect 4 0 6 0;
#P connect 6 0 3 0;
#P connect 3 0 0 0;
#P connect 0 0 8 0;
#P connect 5 0 0 1;
#P connect 6 0 1 0;
#P connect 1 0 3 1;
#P connect 7 0 1 1;
#P connect 4 0 2 0;
#P connect 2 0 5 0;
#P connect 7 0 2 1;
#P connect 7 0 5 1;
#P pop;
#P newobj 60 161 59 196617 p cell_max;
#P newex 60 76 74 196617 ftm.copy fmat;
#P inlet 60 41 15 0;
#P inlet 109 117 15 0;
#P outlet 60 198 15 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 0 0;
#P connect 3 0 7 0;
#P fasten 4 0 6 0 65 186 170 186 170 104 114 104;
#P connect 6 0 5 0;
#P connect 7 0 5 0;
#P connect 1 0 5 0;
#P connect 5 0 4 1;
#P pop;
#P newobj 504 300 65 196617 p fmat_peak;
#P message 559 277 32 196617 fill 0;
#P user ftm.mess 326 204 53 15 3 9 255 255 255 0 0 0 1 2 0 0;
#T _#aa $0_ $1_ $2_ $3_ $4_ $5_ $6_ $7_ $8_ $9_;
#T _#line "_($1 cabs)";
#P message 204 168 29 196617 stop;
#P message 134 168 67 196617 startwindow;
#P newex 251 205 31 196617 dac~;
#P message 251 55 77 196617 open , 1 , loop 1;
#N sfplay~ 1 120960 0 ;
#P newobj 251 89 44 196617 sfplay~;
#P user ftm.vecdisplay 326 325 369 239 0. 127. 127. 190 190 190 0 5 3 0.
1. 255 0 0 1 0. 1. 0 255 0 1 0. 1. 0 0 255 1 0. 1. 255 0 255 1 0. 1. 255
255 0;
#T open 114;
#P newex 326 129 103 196617 gbr.slice~ 1024 512;
#P comment 496 129 120 196617 chop audio into matrixes;
#P hidden connect 19 0 11 0;
#P connect 13 0 2 0;
#P fasten 13 0 10 0 331 291 509 291;
#P fasten 3 0 5 0 256 120 256 120;
#P fasten 3 0 5 1 256 180 277 180;
#P connect 3 0 1 0;
#P connect 1 0 14 0;
#P connect 12 0 8 0;
#P connect 14 0 12 0;
#P connect 10 0 2 2;
#P connect 4 0 3 0;
#P fasten 7 0 5 0 209 191 256 191;
#P fasten 6 0 5 0 139 191 256 191;
#P connect 8 0 13 0;
#P connect 11 0 13 1;
#P connect 9 0 10 1;
#P window clipboard copycount 20;


May 6, 2006 | 11:49 pm

Thanks for that idea. Unfortunately for me, the current version of FTM only runs on OS X 10.4, and I’m still at 10.3. Does anyone have an older, compatible copy they would be so kind as to email me?

Cheers,
Leigh


May 7, 2006 | 7:45 am

There is info on how to install FTM 1.7.5 on OS 10.3 at the FTM wiki:

*http://tinyurl.com/qrl9n

Best,
Trond


May 7, 2006 | 7:53 am

Leigh,

there’s a workaround for this…

Norbert Schnell (IRCAM) said:

————————————

Hi friends of 10.3.9,

Just take the FTMlib.framework and copy it into /Library/Frameworks
and it should work.
It works for me!

————————————

Not tried yet…

All the best

Alessandro Fogar


May 7, 2006 | 8:46 am

Thanks for these tips, I missed them. I’ve got this patch working now on a 10.3.5 system.

Cheers,
Leigh


May 7, 2006 | 9:04 am

While you are at it, you might also want to check out the help patch for
gpr.peaks. It is sort of related, tracking the N current peaks
(frequency and amplitude) in the specter.

Best,
Trond


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