Forums > MaxMSP

Spectral Delay

June 25, 2006 | 12:50 am

Hi,

I am thinking of learning the way to build a spectral delay patch in Max/MSP. I found a related patch in the forum archieve, but it crashes on PC and lack "Lifo" object in Mac. I tried to download Lobject pack but found that "Lifo" object in the pack does not work in OS X.

I was wondering if there is any good article or functioning patch for learning about spectral delay in addition to Dr. David Kim-Boyle’s article "Spectral Delays with Frequency Domain Processing".

Please help if you could.

Thanks.

Chien-Wen


June 26, 2006 | 9:46 am

Hi Chien-Wen,
I did some simple experiments with a spectral delay. Maybe it turns
out to be helpful for you…
Cheers,
Johannes

————Save this with the name "spectral-delay-
subpatch.pat"—————
max v2;
#N vpatcher 35 44 1157 755;
#P origin 37 0;
#P window setfont "Sans Serif" 20.;
#P flonum 648 249 102 20 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 207 462 140 196628 frameaccum~;
#P newex 207 221 125 196628 phasewrap~;
#P newex 207 162 125 196628 framedelta~;
#P newex 428 338 134 196628 sampstoms~;
#P newex 598 122 94 196628 loadbang;
#P newex 599 163 81 196628 fftinfo~;
#P newex 428 263 78 196628 *~ 256;
#P newex 428 187 95 196628 round~ 1;
#P newex 428 126 127 196628 index~ gogo;
#P newex 207 349 104 196628 tapout~ 0;
#P newex 207 280 160 196628 tapin~ 100000;
#P newex 8 346 104 196628 tapout~ 0;
#P newex 8 280 160 196628 tapin~ 100000;
#P newex 72 530 99 196628 poltocar~;
#P newex 52 116 99 196628 cartopol~;
#P newex 72 651 97 196628 fftout~ 1;
#P newex 52 67 386 196628 fftin~ 1;
#P fasten 2 0 4 0 57 214 13 214;
#P fasten 13 0 5 0 433 389 368 389 368 329 13 329;
#P connect 4 0 5 0;
#P connect 0 0 2 0;
#P connect 5 0 3 0;
#P connect 3 0 1 0;
#P fasten 0 1 2 1 245 108 146 108;
#P connect 3 1 1 1;
#P connect 16 0 3 1;
#P fasten 2 1 14 0 146 155 212 155;
#P connect 14 0 15 0;
#P connect 15 0 6 0;
#P fasten 13 0 7 0 433 380 385 380 385 337 212 337;
#P connect 6 0 7 0;
#P connect 7 0 16 0;
#P connect 0 2 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 13 0;
#P fasten 11 1 10 1 627 241 501 241;
#P connect 12 0 11 0;
#P connect 11 1 17 0;
#P pop;

————Here is the main patch—————
max v2;
#N vpatcher 29 44 1193 843;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P message 122 63 50 196620 loop 1;
#P toggle 12 51 28 0;
#P message 52 42 85 196620 open talk.aif;
#P window setfont "Sans Serif" 20.;
#P comment 381 31 54 196628 high;
#P comment 389 597 54 196628 low;
#P comment 408 439 20 196628 h;
#P comment 408 384 20 196628 c;
#P comment 408 329 20 196628 t;
#P comment 408 274 20 196628 i;
#P comment 408 219 20 196628 p;
#P window setfont "Sans Serif" 18.;
#P comment 448 670 313 196626 time (from 0 to 500 FFT-frames);
#P newex 47 139 331 196626 pfft~ spectral-delay-subpatch 512 4;
#P user multiSlider 451 34 645 605 0. 500. 256 2680 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#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 toggle 12 179 30 0;
#P window setfont "Sans Serif" 20.;
#P newex 50 222 70 196628 dac~;
#N sfplay~ 1 120960 0 ;
#P newobj 46 96 81 196628 sfplay~;
#P window setfont "Sans Serif" 9.;
#N vpatcher 10 59 613 566;
#P window setfont "Sans Serif" 20.;
#P newex 50 50 47 196628 t l b;
#P window setfont "Sans Serif" 14.;
#P message 189 170 60 196622 set 0;
#P window setfont "Sans Serif" 20.;
#P newex 50 264 100 196628 pack 0 0.;
#P newex 50 165 51 196628 t b f;
#N counter 1 256 1;
#X flags 0 0;
#P newobj 50 219 167 196628 counter 1 256 1;
#P newex 50 124 105 196628 zl group 1;
#P newex 51 305 124 196628 peek~ gogo;
#P newex 52 364 168 196628 buffer~ gogo 30;
#P inlet 50 30 15 0;
#P connect 0 0 8 0;
#P connect 8 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P fasten 7 0 4 0 194 205 55 205;
#P connect 4 0 6 0;
#P connect 6 0 2 0;
#P connect 5 1 6 1;
#P fasten 8 1 7 0 100 113 194 113;
#P pop;
#P newobj 451 645 89 196617 p CREATE BUFFER;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 12.;
#P hidden newex 52 50 61 196620 loadbang;
#P hidden newex 50 102 83 196620 random 200;
#P hidden newex 53 75 54 196620 uzi 256;
#P hidden newex 51 126 85 196620 zl group 256;
#P outlet 51 153 15 0;
#P hidden connect 2 0 3 0;
#P hidden connect 3 0 1 0;
#P connect 1 0 0 0;
#P hidden connect 4 0 2 0;
#P pop;
#P newobj 451 15 36 196617 p INIT;
#P connect 15 0 2 0;
#P connect 16 0 2 0;
#P connect 17 0 2 0;
#P connect 2 0 6 0;
#P connect 4 0 3 0;
#P connect 6 0 3 0;
#P connect 6 0 3 1;
#P connect 0 0 5 0;
#P connect 5 0 1 0;
#P pop;


