Forums > MaxMSP

using ioscbank~ to resynth audio input to pfft~

June 18, 2007 | 8:18 am

Hello,

Quite simply i would like to know if & how this can be done, & if anyone has a simple working example?

if i put ioscbank~ in the pfft subpatch, then i can’t get the resynthed audio out

if i put it outside the fft patch, i have frame syncronisation issues

i assume that framesync messages to ioscbank~ are designed with exactly this sort of application in mind?

& 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~…

had a quick crack at this today – dismal failure

any assistance/ simple examples welcomed

cheers

Tim


June 18, 2007 | 2:26 pm


June 18, 2007 | 4:22 pm

because fft


June 20, 2007 | 11:21 am

mmm, thanks to the respondees – obviously more complex than i would have hoped.

essentially all i wanted to do was use ioscbank~ to resynthesise any bins that were above any amplitude dependant gate threshhold. (spectral gate being pretty trivial … < = + vectral~ to smooth...)

I might look at silencing prominent spectral bins (& resynthesising those "missing partials" in the input signal) based on frequencies identified by fiddle~ instead. easier way to simply extract "a handful of prominent partials" it seems

perhaps this thread will be resurrected if someone happens to stumble upon a simple implementation at a later date.

Yes, i am primarily a Csounder these days. Looks like i’ll be continuing any sine oscillator bank based fft resynthesis there for the mo. Although the "out the box" opcode solution there lacks the "under the hood" (or in the box even…) flexibility that i hoped a pfft~ based approach would provide.

any more in depth comparison/ analysis probably belongs on the Csound list. & Lord knows they hear enough deranged rambling from me already…

feel free to introduce the thread on that list anyone who happens to be active there. But I’m a bit all over the shop at the mo. So many DSP projects, add in a desire to compose to boot… & so little time….

when does anyone get around to actually making any music?


June 20, 2007 | 12:03 pm

Hi Tim,
So we meet again!
There is an fftease object that does this (called something like thresh~).
You can also use pvstencil and pvsadsyn opcodes with csound~ to resynthesise
only bins above a threshold.

If you are going to do this sort of thing manualy in max/msp I would take a
look at ftm/gabor externals although I’ve never used them for fft they seem
easier to deal with as there is an object for partial tracking and so on.
You may also want to look at Iana~ external from IRCAM (not free though)
which I find very useful.

Best
Peiman

On 20/06/07, Tim wrote:
>
>
> mmm, thanks to the respondees – obviously more complex than i would have
> hoped.
>
> essentially all i wanted to do was use ioscbank~ to resynthesise any bins
> that were above any amplitude dependant gate threshhold. (spectral gate
> being pretty trivial … < = + vectral~ to smooth...)
>
> I might look at silencing prominent spectral bins (& resynthesising those
> "missing partials" in the input signal) based on frequencies identified by
> fiddle~ instead. easier way to simply extract "a handful of prominent
> partials" it seems
>
> perhaps this thread will be resurrected if someone happens to stumble upon
> a simple implementation at a later date.
>
> Yes, i am primarily a Csounder these days. Looks like i’ll be continuing
> any sine oscillator bank based fft resynthesis there for the mo. Although
> the "out the box" opcode solution there lacks the "under the hood" (or in
> the box even…) flexibility that i hoped a pfft~ based approach would
> provide.
>
> any more in depth comparison/ analysis probably belongs on the Csound
> list. & Lord knows they hear enough deranged rambling from me already…
>
> feel free to introduce the thread on that list anyone who happens to be
> active there. But I’m a bit all over the shop at the mo. So many DSP
> projects, add in a desire to compose to boot… & so little time….
>
> when does anyone get around to actually making any music?
>


June 20, 2007 | 1:58 pm

http://www.cycling74.com/forums/index.php?t=msg&goto=92306&rid=5769&S=6be64d5e85cf0f14859438235bc056f1#msg_92306

pieman i searched for posts by you & i found the above thread. Maybe this is what i’m barking at.I’ve heard of SDIF (Csound) but not explored

casual reader (yes you!) may also find it interesting/ on topic hence i put the link here…


June 21, 2007 | 10:05 am

