Forums > MaxMSP

liniar smoothing

December 8, 2007 | 10:16 pm

Hi, i was wondering if there is another way to do
liniar smoothing on a signal, other than rampsmooth~
becouse it has a non audiorate smooth setting.
thx again:)


December 9, 2007 | 12:11 pm

i thought, making a lowpass respond in a liniar fashion would cut it.. only im stuck to the how??
the thing is i want to smooth a square gate signal over n samples, (or the obvious cpm or fhz)
and be able to assume, that if i calculate a window
function it will be equal powered.
and i want it to resopnd in a frame, so it doesnt have to be the only object that lags my sequence.


December 9, 2007 | 8:12 pm

have you tried slide~?


December 10, 2007 | 3:05 pm

i have now, but it shares the same drawback.
becouse i want to set the rampup time with a signal.
so if the window time changed, it creates some artifacts.
in relation to the faster rest of my patch.
…dmn!!


December 10, 2007 | 3:22 pm

maybe you should post a example patch showing the problem.


December 10, 2007 | 4:08 pm

#N vpatcher 139 184 739 584;
#P window setfont "Sans Serif" 9.;
#P user number~ 160 134 199 149 9 139 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P comment 137 213 51 9109513 im using;
#P inlet 338 84 15 0;
#P outlet 188 235 15 0;
#P outlet 302 237 15 0;
#P comment 256 182 81 9109513 this is needed >>;
#P newex 303 210 45 9109513 onepole~;
#P message 189 179 42 9109513 ramp $1;
#P newex 189 211 65 9109513 rampsmooth~;
#P comment 100 181 87 9109513 this is too slow >>;
#P window linecount 3;
#P comment 357 82 100 9109513 top level sequencer that sends signal values;
#P window linecount 2;
#P comment 349 207 100 9109513 onepole is for demo purpose;
#P connect 9 0 11 0;
#P connect 3 0 8 0;
#P connect 11 1 4 0;
#P connect 4 0 3 0;
#P connect 5 0 7 0;
#P connect 9 0 5 1;
#P pop;


December 10, 2007 | 4:10 pm

max v2;
#N vpatcher 139 184 739 584;
#P window setfont "Sans Serif" 9.;
#P user number~ 160 134 199 149 9 139 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P comment 137 213 51 9109513 im using;
#P inlet 338 84 15 0;
#P outlet 188 235 15 0;
#P outlet 302 237 15 0;
#P comment 256 182 81 9109513 this is needed >>;
#P newex 303 210 45 9109513 onepole~;
#P message 189 179 42 9109513 ramp $1;
#P newex 189 211 65 9109513 rampsmooth~;
#P comment 100 181 87 9109513 this is too slow >>;
#P window linecount 3;
#P comment 357 82 100 9109513 top level sequencer that sends signal values;
#P window linecount 2;
#P comment 349 207 100 9109513 onepole is for demo purpose;
#P connect 9 0 11 0;
#P connect 3 0 8 0;
#P connect 11 1 4 0;
#P connect 4 0 3 0;
#P connect 5 0 7 0;
#P connect 9 0 5 1;
#P pop;


December 10, 2007 | 4:19 pm

The interval of the ‘number~’ object is set to 250ms so you could reduce it to 20ms. Or you should try a DIY approach – here’s my quick little effort:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 100 31 73 196617 smooth amnt~;
#N vpatcher 465 273 1065 673;
#P window setfont "Sans Serif" 9.;
#P newex 150 87 77 196617 loadmess 0.5;
#P flonum 165 126 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user multiSlider 75 266 170 89 0. 127. 1 3433 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 user multiSlider 75 178 170 89 0. 127. 1 3433 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 toggle 33 33 15 0;
#P newex 33 61 52 196617 metro 50;
#P newex 33 97 71 196617 drunk 127 10;
#P newex 33 179 27 196617 f;
#B color 5;
#P newex 33 157 143 196617 expr (1-$f3)*$f1 + $f3*$f2;
#B color 5;
#P comment 204 128 100 196617 0. < -> 1.;
#P comment 115 51 100 196617 like slide;
#P connect 6 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 3 0;
#P connect 4 0 7 0;
#P connect 3 0 8 0;
#P connect 3 0 2 1;
#P connect 10 0 9 0;
#P connect 9 0 2 2;
#P pop;
#P newobj 178 123 76 196617 p based on this;
#P user ezdac~ 187 168 231 201 0;
#P number 26 47 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 26 71 58 196617 phasor~ 3.;
#P user scope~ 34 167 164 297 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P user number~ 104 50 188 65 9 3 3 1 0. 0.9999 3 0.9499 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 323 123 944 610;
#N comlet signal in;
#P inlet 149 159 15 0;
#N comlet smoothing factor;
#P inlet 232 142 15 0;
#P outlet 149 379 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 230 216 77 196617 receive~ delay;
#P newex 53 351 63 196617 send~ delay;
#P newex 149 293 27 196617 +~;
#P newex 213 249 27 196617 *~;
#P newex 149 226 32 196617 *~ 1;
#P newex 232 177 33 196617 !-~ 1;
#P fasten 3 0 4 0 154 330 58 330;
#P connect 8 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P fasten 2 0 3 1 218 278 171 278;
#P fasten 0 0 1 1 237 210 176 210;
#P fasten 7 0 2 0 237 164 218 164;
#P connect 5 0 2 1;
#P connect 7 0 0 0;
#P pop;
#P newobj 34 129 63 196617 p j.smooth~;
#P comment 24 29 53 196617 signal in~;
#P connect 2 0 1 1;
#P connect 1 0 3 0;
#P connect 4 0 1 0;
#P connect 5 0 4 0;
#P window clipboard copycount 9;


December 10, 2007 | 4:35 pm

sice it`s a gate signal i think i will do some
ramping with a synced phasor or something.
but thx for the efford, thats some nice complex math there:)


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