June 26, 2006 | 10:31 pm

Wow, that’s a very clean patch and works quite well.
It helps a lot.
Great thanks.


June 27, 2006 | 2:03 pm

Nice patch, with some interesting interface possibilities.

– Paul


—– |(*,+,#,=)(#,=,*,+)(=,#,+,*)(+,*,=,#)| —–


June 28, 2006 | 1:08 am

Since delay is more fun with feedback, I added feedback control to the patch.

The pitch kept slowly rising on me which was unexpected. I adjusted the signal vector size from 64 to 128 and it stopped, even when I set the signal vector back to 64. Curious.

Save as "spectral-delay-feedback.pfft"

max v2;
#N vpatcher 18 60 1140 771;
#P origin 37 0;
#P window setfont "Sans Serif" 20.;
#P newex 744 118 225 196628 index~ gogo-feedback;
#P window setfont "Sans Serif" 9.;
#P newex 186 591 35 196617 *~ 0.;
#P newex 83 584 35 196617 *~ 0.;
#P window setfont "Sans Serif" 20.;
#P flonum 648 249 102 20 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 207 462 140 196628 frameaccum~;
#P newex 207 221 125 196628 phasewrap~;
#P newex 207 162 125 196628 framedelta~;
#P newex 428 338 134 196628 sampstoms~;
#P newex 598 122 94 196628 loadbang;
#P newex 599 163 81 196628 fftinfo~;
#P newex 428 263 78 196628 *~ 256;
#P newex 428 187 95 196628 round~ 1;
#P newex 428 126 127 196628 index~ gogo;
#P newex 207 349 104 196628 tapout~ 0;
#P newex 207 280 160 196628 tapin~ 100000;
#P newex 8 346 104 196628 tapout~ 0;
#P newex 8 280 160 196628 tapin~ 100000;
#P newex 72 530 99 196628 poltocar~;
#P newex 52 116 99 196628 cartopol~;
#P newex 72 651 98 196628 fftout~ 1;
#P newex 52 67 386 196628 fftin~ 1;
#P fasten 2 0 4 0 57 214 13 214;
#P fasten 13 0 5 0 433 389 368 389 368 329 13 329;
#P connect 4 0 5 0;
#P fasten 18 0 2 0 88 619 24 619 24 109 57 109;
#P connect 0 0 2 0;
#P connect 5 0 3 0;
#P connect 3 0 1 0;
#P connect 3 0 18 0;
#P connect 20 0 18 1;
#P fasten 19 0 2 1 191 624 292 624 292 111 146 111;
#P fasten 0 1 2 1 245 108 146 108;
#P connect 3 1 1 1;
#P connect 16 0 3 1;
#P connect 3 1 19 0;
#P fasten 2 1 14 0 146 155 212 155;
#P connect 14 0 15 0;
#P connect 15 0 6 0;
#P fasten 13 0 7 0 433 380 385 380 385 337 212 337;
#P connect 6 0 7 0;
#P connect 7 0 16 0;
#P connect 20 0 19 1;
#P connect 0 2 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 13 0;
#P fasten 11 1 10 1 627 241 501 241;
#P connect 12 0 11 0;
#P connect 11 1 17 0;
#P connect 0 2 20 0;
#P pop;

save as "spectral-delay-feedback-wrapper"

max v2;
#N vpatcher 60 44 1224 843;
#P origin 0 15;
#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P comment 82 460 313 196626 feedback (0.-1.);
#P user multiSlider 44 283 333 171 0. 1. 256 2680 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#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 window setfont "Sans Serif" 9.;
#N vpatcher 10 59 613 566;
#P window setfont "Sans Serif" 20.;
#P newex 50 50 47 196628 t l b;
#P window setfont "Sans Serif" 14.;
#P message 189 170 60 196622 set 0;
#P window setfont "Sans Serif" 20.;
#P newex 50 264 100 196628 pack 0 0.;
#P newex 50 165 51 196628 t b f;
#N counter 1 256 1;
#X flags 0 0;
#P newobj 50 219 167 196628 counter 1 256 1;
#P newex 50 124 105 196628 zl group 1;
#P newex 51 305 222 196628 peek~ gogo-feedback;
#P newex 52 364 266 196628 buffer~ gogo-feedback 30;
#P inlet 50 30 15 0;
#P connect 0 0 8 0;
#P connect 8 0 3 0;
#P connect 3 0 5 0;
#P fasten 7 0 4 0 194 205 55 205;
#P connect 5 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 2 0;
#P connect 5 1 6 1;
#P fasten 8 1 7 0 100 113 194 113;
#P pop;
#P newobj 44 491 89 196617 p CREATE BUFFER;
#N vpatcher 10 59 610 459;
#P inlet 140 39 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 50 146 41 196617 * 0.01;
#P window setfont "Sans Serif" 12.;
#P hidden newex 52 50 61 196620 loadbang;
#P hidden newex 50 102 83 196620 random 100;
#P hidden newex 53 75 54 196620 uzi 256;
#P hidden newex 50 208 85 196620 zl group 256;
#P outlet 50 235 15 0;
#P hidden connect 2 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 1 0;
#P connect 1 0 0 0;
#P connect 6 0 2 0;
#P hidden connect 4 0 2 0;
#P pop;
#P newobj 45 260 36 196617 p INIT;
#P user meter~ 149 222 229 235 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 188 184 268 197 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P window setfont "Sans Serif" 12.;
#P message 122 48 50 196620 loop 1;
#P toggle 12 36 28 0;
#P message 52 27 85 196620 open talk.aif;
#P window setfont "Sans Serif" 20.;
#P comment 381 16 54 196628 high;
#P comment 389 582 54 196628 low;
#P comment 408 424 20 196628 h;
#P comment 408 369 20 196628 c;
#P comment 408 314 20 196628 t;
#P comment 408 259 20 196628 i;
#P comment 408 204 20 196628 p;
#P window setfont "Sans Serif" 18.;
#P comment 448 655 313 196626 time (from 0 to 500 FFT-frames);
#P newex 47 124 370 196626 pfft~ spectral-delay-feedback.pfft 512 4;
#P user multiSlider 451 21 645 605 0. 500. 256 2680 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#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 toggle 12 164 30 0;
#P window setfont "Sans Serif" 20.;
#P newex 50 207 70 196628 dac~;
#N sfplay~ 1 120960 0 ;
#P newobj 46 81 81 196628 sfplay~;
#P window setfont "Sans Serif" 9.;
#N vpatcher 10 59 613 566;
#P window setfont "Sans Serif" 20.;
#P newex 50 50 47 196628 t l b;
#P window setfont "Sans Serif" 14.;
#P message 189 170 60 196622 set 0;
#P window setfont "Sans Serif" 20.;
#P newex 50 264 100 196628 pack 0 0.;
#P newex 50 165 51 196628 t b f;
#N counter 1 256 1;
#X flags 0 0;
#P newobj 50 219 167 196628 counter 1 256 1;
#P newex 50 124 105 196628 zl group 1;
#P newex 51 305 124 196628 peek~ gogo;
#P newex 52 364 168 196628 buffer~ gogo 30;
#P inlet 50 30 15 0;
#P connect 0 0 8 0;
#P connect 8 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P fasten 7 0 4 0 194 205 55 205;
#P connect 4 0 6 0;
#P connect 6 0 2 0;
#P connect 5 1 6 1;
#P fasten 8 1 7 0 100 113 194 113;
#P pop;
#P newobj 451 630 89 196617 p CREATE BUFFER;
#N vpatcher 10 59 610 459;
#P inlet 162 48 15 0;
#P window setfont "Sans Serif" 12.;
#P hidden newex 52 50 61 196620 loadbang;
#P hidden newex 50 102 83 196620 random 200;
#P hidden newex 53 75 54 196620 uzi 256;
#P hidden newex 51 126 85 196620 zl group 256;
#P outlet 51 153 15 0;
#P hidden connect 2 0 3 0;
#P hidden connect 3 0 1 0;
#P connect 1 0 0 0;
#P connect 5 0 2 0;
#P hidden connect 4 0 2 0;
#P pop;
#P newobj 451 0 36 196617 p INIT;
#P connect 20 0 22 0;
#P connect 22 0 21 0;
#P connect 15 0 2 0;
#P connect 16 0 2 0;
#P connect 17 0 2 0;
#P connect 2 0 6 0;
#P connect 6 0 3 0;
#P connect 4 0 3 0;
#P connect 6 0 3 1;
#P connect 2 0 18 0;
#P connect 0 0 5 0;
#P connect 5 0 1 0;
#P pop;


June 28, 2006 | 3:55 am

Thanks for sharing.

But the "feedback spectral delay" seems to consume too much CPU. There is certainly a need to make the patch become stereo, which might consume even more CPU.

Still wondering if there is a good way to do that…


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