Tim schrieb:
> perhaps this thread will be resurrected if someone happens to stumble
> upon a simple implementation at a later date.

We are just working on a mxj~ based solution inside pfft~. It sounds
quite promising, but doesn’t use oscbank~, its resynthesizing the
frequencies with fft technology, because in our case it has to go back
through fftout~ as we recombine it with the noise part and we just did
it that way…

It will go into a "Spectral Toolkit" to tweak sounds in a spectral way
of thinking…

> Although the "out the box" opcode solution there lacks the "under the
> hood" (or in the box even…) flexibility that i hoped a pfft~ based
> approach would provide.

Just wait a bit… ;-)

> when does anyone get around to actually making any music?

Yes, a common problem, get organised, and reserve some fixed time for it…


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


June 22, 2007 | 10:52 am

Thanks Stefan,

I (& I’m sure many others) look forward to checking out your Spectral Toolkit in due course.

I’ll keep my eyes peeled for any announcements.

best wishes

(some call him…) Tim (cue thunderbolts & dead rabbits…)


June 22, 2007 | 11:51 am

Hello,

Here is a patch I made sometime ago for reading SDIF data. It’s mono and not
perfect I know, but it works (at leas on OS X) :-)
Peiman

#P user ezdac~ 35 344 79 377 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 118 138 50 196617 1TRC;
#P noclick;
#P button 104 138 15 0;
#P noclick;
#P hidden newex 403 -82 55 196617 delay 100;
#P hidden newex -79 125 60 196617 loadmess 0;
#P hidden newex -88 104 60 196617 loadmess 1;
#P hidden message 221 60 14 196617 0;
#P hidden newex 332 61 43 196617 route 0;
#P hidden newex 246 9 43 196617 route 1;
#N vpatcher 962 44 1376 285;
#P origin 12 -5;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P comment 262 186 100 196617 scale smooth time;
#P number 226 160 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 87 204 51 196617 pack 0. 0;
#P hidden newex 87 225 40 196617 line 0.;
#P number 226 184 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 15 316 51 196617 pack 0. 0;
#P hidden newex 15 337 40 196617 line 0.;
#P comment 261 161 100 196617 shift smooth time;
#P hidden outlet 110 369 15 0;
#P hidden newex 126 290 35 196617 * 10.;
#P hidden newex 11 252 48 196617 pack 0 0;
#P hidden message 280 341 14 196617 0;
#P comment 299 121 100 196617 record auto;
#P window linecount 2;
#P comment 247 37 126 196617 record/play-back and loop automations;
#P window linecount 1;
#P hidden newex 367 469 35 196617 del 10;
#P hidden newex 367 440 30 196617 sel 0;
#P hidden newex 367 416 27 196617 gate;
#P comment 321 67 26 196617 loop;
#P toggle 306 66 15 0;
#P hidden button 280 314 15 0;
#P hidden newex 250 368 40 196617 mtr 2;
#P window setfont "Sans Serif" 12.;
#P message 250 91 50 196620 stop;
#P message 250 64 50 196620 play;
#B color 9;
#P message 250 118 49 196620 record;
#B color 9;
#P hidden outlet 11 364 15 0;
#P window setfont "Sans Serif" 9.;
#P hidden newex 11 291 41 196617 * 0.02;
#P user pictslider 11 22 208 178 4 4 4 4 SliderDefaultKnob.pct 1
SliderDefaultBkgnd.pct 1 2163 0 6553600 -6553400 1. 1.;
#P hidden connect 6 1 0 0;
#P hidden connect 0 0 16 0;
#P hidden connect 0 0 1 0;
#P hidden connect 20 0 2 0;
#P hidden connect 1 0 21 0;
#P hidden connect 21 0 20 0;
#P hidden connect 0 1 16 1;
#P hidden connect 22 0 21 1;
#P hidden connect 17 0 24 0;
#P hidden connect 24 0 23 0;
#P hidden connect 23 0 18 0;
#P hidden connect 0 1 17 0;
#P hidden connect 25 0 24 1;
#P hidden connect 12 0 4 0;
#P hidden connect 4 0 6 0;
#P hidden connect 3 0 6 0;
#P hidden connect 5 0 6 0;
#P hidden connect 16 0 6 1;
#P hidden connect 5 0 7 0;
#P hidden connect 4 0 7 0;
#P hidden connect 7 0 15 0;
#P hidden connect 15 0 6 2;
#P hidden connect 8 0 10 0;
#P hidden connect 10 0 11 0;
#P hidden connect 11 0 12 0;
#P hidden connect 6 2 10 1;
#P pop;
#P newobj 138 177 76 196617 p more control;
#B color 10;
#P comment 49 264 100 196617 scale;
#P user multiSlider 138 205 117 31 0.1 5. 1 2680 47 0 0 2 0 0 0;
#M frgb 44 63 221;
#M brgb 213 217 249;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#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 hidden newex 374 -57 49 196617 delay 15;
#P toggle 214 93 42 0;
#P window setfont "Sans Serif" 14.;
#P comment 122 309 55 196622 Filter;
#P user rslider 38 288 218 22 12000 1 0 12 0;
#P window setfont "Sans Serif" 9.;
#P hidden message 187 339 112 196617 frequencymaximum $1;
#B color 12;
#P hidden message -90 312 109 196617 frequencyminimum $1;
#B color 12;
#P flonum 187 312 69 9 0. 0 1 3 0 0 0 156 179 255 222 222 222 0 0 0;
#P flonum 38 313 76 9 0. 0 1 3 0 0 0 156 179 255 222 222 222 0 0 0;
#P hidden message -73 288 90 196617 frequency-add $1;
#B color 9;
#P flonum 87 249 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user multiSlider 87 166 35 81 -500. 500. 1 2937 47 0 0 2 0 0 0;
#M frgb 102 102 204;
#M brgb 207 211 240;
#M rgb2 102 102 240;
#M rgb3 102 102 240;
#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 flonum 44 249 36 9 0.1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user multiSlider 44 166 35 81 0.5 4. 1 2937 47 0 0 2 0 0 0;
#M frgb 102 102 204;
#M brgb 207 211 240;
#M rgb2 102 102 240;
#M rgb3 102 102 240;
#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 hidden message -72 267 95 196617 frequency-scale $1;
#B color 9;
#P hidden newex 1 0 89 196617 prepend sinusoids;
#B color 5;
#P hidden newex 1 22 76 196617 res-transform;
#P hidden message 465 -222 536 196617 "Macintosh
HD:/Users/peimankhosravi/Desktop/bell_attack_4.sdif";
#P hidden newex 465 -249 62 196617 prepend set;
#P hidden newex 399 -247 62 196617 prepend set;
#P hidden newex 332 -247 62 196617 prepend set;
#P hidden newex 332 -343 20 196617 t b;
#P hidden newex 332 -321 61 196617 delay 1000;
#P flonum 138 239 35 9 0.1 4. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 332 -184 29 196617 * 1.;
#P hidden newex 170 -474 143 196617 prepend read-stream-number;
#P comment 53 75 149 196617 < - click to select SDIF file;
#P hidden newex 170 -448 49 196617 append 0;
#P button 35 72 18 11;
#P hidden newex 170 -497 55 196617 opendialog;
#P hidden message 332 -137 34 196617 1. $1;
#P hidden newex 332 -160 29 196617 t f b;
#P hidden message 370 -137 26 196617 0. 5;
#P hidden newex 332 -204 47 196617 * 1000.;
#P hidden newex 33 -117 53 196617 * 0.0001;
#P hidden newex 1 -24 57 196617 threefates;
#B color 5;
#P hidden message 358 -78 33 196617 clear;
#P hidden newex 332 -112 40 196617 line 0.;
#P user multiSlider 35 93 178 42 0. 1. 1 2936 47 0 0 2 0 0 0;
#M frgb 102 102 204;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 102 102 204;
#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 flonum 35 138 43 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P noclick;
#P hidden message 1 -75 141 196617 tuples time $1 columns 1 2 3;
#P hidden newex 84 20 57 196617 sinusoids~;
#B color 5;
#P hidden newex 1 -53 98 196617 SDIF-tuples ss-toot;
#B color 5;
#P hidden newex 170 -361 99 196617 sdif-buffer ss-toot;
#B color 5;
#P hidden flonum 332 -225 48 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 332 -269 212 196617 OSC-route /maxTime /frameType /filename;
#P hidden button 247 29 14 11;
#P hidden newex 332 -298 88 196617 SDIF-info ss-toot;
#B color 5;
#P comment 173 240 52 196617 speed;
#P comment 210 75 54 196617 start loop;
#P hidden user gswitch 334 -22 41 32 1 0;
#P comment 88 264 92 196617 shift;
#P user panel 35 284 228 49;
#X brgb 255 255 255;
#X frgb 19 1 181;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 35 157 96 124;
#X brgb 255 255 255;
#X frgb 1 51 247;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 132 157 131 124;
#X brgb 255 255 255;
#X frgb 3 1 197;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 21 49 258 346;
#X brgb 227 226 253;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 37 0 38 0;
#P hidden connect 10 2 37 0;
#P hidden connect 59 0 23 0;
#P hidden connect 59 0 63 0;
#P hidden connect 10 1 36 0;
#P hidden connect 18 1 19 0;
#P hidden connect 18 1 54 0;
#P hidden connect 24 1 23 0;
#P hidden connect 54 0 5 2;
#P hidden connect 63 0 19 0;
#P hidden connect 32 0 31 1;
#P hidden connect 53 0 58 0;
#P hidden connect 53 0 59 0;
#P hidden connect 53 0 5 0;
#P hidden connect 25 0 18 0;
#P hidden connect 23 0 18 0;
#P hidden connect 24 0 25 0;
#P hidden connect 31 0 24 0;
#P hidden connect 22 0 31 0;
#P hidden connect 11 0 21 1;
#P hidden connect 11 0 22 0;
#P hidden connect 9 0 11 0;
#P hidden connect 35 0 11 0;
#P hidden connect 5 0 11 0;
#P hidden connect 10 0 35 0;
#P hidden connect 8 0 10 0;
#P hidden connect 33 0 64 0;
#P hidden connect 33 0 8 0;
#P hidden connect 34 0 33 0;
#P hidden connect 28 0 12 0;
#P hidden connect 28 0 34 0;
#P hidden connect 58 0 9 0;
#P hidden connect 27 0 26 0;
#P hidden connect 27 0 60 0;
#P hidden connect 60 0 53 0;
#P hidden connect 48 0 50 0;
#P hidden connect 51 1 48 0;
#P hidden connect 30 0 28 0;
#P hidden connect 26 0 30 0;
#P hidden connect 55 0 32 0;
#P hidden connect 61 0 42 0;
#P hidden connect 61 0 55 0;
#P hidden connect 36 0 65 0;
#P hidden connect 44 0 45 0;
#P hidden connect 62 0 44 0;
#P hidden connect 57 1 44 0;
#P hidden connect 39 0 14 0;
#P hidden connect 19 0 14 0;
#P hidden connect 14 0 66 0;
#P hidden connect 14 0 66 1;
#P hidden connect 42 0 43 0;
#P hidden connect 57 0 42 0;
#P hidden connect 51 0 47 0;
#P hidden connect 17 0 16 0;
#P hidden connect 18 0 17 0;
#P hidden connect 16 0 21 0;
#P hidden connect 46 0 39 0;
#P hidden connect 41 0 39 0;
#P hidden connect 50 0 39 0;
#P hidden connect 49 0 39 0;
#P hidden connect 40 0 39 0;
#P hidden connect 20 0 40 0;
#P hidden connect 13 0 20 0;
#P hidden connect 15 0 13 0;
#P hidden connect 21 0 15 0;
#P hidden connect 43 0 41 0;
#P hidden connect 45 0 46 0;
#P hidden connect 47 0 49 0;
#P window clipboard copycount 67;

On 22/06/07, Tim wrote:
>
>
> Thanks Stefan,
>
> I (& I’m sure many others) look forward to checking out your Spectral
> Toolkit in due course.
>
> I’ll keep my eyes peeled for any announcements.
>
> best wishes
>
> (some call him…) Tim (cue thunderbolts & dead rabbits…)
>


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