A couple of queries regarding creating a flanger and a gate effect

Jan 23, 2006 at 7:52pm

A couple of queries regarding creating a flanger and a gate effect

Hi,

I’m trying to create a few effects at the minute but I’ve stumbled across two particular problems. The first is with the flanger effect, I’ve used a sine wave generator I found on these forums to vary the delay on an audio signal, however the delay is very glitchy and constantly clicks. I’m not sure if maybe the numbers need to be synced with the audio samplerate or if I can somehow smooth the transitions:

max v2;
#N vpatcher 73 99 1238 904;
#P origin 0 4;
#P user ezdac~ 232 572 276 605 0;
#P button 384 88 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 384 63 26 9109513 play;
#P message 384 110 14 9109513 1;
#P message 329 106 28 9109513 open;
#N sfplay~ 1 120960 0 ;
#P newobj 384 145 40 9109513 sfplay~;
#P newex 736 354 48 9109513 loadbang;
#P flonum 536 507 57 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 536 478 197 9109513 expr 0.5 * (1 – cos(2 * 3.14159 * $f1));
#P user multiSlider 536 533 196 92 0. 1. 1 3193 15 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 message 736 380 56 9109513 0 , 1 2000;
#P flonum 736 447 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 736 419 40 9109513 line 0.;
#P comment 597 631 76 9109513 Hann (Hanning);
#P user meter~ 884 479 964 492 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 newex 864 447 65 9109513 tapout~ 1000.;
#P newex 865 377 59 9109513 tapin~ 1000.;
#P flonum 536 729 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 536 702 27 9109513 + 8.;
#P newex 107 299 33 9109513 *~ 0.5;
#P newex 287 435 33 9109513 *~ 0.5;
#P user meter~ 456 235 536 248 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~ 107 420 187 433 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 newex 182 363 27 9109513 +~;
#P newex 349 320 52 9109513 delay~ 0.;
#P flonum 991 509 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 536 674 58 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 536 640 33 9109513 * 100.;
#P user meter~ 990 488 1070 501 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 flonum 1033 427 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 987 403 32 9109513 / 100.;
#P newex 989 447 36 9109513 cycle~;
#P inlet 985 358 15 0;
#P connect 27 0 13 0;
#P connect 9 0 10 0;
#P connect 13 0 9 0;
#P connect 12 0 9 1;
#P connect 9 0 32 0;
#P connect 9 0 32 1;
#P connect 8 0 12 0;
#P connect 27 0 8 0;
#P connect 30 0 31 0;
#P connect 31 0 29 0;
#P connect 28 0 27 0;
#P connect 29 0 27 0;
#P connect 14 0 8 1;
#P connect 27 0 11 0;
#P fasten 21 0 24 0 741 470 541 470;
#P connect 24 0 25 0;
#P connect 25 0 23 0;
#P connect 23 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 14 0;
#P connect 14 0 15 0;
#P connect 26 0 22 0;
#P connect 20 1 22 0;
#P connect 22 0 20 0;
#P connect 20 0 21 0;
#P connect 16 0 17 0;
#P connect 17 0 18 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 7 0;
#P connect 2 0 3 0;
#P pop;

The second problem I am having is with the gate effect. The workings behind the effect are sound I think however I need somekind of system that will read ahead a few milliseconds so that the gate can respond to the peaks and dips in time. At the moment the attack is pretty much cut off from the audio. I’m not sure whether there is a specific object that will do this?

