XML Feeds

.

[maxmsp] using ioscbank~ to resynth audio input to pfft~

volker böhm vboehm at gmx.ch
Mon Jun 18 08:26:24 MDT 2007


On 18 Jun 2007, at 10:18, Tim wrote:
>
> i assume that framesync messages to ioscbank~ are designed with  
> exactly this sort of application in mind?

maybe yes, but i can't provide a working example either - sorry  
(would be curious to see one, though!)
>
> & writing amp & phase data derived from pfft~ input to buffers will  
> of course allow for customisation of the data before resynthesis.  
> I'm planning on taking an arbitrary number of partials above a gate  
> threshhold & resynthesising them with pure sines, maybe with  
> transposition, to create a sort of "exaggerated spectral  
> foreground" to the sound (that's the "artistic" motivation anyway....)
>
> how do i calculated the relevant freq of the bin data from the  
> accumulated phase? that seems to be the parameter that is missing  
> to drive the ioscbank~...

take a look at the attached example. it's easier than to explain in  
words.

but you would also need to do some kind of peak picking/tracking. a  
sinusoid that is not at the centre of a freq bin will spill it's  
energy into the neighoring bins and you don't want to resynth that.  
so you will have to find the local maximae in the spectral envelope  
and test for valid candidates (quite a lot of different approaches to  
achieve this exist - none of them being trivial).

i was playing around with this idea some time ago and came up with a  
somewhat working example patch - not very clean, but working. i use  
java+mxj~ for the peak picking. if this is not your taste, then it  
might not prove very helpful. drop me a line though, if you are  
interested.

but then i see you are on the csound list, too. might be worth using  
some to the pvs opcodes and incorporate those in max through csound~,  
no?

greets,
volker.



/* save this as trueF.pfft */

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 406 137 48 196617 s fftsize;
#P newex 112 405 63 196617 poke~ trueF;
#P newex 261 200 107 196617 expr 6.283185 / $f1;
#P comment 268 177 100 196617 * 2¹ / oversamp;
#P newex 112 359 122 196617 +~;
#P newex 261 287 140 196617 expr $f1 / (2*3.14159263);
#P newex 112 326 81 196617 *~ 2.;
#P newex 112 291 64 196617 phasewrap~;
#P newex 112 259 38 196617 -~;
#P comment 453 115 56 196617 fft size;
#P comment 522 115 56 196617 hop size;
#P number 466 170 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 466 138 27 196617 / 1.;
#P number 438 99 46 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 506 99 46 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 438 72 113 196617 fftinfo~;
#P newex 140 228 65 196617 *~ 3.14159;
#P hidden newex 153 163 67 196617 poke~ pDelta;
#P newex 112 124 65 196617 framedelta~;
#P newex 54 90 68 196617 cartopol~;
#P newex 54 63 134 196617 fftin~ 1;
#P comment 513 172 84 196617 oversampling;
#P comment 278 269 100 196617 * oversamp/2¹;
#P connect 2 0 3 0;
#P connect 2 1 3 1;
#P connect 3 1 4 0;
#P connect 4 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 18 0;
#P connect 18 0 21 0;
#P hidden connect 2 2 21 1;
#P fasten 2 2 6 0 183 217 145 217;
#P connect 6 0 14 1;
#P hidden connect 4 0 5 0;
#P hidden connect 2 2 5 1;
#P connect 17 0 16 1;
#P connect 20 0 6 1;
#P fasten 2 2 18 1 183 97 229 97;
#P fasten 11 0 20 0 471 192 266 192;
#P fasten 11 0 17 0 471 236 266 236;
#P hidden connect 9 0 22 0;
#P connect 7 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 11 0;
#P connect 8 0 10 1;
#P connect 7 2 8 0;
#P window clipboard copycount 23;



/* main patch */

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 51 27 66 196617 loadmess 23;
#P flonum 271 250 56 9 0 0 0 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 329 252 54 196617 Hz;
#P newex 271 224 29 196617 * 1.;
#P comment 300 203 54 196617 binFreq;
#P flonum 51 173 58 9 0 0 0 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 110 175 54 196617 Hz;
#P newex 51 143 29 196617 * 1.;
#P newex 334 54 86 196617 buffer~ trueF 50;
#P user ezdac~ 354 91 398 124 0;
#P number 208 115 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 20 74 620 474;
#P outlet 129 183 15 0;
#P inlet 140 44 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 132 138 27 196617 i;
#P window linecount 0;
#P newex 131 110 34 196617 + 0.5;
#P connect 1 0 3 0;
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 208 95 43 196617 p round;
#P user number~ 208 201 281 216 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221  
221 221 222 222 222 0 0 0;
#P newex 208 144 29 196617 sig~;
#P newex 208 173 67 196617 index~ trueF;
#P comment 100 61 54 196617 binFreq;
#P flonum 51 60 47 9 0 0 0 3 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 51 202 61 196617 cycle~ 100;
#P flonum 82 112 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 20 74 620 474;
#P outlet 184 305 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 192 158 100 196617 sampling rate;
#P button 141 73 15 0;
#P flonum 184 218 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 0;
#P newex 226 76 27 196617 t b i;
#P number 260 141 59 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 226 52 48 196617 r fftsize;
#P newex 184 188 86 196617 / 512.;
#P flonum 184 141 60 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 133 114 61 196617 adstatus sr;
#P comment 272 158 100 196617 fft size;
#P connect 6 0 1 0;
#P connect 8 0 1 0;
#P connect 1 1 2 0;
#P connect 2 0 3 0;
#P connect 3 0 7 0;
#P connect 7 0 10 0;
#P connect 4 0 6 0;
#P connect 6 1 5 0;
#P connect 5 0 3 1;
#P pop;
#P newobj 82 92 74 196617 p deltaBinFreq;
#P newex 51 239 110 196617 pfft~ trueF.pfft 512 4;
#P comment 125 114 54 196617 Hz;
#P fasten 3 0 14 1 87 134 75 134;
#P fasten 3 0 18 1 87 134 295 134;
#P connect 18 0 20 0;
#P connect 9 1 18 0;
#P connect 7 0 9 0;
#P connect 8 0 7 0;
#P connect 11 0 8 0;
#P connect 10 0 11 0;
#P connect 5 0 14 0;
#P fasten 5 0 10 0 56 84 213 84;
#P connect 2 0 3 0;
#P connect 4 0 1 0;
#P connect 16 0 4 0;
#P connect 14 0 16 0;
#P hidden connect 21 0 5 0;
#P window clipboard copycount 22;





More information about the maxmsp mailing list