Filter Modulation problem

May 28, 2007 at 4:22pm

Filter Modulation problem

Hi, I have been working on a modulation section for my synthesizer and managed to set up an LFO and direct it to several places using a matrix~. One of which is the filter cut-off, which sounds really good but I am also having a major problem with it. Basically when I modulate the filter cut-off using an LFO and set the cut-off to very high values, the peaks of the LFO waveshape cause the filter to distort.
The LFO seems to be sending the filter cut-off too high and causing it to distort. I have found that reducing the maximum value of the cut off control to about 10KHz is low enough to prevent it but then this limits the effect of my filter, which I don’t want. I thought about using a clip~ to stop the LFO sending the filter frequency to high but it doesn’t work. I’m using a filtercoeff~ and biquad for the filter with the LFO directed straight into the cutoff inlet.
Any help is much appreciated.
Steven

#32149
May 28, 2007 at 9:02pm

#105279
May 28, 2007 at 10:21pm

Hi Rould,
Here is a modified version of my patch that shows how I’ve built my LFO and connected it to the filter cutoff via matrix~. It seems to work fine until I push the cutoff slider above 120 then it distorts like in the motion of the LFO.
Thanks for looking at this,
Steven

max v2;
#N vpatcher 635 166 1280 747;
#P window setfont “Sans Serif” 9.;
#P number 471 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 335 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user uslider 471 136 23 85 128 1 0 0;
#P user uslider 335 136 23 85 128 1 0 0;
#P user umenu 255 314 68 196647 1 64 330 0;
#X setrgb 255 255 255 60 79 66 255 255 255 221 221 221 170 170 170 119 119 119 187 187 187;
#X add lowpass;
#X add highpass;
#X add bandpass;
#X add bandstop;
#P newex 335 350 29 196617 sig~;
#P newex 280 405 27 196617 *~;
#P newex 471 350 29 196617 sig~;
#P newex 471 314 135 196617 scale 0 127 1. 100. 1.032;
#P newex 335 314 129 196617 scale 0 127 0 20000 1.06;
#P newex 335 475 66 196617 filtercoeff~;
#P newex 321 501 80 196617 biquad~;
#P newex 139 495 80 196617 matrix~ 1 5;
#P user umenu 37 106 74 196645 1 64 122 1;
#X setrgb 255 255 255 60 79 66 255 255 255 221 221 221 170 170 170 119 119 119 187 187 187;
#X add Off;
#X add Sine;
#X add Triangle;
#X add Sawtooth;
#X add Square;
#P hidden newex 162 31 48 196617 loadbang;
#P hidden message 162 63 20 196617 64;
#P window setfont Arial 10.;
#P number 161 129 27 10 -64 63 8231 2001 255 106 106 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P flonum 171 221 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 164 171 20 196617 PW;
#P newex 171 195 40 196617 / 127.;
#P user dial 162 147 24 24 128 1 0 0 223 270 1 1. 90 114 141 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#N vpatcher 986 308 1586 708;
#P inlet 124 35 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 193 199 27 196617 *~;
#P newex 107 200 27 196617 *~;
#P outlet 193 241 15 0;
#P outlet 107 241 15 0;
#P inlet 107 35 15 0;
#P window linecount 1;
#P newex 124 92 87 196617 scale 0 127 0. 1.;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 124 120 68 1441802 expr 1-$f1;
#P window setfont Times 10.;
#P comment 215 144 25 1310730 Wet;
#P window setfont “Fixedwidth Serif” 10.;
#P flonum 124 158 35 10 0. 1. 3 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 210 158 35 10 0. 1. 3 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Times 10.;
#P comment 128 144 22 1310730 Dry;
#P window setfont “Sans Serif” 9.;
#P message 232 87 14 196617 1;
#P newex 232 64 48 196617 loadbang;
#P connect 8 0 11 0;
#P connect 11 0 9 0;
#P connect 13 0 7 0;
#P connect 7 0 6 0;
#P fasten 1 0 4 0 237 142 129 142;
#P connect 6 0 4 0;
#P connect 4 0 11 1;
#P fasten 8 0 12 0 112 185 198 185;
#P connect 12 0 10 0;
#P fasten 7 0 3 0 129 114 215 114;
#P connect 3 0 12 1;
#P connect 0 0 1 0;
#P pop;
#P newobj 37 323 112 196617 patcher LFO-mod mix;
#N vpatcher 249 558 537 854;
#P origin 32 0;
#P inlet 235 36 15 0;
#P inlet 212 36 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 170 157 27 196617 *~;
#P newex 128 157 27 196617 *~;
#P newex 86 157 27 196617 *~;
#P newex 44 157 27 196617 *~;
#P newex 177 59 39 196617 begin~;
#P newex 135 59 39 196617 begin~;
#P newex 93 59 39 196617 begin~;
#P newex 51 59 39 196617 begin~;
#P inlet 28 36 15 0;
#P newex 28 196 63 196617 selector~ 4;
#P newex 170 105 40 196617 rect~;
#P newex 86 105 40 196617 tri~;
#P newex 128 105 34 196617 saw~;
#P newex 44 105 40 196617 cycle~;
#P outlet 28 246 15 0;
#P inlet 170 36 15 0;
#P inlet 128 36 15 0;
#P inlet 86 36 15 0;
#P inlet 44 36 15 0;
#P fasten 10 0 9 0 33 121 33 121;
#P connect 9 0 4 0;
#P fasten 15 0 9 1 49 185 46 185;
#P connect 0 0 5 0;
#P connect 5 0 15 0;
#P fasten 16 0 9 2 91 185 59 185;
#P fasten 20 0 15 1 240 138 66 138;
#P fasten 17 0 9 3 133 185 72 185;
#P fasten 11 0 5 1 56 85 79 85;
#P fasten 18 0 9 4 175 185 85 185;
#P connect 1 0 7 0;
#P connect 7 0 16 0;
#P fasten 19 0 7 1 217 85 106 85;
#P fasten 20 0 16 1 240 138 108 138;
#P fasten 12 0 7 2 98 85 121 85;
#P connect 2 0 6 0;
#P connect 6 0 17 0;
#P fasten 20 0 17 1 240 138 150 138;
#P fasten 13 0 6 1 140 85 157 85;
#P connect 3 0 8 0;
#P connect 8 0 18 0;
#P fasten 19 0 8 1 217 85 190 85;
#P fasten 20 0 18 1 240 138 192 138;
#P fasten 14 0 8 2 182 85 205 85;
#P pop;
#P newobj 37 296 120 196617 patcher LFO waveshapes;
#P window setfont Arial 10.;
#P number 121 129 27 10 0 127 8231 2001 255 106 106 221 221 221 222 222 222 0 0 0;
#P user panel 120 128 30 16;
#X brgb 80 20 20;
#X frgb 0 0 0;
#X border 2;
#X rounded 4;
#X shadow 0;
#X done;
#P number 83 129 27 10 0 127 8231 2001 255 106 106 221 221 221 222 222 222 0 0 0;
#P user panel 81 128 30 16;
#X brgb 80 20 20;
#X frgb 0 0 0;
#X border 2;
#X rounded 4;
#X shadow 0;
#X done;
#P number 44 129 27 10 0 127 8231 2001 255 106 106 221 221 221 222 222 222 0 0 0;
#P user panel 42 128 30 16;
#X brgb 80 20 20;
#X frgb 0 0 0;
#X border 2;
#X rounded 4;
#X shadow 0;
#X done;
#P user dial 123 147 24 24 128 1 0 0 223 270 1 1. 90 114 141 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P user dial 84 147 24 24 128 1 0 0 223 270 1 1. 90 114 141 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P user dial 45 147 24 24 128 1 0 0 223 270 1 1. 90 114 141 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P window setfont “Sans Serif” 9.;
#P comment 123 171 25 196617 Mod;
#P number 127 221 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 123 427 43 196617 Mod out;
#P newex 37 370 27 196617 *~;
#P outlet 37 411 15 0;
#P newex 55 254 123 196617 scale 0 127 0.1 30. 1.04;
#P newex 84 194 40 196617 / 127.;
#P flonum 84 221 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 45 221 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden message 85 63 20 196617 64;
#P hidden newex 85 31 48 196617 loadbang;
#P window setfont “Sans Serif” 12.;
#P comment 119 85 28 196620 LFO;
#P window setfont “Sans Serif” 9.;
#P comment 45 171 26 196617 Rate;
#P comment 43 93 31 196617 Shape;
#P comment 81 171 34 196617 Depth;
#P comment 24 427 40 196617 LFO out;
#P user panel 159 128 30 16;
#X brgb 80 20 20;
#X frgb 0 0 0;
#X border 2;
#X rounded 4;
#X shadow 0;
#X done;
#P comment 330 289 35 196617 Cutoff;
#P comment 458 289 52 196617 Resonance;
#P hidden connect 37 0 28 0;
#P hidden connect 28 0 29 0;
#P hidden connect 29 0 15 0;
#P hidden connect 15 0 14 0;
#P hidden connect 10 0 23 0;
#P hidden connect 19 0 10 0;
#P hidden fasten 10 0 13 0 50 243 60 243;
#P hidden connect 13 0 28 1;
#P hidden fasten 13 0 28 2 60 283 78 283;
#P hidden connect 20 0 25 0;
#P hidden connect 9 0 20 0;
#P hidden connect 20 0 12 0;
#P hidden connect 12 0 11 0;
#P hidden connect 8 0 9 0;
#P hidden fasten 13 0 28 3 60 283 96 283;
#P hidden fasten 13 0 28 4 60 283 114 283;
#P hidden connect 17 0 27 0;
#P hidden connect 21 0 17 0;
#P hidden fasten 33 0 28 5 176 283 132 283;
#P hidden fasten 17 0 29 1 132 283 144 283;
#P connect 29 1 38 0;
#P hidden connect 36 0 35 0;
#P hidden connect 35 0 30 0;
#P hidden connect 30 0 31 0;
#P hidden connect 31 0 33 0;
#P fasten 38 1 44 0 158 540 241 540 241 379 285 379;
#P fasten 45 0 44 1 340 386 302 386;
#P connect 47 0 49 0;
#P connect 49 0 41 0;
#P connect 41 0 45 0;
#P connect 45 0 40 0;
#P fasten 44 0 40 0 285 448 340 448;
#P fasten 46 1 40 0 318 407 340 407;
#P connect 40 0 39 1;
#P connect 40 1 39 2;
#P connect 40 2 39 3;
#P connect 40 3 39 4;
#P fasten 43 0 40 2 476 434 396 434;
#P connect 40 4 39 5;
#P connect 48 0 50 0;
#P connect 50 0 42 0;
#P connect 42 0 43 0;
#P pop;

#105280
May 29, 2007 at 9:32am

I tried it and the problem is that when the cutoff slider is above 120, you send frequencies above 22050 Hz to [freqcoeff~] and [biquad~] can’t handle it.
Put a [clip~ 20 22050] just before [freqcoeff~]… there’s nicer ways to correct the problem but it works like that.

#105281
May 30, 2007 at 9:23am

#105282
Jun 1, 2007 at 1:27am

Hello Roald,
thanks for working on that patch, it seems to be working fine now. The patch has a few faults on it, i know like the two connection you mentioned going into the filter cutoff and the whole LFO section in general could be designed better. I’ll get there eventaully
cheers,
Steven

#105283

You must be logged in to reply to this topic.