max v2;
#N vpatcher 82 44 1166 881;
#P origin 74 36;
#P user ezdac~ 172 716 216 749 0;
#P button 138 139 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 122 106 26 9109513 play;
#P message 168 162 14 9109513 1;
#P message 75 168 28 9109513 open;
#N sfplay~ 1 120960 0 ;
#P newobj 204 239 40 9109513 sfplay~;
#P newex 714 619 45 9109513 loadbang;
#P message 714 650 14 9109513 1;
#P message 397 680 64 9109513 0 13;
#P message 397 654 47 9109513 set $1 $2;
#P user gain~ 62 475 24 100 158 0 1.071519 7.94321 10.;
#P newex 687 731 27 9109513 / 10.;
#P newex 593 592 28 9109513 pack;
#P newex 445 589 28 9109513 pack;
#P flonum 632 775 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 501 565 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user dial 356 519 40 40 250 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P message 593 541 14 9109513 0;
#P message 445 535 28 9109513 1000;
#P newex 445 501 158 9109513 if $i1 == 1 then bang else out2 bang;
#P newex 489 710 53 9109513 line 0 1000;
#P message 575 413 14 9109513 1;
#P newex 530 284 214 9109513 if $f1 >= $f2 & $i3 == 0 then bang else out2 bang;
#P button 464 447 15 0;
#P number 459 408 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 445 468 15 0;
#P message 359 414 14 9109513 0;
#P newex 283 284 209 9109513 if $f1 < $f2 & $i3 == 1 then bang else out2 bang;
#P user meter~ 7 670 87 683 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 flonum 784 142 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 784 109 78 9109513 zmap 0 127 0. 1.;
#P user dial 784 54 40 40 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P flonum 283 100 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user meter~ 248 65 328 78 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 inlet 183 40 15 0;
#P comment 828 62 100 9109513 Threshold;
#P comment 211 39 100 9109513 audio input;
#P comment 291 525 100 9109513 Ramp time;
#P connect 27 0 9 0;
#P connect 32 0 27 0;
#P connect 26 0 27 0;
#P connect 35 0 36 0;
#P connect 36 0 34 0;
#P connect 27 0 37 0;
#P connect 33 0 32 0;
#P connect 34 0 32 0;
#P connect 27 0 37 1;
#P connect 3 0 4 0;
#P connect 32 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 10 0;
#P connect 10 0 11 0;
#P connect 8 0 10 1;
#P connect 25 0 28 0;
#P connect 24 0 28 0;
#P connect 28 0 29 0;
#P connect 13 0 12 0;
#P connect 12 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 24 0;
#P connect 16 0 13 0;
#P connect 11 0 13 0;
#P connect 22 0 24 1;
#P connect 13 0 14 0;
#P connect 13 0 10 2;
#P connect 29 0 17 0;
#P connect 24 0 17 0;
#P connect 25 0 17 0;
#P connect 21 0 22 0;
#P connect 5 0 15 0;
#P connect 30 0 17 2;
#P connect 15 0 16 0;
#P connect 18 1 20 0;
#P connect 20 0 25 0;
#P connect 22 0 25 1;
#P connect 8 0 15 1;
#P connect 17 0 23 0;
#P connect 23 0 26 0;
#P connect 31 0 30 0;
#P connect 13 0 15 2;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P pop;

Cheers for any help you can give me,

Al.

#24061
Jan 23, 2006 at 10:21pm

I only had chance to look at your first patch.

In order to achieve smooth modulation of the delay time you should try using an audio rate signal.

best of luck,

john.

#69027
Jan 24, 2006 at 12:21pm

Alistair wrote:
> The first is with the flanger effect, I’ve used a sine wave generator
> I found on these forums to vary the delay on an audio signal, however
> the delay is very glitchy and constantly clicks.

First advice if yoy hear clicks: Do it completely in the signal domain
-> lots of examples in the archives.
The first thing you have to understand is the fundamental difference
between signal domain and scheduler world. Scheduler events happen only
every millisecond or so…

> I need somekind of system that will read ahead a few milliseconds
> so that the gate can respond to the peaks and dips in time.
> At the moment the attack is pretty much cut off from the audio.
> I’m not sure whether there is a specific object that will do this?

You used it in your previous patch: delay~ or a tapin~ tapout~ combo…

Stefan

[][] [][][] [][] [][][] [][] [][][] [][] [][][]
[][][][][][][][][][][][][][][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—
–_____———–|———-
–(_|_ —-|—–|—–()—
– _|_)—-|—–()———-
———-()————x—-

14, Av. Pr. Franklin Roosevelt, 94320 Thiais, France
Phone at CCMIX +33-1-49 77 51 72

#69028
Jan 24, 2006 at 6:25pm

Hi,

Thanks yes I had already thought about using a delay unit however it’s just that this creates alot more work for me and I was hoping for another way around. Anyway, if this is the only way of doing it then that will have to do.

I’ve managed to create a flanger which is working perfectly now by using curve~ and allpass~. It’s all pretty smooth and nice.

Cheers,

Al.

#69029
Apr 15, 2006 at 4:10pm

Hi, i’ve been trying to make a flanger and have been having the same difficulties that have been mentioned previously: clicks when the delay time is changed. I can’t figure out a way of changing them at audio rate as the delay~ object will not accept audio rate delay times. I have a few different oscillators that can be chosen to sweep through the delay time range (0-10 ms) but am gettting horrible sounds out of it. Someone mentioned creating one with curve~ and allpass~ and I’d be interested to know how this was done. As i stare trying to think of a solution i find my sanity slowly slipping away from me. If anyone could offer any hints or tips i’d be very grateful indeed.

Oh, another thing, one member mentioned that there were plenty of examples in the ‘archive’, where is this archive? I see the message was posted some time ago so maybe that page has since been removed, but if it’s still about would someone kindly tell me where?

Many thanks.

#69030
Apr 15, 2006 at 9:36pm

Hi, this isn’t my latest version but it should help you out. I think I may have done some long winded stuff there that could be alot simpler but it works for me anyhow!

You may want to try tapin and tapout instead of allpass~.

max v2;
#N vpatcher 24 27 1022 929;
#P origin 169 -76;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 614 39 102 9109513 scale 40 5040 5040 40;
#N comlet Input Gain;
#P inlet 413 231 15 0;
#P newex 413 266 78 9109513 zmap 0 127 0. 2.;
#P newex 247 301 33 9109513 *~ 0.;
#N comlet Audio in signal;
#P outlet 335 368 15 0;
#P newex 175 650 33 9109513 pass~;
#N comlet audio in (for testing);
#P inlet 371 212 15 0;
#N comlet mute;
#P inlet 62 132 15 0;
#P message 808 408 14 9109513 1;
#P newex 808 370 45 9109513 loadbang;
#P newex 318 527 32 9109513 / 100.;
#N comlet mix;
#P inlet 318 506 15 0;
#N comlet speed;
#P inlet 614 21 15 0;
#P button 891 237 15 0;
#P button 673 240 15 0;
#P message 835 270 148 9109513 0. , 0.5 2540 0.5 1. 2540 -0.5;
#P message 861 136 52 9109513 prepend 0.;
#P message 800 136 50 9109513 prepend \,;
#P message 708 234 109 9109513 set 0.5 $1 0.5 1. $1 -0.5;
#P message 637 208 52 9109513 prepend 1.;
#P newex 800 96 28 9109513 del 2;
#P newex 740 96 28 9109513 del 1;
#P button 740 72 15 0;
#P message 740 136 50 9109513 prepend \,;
#P window linecount 2;
#P message 614 270 88 9109513 1. , 0.5 2540 0.5 0. 2540 -0.5;
#P window linecount 1;
#P message 614 136 109 9109513 set 0.5 $1 0.5 0. $1 -0.5;
#P newex 718 472 158 9109513 if $i1 == 1 then bang else out2 bang;
#P number 718 447 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter 1;
#X flags 0 0;
#P newobj 718 408 66 9109513 counter 1;
#P user scope~ 660 507 800 579 1024 3 64 0. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P newex 660 362 40 9109513 curve~;
#P newex 246 559 33 9109513 *~ 0.5;
#P flonum 396 426 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 424 361 78 9109513 zmap 0 127 0. 5.;
#P newex 484 425 27 9109513 *~;
#P newex 247 361 44 9109513 delay~ 8;
#P newex 247 463 42 9109513 allpass~;
#P user meter~ 256 610 336 623 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 newex 175 361 33 9109513 *~ 0.5;
#P newex 233 196 124 9109513 receive~ distortion1flanger1;
#P newex 219 164 135 9109513 receive~ compressor1flanger1;
#P newex 176 137 119 9109513 receive~ sampler2flanger1;
#P newex 102 111 119 9109513 receive~ sampler1flanger1;
#P newex 304 253 27 9109513 +~;
#P user meter~ 62 681 142 694 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 newex 175 622 27 9109513 +~;
#N comlet;
#P outlet 175 710 15 0;
#N comlet depth;
#P inlet 424 329 15 0;
#P comment 444 331 100 9109513 depth;
#P comment 436 233 100 9109513 input gain;
#P comment 62 113 29 9109513 mute;
#P comment 363 198 100 9109513 audio in;
#P comment 318 486 100 9109513 mix;
#P comment 631 22 100 9109513 speed;
#P fasten 8 0 9 0 180 646 67 646;
#P fasten 50 0 15 0 252 343 180 343;
#P fasten 22 0 8 0 251 600 180 600;
#P connect 15 0 8 0;
#P connect 8 0 48 0;
#P connect 48 0 7 0;
#P connect 17 0 22 0;
#P fasten 10 0 50 0 309 287 252 287;
#P connect 50 0 18 0;
#P connect 18 0 17 0;
#P fasten 22 0 16 0 251 600 261 600;
#P fasten 19 0 17 1 489 453 268 453;
#P fasten 43 0 22 1 323 552 274 552;
#P fasten 51 0 50 1 418 293 275 293;
#P fasten 14 0 10 0 238 235 309 235;
#P fasten 13 0 10 0 224 235 309 235;
#P fasten 12 0 10 0 181 235 309 235;
#P fasten 11 0 10 0 107 235 309 235;
#P fasten 47 0 10 0 376 235 309 235;
#P connect 42 0 43 0;
#P fasten 50 0 49 0 252 344 340 344;
#P fasten 20 0 21 0 429 402 401 402;
#P connect 52 0 51 0;
#P connect 6 0 20 0;
#P fasten 23 0 19 0 665 411 489 411;
#P fasten 20 0 19 1 429 402 506 402;
#P connect 41 0 53 0;
#P connect 53 0 28 0;
#P fasten 39 0 29 0 678 262 619 262;
#P fasten 34 0 29 0 642 247 619 247;
#P connect 28 0 29 0;
#P fasten 30 0 29 0 745 183 619 183;
#P fasten 33 0 34 0 805 121 793 121 793 193 642 193;
#P lcolor 2;
#P fasten 38 0 23 0 840 305 665 305;
#P fasten 29 0 23 0 619 331 665 331;
#P fasten 23 0 24 0 665 409 665 409;
#P connect 27 0 39 0;
#P fasten 53 0 35 0 619 77 729 77 729 208 713 208;
#P lcolor 13;
#P fasten 23 1 25 0 695 394 723 394;
#P connect 25 0 26 0;
#P fasten 45 0 26 0 813 436 723 436;
#P connect 26 0 27 0;
#P fasten 53 0 31 0 619 65 745 65;
#P connect 31 0 32 0;
#P connect 32 0 30 0;
#P fasten 31 0 33 0 745 91 805 91;
#P fasten 32 0 36 0 745 125 805 125;
#P lcolor 9;
#P connect 44 0 45 0;
#P fasten 40 0 38 0 896 261 840 261;
#P fasten 36 0 38 0 805 211 840 211;
#P fasten 37 0 38 0 866 241 840 241;
#P fasten 35 0 38 0 713 261 840 261;
#P fasten 33 0 37 0 805 121 866 121;
#P connect 27 1 40 0;
#P pop;

#69031
Apr 16, 2006 at 2:52pm

Excellent. Thank you. I did try using allpass~ after having posted my querey yesterday. It works alright, but I am trying to hone the right settings for it so that it sounds better. I’m trying to avoid using tapin~ tapout~ combos as the vector size is too much of a limitation interms of delay time. I was recommended trying comb~ or teeth~ on a different message thread so I’m gonna give that a go too.

Thanks for your help, it’s definately appreciated!

#69032

You must be logged in to reply to this topic.