multislider to breakpoint function object

Jun 13, 2006 at 1:46pm

multislider to breakpoint function object

hello,

is there an object that can convert multislider data to breakpoint function
object data, preserving the multislider shape as much as possible with as
less points as possible?

below is something i’ve tried – it first samples every nth list value, and
transfers them to bpf. then, it searches for sudden changes of values in
list, and if change of successive values goes over given threshold, it
transfers value at that place to function too, adding some details…

but i can’t get around this problem:

before reduction, in multislider, i have this:

……”’……

after reduction, in bpf it looks like this:

—-^—-

and i would like it to look like this:
___–___

but i’ve run out of ideas.

cheers,
nesa

#P window setfont Geneva 9.;
#P window linecount 1;
#P comment 297 119 199 9961481 threshold( zero = all points from mslider);
#P hidden newex 233 67 27 9961481 t 10;
#P hidden newex 230 41 45 9961481 loadbang;
#P flonum 261 117 35 9 0. 0 1 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 261 97 35 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 15 55 615 455;
#P window setfont Geneva 9.;
#P message 50 50 389 9961481 0.504134 0.516151 0.534924 0.558679 0.585139
0.611711 0.635699 0.654527 0.665953 0.66826 0.660401 0.642096 0.613864
0.577001 0.53348 0.485816 0.436872 0.389647 0.347048 0.311668 0.285595
0.270251 0.266289 0.273548 0.291074 0.3172 0.349683 0.385885 0.422983
0.458194 0.488997 0.513324 0.529726 0.537479 0.536633 0.528001 0.513082
0.493933 0.472991 0.452865 0.43612 0.425055 0.421509 0.426699 0.441112
0.464456 0.495666 0.532983 0.574082 0.616251 0.656595 0.692266 0.72068
0.739724 0.747919 0.981651 0.72967 0.704204 0.669776 0.628633 0.583466
0.537202 0.972477 0.452927 0.41995 0.395567 0.38078 0.375808 0.380085
0.392313 0.410585 0.432545 0.455591 0.47709 0.494606 0.506095 0.510085
0.505795 0.493207 0.47307 0.446847 0.416597 0.384813 0.35422 0.327559
0.307361 0.29574 0.29422 0.303602 0.323893 0.354296 0.393259 0.43859
0.487619 0.537396 0.584916 0.627342 0.662224 0.687675 0.702513 0.706344 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.394495 0.394495 0.394495 0.394495
0.394495 0.394495 0.394495 0.394495 0.394495 0.394495 0.394495 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0.718962 0.731475 0.733144 0.723409 0.702522
0.671532 0.632213 0.586931 0.538465 0.489795 0.44388 0.403433 0.370717
0.347378 0.334328 0.331681 0.338765 0.354176 0.375913 0.401539 0.42839
0.453795 0.475294 0.490843 0.498979 0.498942 0.490735 0.475126 0.453583
0.428154 0.401302 0.375699 0.354008 0.338663 0.33166 0.334397 0.347541
0.370969 0.403762 0.444267 0.490219 0.009174 0.587352 0.632593 0.671846
0.702753 0.723546 0.733179 0.73141 0.718806 0.696693 0.66705 0.632345
0.595335 0.558853 0.525574 0.497816 0.477348 0.009174 0.009174 0.466828
0.478857 0.496195 0.516569 0.537428 0.556157 0.570299 0.577766 0.577014
0.567184 0.548179 0.520689 0.486139 0.446594 0.4046 0.362988 0.324656
0.292348 0.268433 0.254722 0.252326 0.261563 0.281938 0.312171 0.350299
0.393828 0.439921;
#P inlet 50 30 15 0;
#P outlet 50 356 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 162 112 54 9961481 p contents;
#P button 162 87 15 0;
#P newex 61 116 20 9961481 t b;
#P newex 61 97 31 9961481 r bbb;
#P button 125 89 15 0;
#N vpatcher 670 98 1081 390;
#P window setfont Geneva 9.;
#P flonum 266 60 35 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 0;
#P message 266 85 75 9961481 scale $1 $1 $1;
#P message 191 78 73 9961481 weight 1. 1. 1.;
#P button 87 69 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 117 78 70 9109513 prepend basis;
#P user ubumenu 118 52 100 9109513 0 1 1 0;
#X add distance.euclidean;
#X add distance.euclidean.squared;
#X add distance.manhattan;
#X add distance.manhattan.radial;
#X add distance.chebychev;
#X add distance.minkovsky;
#X add filter.bessel;
#X add filter.box;
#X add filter.catmullrom;
#X add filter.disk;
#X add filter.gaussian;
#X add filter.lanczossinc;
#X add filter.mitchell;
#X add filter.sinc;
#X add filter.triangle;
#X add transfer.step;
#X add transfer.smoothstep;
#X add transfer.bias;
#X add transfer.cubic;
#X add transfer.saw;
#X add transfer.quintic;
#X add transfer.gain;
#X add transfer.pulse;
#X add transfer.smoothpulse;
#X add transfer.sine;
#X add transfer.linear;
#X add transfer.solarize;
#X add noise.cell;
#X add noise.checker;
#X add noise.distorted;
#X add noise.gradient;
#X add noise.simplex;
#X add noise.voronoi;
#X add noise.value.cubicspline;
#X add noise.value.convolution;
#X add noise.sparse.convolution;
#X add fractal.mono;
#X add fractal.hetero;
#X add fractal.multi;
#X add fractal.multi.hybrid;
#X add fractal.multi.ridged;
#X add fractal.turbulence;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P outlet 51 203 15 0;
#P window setfont Geneva 9.;
#P window linecount 0;
#P newex 51 147 36 9961481 jit.spill;
#P inlet 51 64 15 0;
#P window linecount 1;
#P newex 51 114 283 9961481 jit.bfg 1 float32 250 @basis noise.gradient
@scale 12. 12. 12.;
#P connect 8 0 0 0;
#P connect 1 0 0 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 7 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 8 0 6 0;
#P fasten 4 1 5 0 168 73 122 73;
#P connect 9 0 8 0;
#P pop;
#P newobj 125 112 30 9961481 p bfg;
#P newex 5 242 40 9961481 qlim 30;
#N vpatcher 632 40 1256 514;
#P window setfont Geneva 9.;
#P window linecount 3;
#P comment 241 161 39 9961481 details are here:;
#P inlet 106 176 15 0;
#P window linecount 1;
#N vpatcher 15 55 615 455;
#P window setfont Geneva 9.;
#P newex 81 237 130 9961481 pow 1.;
#P newex 81 207 35 9961481 abs 0.;
#P comment 230 186 171 9961481 first element is set to 0.;
#P newex 50 50 90 9961481 t l l;
#P newex 130 80 30 9961481 zl len;
#P newex 50 162 24 9961481 t 0.;
#P newex 81 160 27 9961481 t f f;
#P newex 50 270 64 9961481 zl group 250;
#P newex 50 109 41 9961481 zl nth 1;
#P newex 81 185 27 9961481 – 0.;
#P newex 81 136 43 9961481 zl iter 1;
#P comment 220 163 171 9961481 difference between list elements;
#P inlet 201 49 15 0;
#P inlet 50 30 15 0;
#P outlet 50 300 15 0;
#P connect 1 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 7 0;
#P connect 14 0 7 0;
#P connect 7 0 0 0;
#P connect 6 1 4 0;
#P connect 4 0 8 0;
#P connect 8 1 5 0;
#P connect 5 0 13 0;
#P connect 13 0 14 0;
#P connect 8 0 5 1;
#P fasten 10 0 7 1 135 265 109 265;
#P connect 11 1 10 0;
#P connect 2 0 14 1;
#P pop;
#P newobj 19 97 95 9961481 p abs-diff-with-pow;
#P flonum 106 260 64 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 106 225 37 9961481 * 0.01;
#P hidden newex 178 175 31 9961481 s bbb;
#P flonum 104 38 35 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 168 360 27 9961481 + 0;
#P user multiSlider 281 88 295 44 0. 1. 250 2937 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 281 180 295 44 0. 1. 250 2937 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 281 134 295 44 0. 1. 250 2937 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 newex 19 64 254 9961481 t l l;
#P comment 84 292 321 9961481 if change is bigger then threshold , output
original value at that position;
#P newex 18 409 85 9961481 pack 0 0.;
#P newex 18 315 161 9961481 t i b i;
#P newex 18 291 30 9961481 gate;
#P flonum 106 205 64 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 173 205 53 9961481 threshold;
#P newex 68 259 32 9961481 > 0.1;
#P newex 19 167 59 9961481 unpack 0 0.;
#P newex 93 383 85 9961481 zl nth 1;
#P newex 19 147 47 9961481 listfunnel;
#P newex 93 338 180 9961481 zl reg;
#N vpatcher 15 55 615 455;
#P window setfont Geneva 9.;
#P newex 81 237 130 9961481 pow 1.;
#P newex 81 207 35 9961481 abs 0.;
#P comment 230 186 171 9961481 first element is set to 0.;
#P newex 50 50 90 9961481 t l l;
#P newex 130 80 30 9961481 zl len;
#P newex 50 162 24 9961481 t 0.;
#P newex 81 160 27 9961481 t f f;
#P newex 50 270 64 9961481 zl group 250;
#P newex 50 109 41 9961481 zl nth 1;
#P newex 81 185 27 9961481 – 0.;
#P newex 81 136 43 9961481 zl iter 1;
#P comment 220 163 171 9961481 difference between list elements;
#P inlet 201 49 15 0;
#P inlet 50 30 15 0;
#P outlet 50 300 15 0;
#P connect 1 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 9 0;
#P connect 14 0 7 0;
#P connect 9 0 7 0;
#P connect 7 0 0 0;
#P connect 6 1 4 0;
#P connect 4 0 8 0;
#P connect 8 1 5 0;
#P connect 5 0 13 0;
#P connect 13 0 14 0;
#P connect 8 0 5 1;
#P fasten 10 0 7 1 135 265 109 265;
#P connect 11 1 10 0;
#P connect 2 0 14 1;
#P pop;
#P newobj 19 121 95 9961481 p abs-diff-with-pow;
#P outlet 18 437 15 0;
#N comlet;
#P inlet 19 41 15 0;
#P comment 119 111 192 9961481 find where list suddenly changes;
#P fasten 8 0 11 0 73 282 23 282;
#P connect 11 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 2 0;
#P connect 1 0 15 0;
#P connect 15 0 24 0;
#P connect 24 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 11 1;
#P connect 7 1 8 0;
#P connect 22 0 8 1;
#P connect 12 1 4 0;
#P connect 4 0 6 0;
#P connect 6 0 13 1;
#P connect 20 0 24 1;
#P lcolor 1;
#P connect 20 0 3 1;
#P lcolor 1;
#P connect 25 0 10 0;
#P connect 10 0 22 0;
#P connect 22 0 23 0;
#P connect 12 2 19 0;
#P connect 19 0 6 1;
#P hidden connect 22 0 21 0;
#P lcolor 1;
#P hidden connect 20 0 21 0;
#P lcolor 1;
#P connect 15 1 4 1;
#P connect 15 1 18 0;
#P connect 24 0 16 0;
#P lcolor 1;
#P connect 3 0 17 0;
#P lcolor 1;
#P pop 1;
#P newobj 5 315 63 9961481 p add-details;
#P newex 5 263 27 9961481 t l l;
#P message 84 116 17 9961481 0.;
#P button 102 88 15 0;
#N vpatcher 630 41 1205 548;
#P window setfont Geneva 9.;
#P hidden newex 297 268 31 9961481 s bbb;
#N comlet;
#P inlet 257 28 15 0;
#P window linecount 1;
#P comment 152 258 37 9961481 ‘snap’;
#P newex 182 216 32 9961481 + 1;
#P toggle 283 318 15 0;
#P newex 194 327 42 9961481 t i clear;
#N vpatcher 223 62 560 372;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 77 157 45 9961481 gate 2 1;
#P window linecount 0;
#P newex 230 79 27 9961481 + 1;
#P window linecount 1;
#P newex 167 177 37 9961481 t clear;
#P window linecount 0;
#P newex 167 52 73 9961481 sel clear;
#P inlet 167 26 15 0;
#P newex 112 211 31 9961481 mean;
#P outlet 77 240 16 0;
#P inlet 112 27 15 0;
#P connect 6 0 7 0;
#P lcolor 1;
#P connect 7 0 1 0;
#P connect 2 0 1 0;
#P connect 0 0 7 1;
#P fasten 5 0 2 0 172 206 117 206;
#P connect 7 1 2 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 4 1 6 0;
#P pop;
#P newobj 246 366 60 9961481 p smoothing;
#P message 210 426 30 9961481 clear;
#P newex 194 303 40 9961481 change;
#P newex 194 269 28 9961481 * 10;
#P window linecount 0;
#P newex 194 123 155 9961481 t l -1 clear;
#P number 224 219 35 9 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 194 401 62 9961481 pack 0 0.;
#P window linecount 0;
#P newex 194 240 31 9961481 / 10.;
#P newex 194 163 47 9961481 listfunnel;
#P window linecount 1;
#P newex 194 193 62 9961481 unpack 0. 0.;
#P outlet 194 455 15 0;
#P inlet 194 24 15 0;
#P window linecount 0;
#P comment 263 106 177 9961481 clear bpf , reset ‘change’ obj , send list;
#P comment 60 306 133 9961481 skip nodes with same index>;
#P connect 4 0 16 0;
#P connect 2 0 9 0;
#P connect 9 0 5 0;
#P connect 5 0 4 0;
#P connect 16 0 6 0;
#P connect 6 0 10 0;
#P connect 10 0 11 0;
#P fasten 9 1 11 0 271 295 199 295;
#P connect 11 0 14 0;
#P connect 14 0 7 0;
#P connect 12 0 3 0;
#P fasten 9 2 3 0 343 453 199 453;
#P connect 7 0 3 0;
#P fasten 8 0 10 1 229 237 229 237 229 263 217 263;
#P connect 8 0 6 1;
#P connect 18 0 8 0;
#P lcolor 1;
#P connect 4 1 13 0;
#P connect 13 0 7 1;
#P connect 15 0 13 1;
#P connect 14 1 13 1;
#P hidden connect 8 0 19 0;
#P pop;
#P newobj 22 287 36 9961481 p 2bpf;
#P user multiSlider 102 150 437 13 0. 250. 1 2664 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 function 102 280 539 391 1 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0.504134 0;
#X add 10. 0.66826 0;
#X add 20. 0.311668 0;
#X add 30. 0.458194 0;
#X add 40. 0.452865 0;
#X add 50. 0.616251 0;
#X add 53. 0.72068 0;
#X add 55. 0.747919 0;
#X add 60. 0.628633 0;
#X add 60. 0.628633 0;
#X add 62. 0.537202 0;
#X add 70. 0.392313 0;
#X add 80. 0.47307 0;
#X add 90. 0.323893 0;
#X add 99. 0.687675 0;
#X add 100. 0.702513 0;
#X add 100. 0.702513 0;
#X add 110. 0. 0;
#X add 113. 0. 0;
#X add 114. 0. 0;
#X add 120. 1. 0;
#X add 126. 1. 0;
#X add 127. 1. 0;
#X add 130. 0. 0;
#X add 138. 0. 0;
#X add 139. 0. 0;
#X add 140. 0. 0;
#X add 149. 0.394495 0;
#X add 150. 0.394495 0;
#X add 150. 0.394495 0;
#X add 160. 0. 0;
#X add 161. 0. 0;
#X add 162. 0. 0;
#X add 170. 0.632213 0;
#X add 180. 0.338765 0;
#X add 190. 0.490735 0;
#X add 200. 0.347541 0;
#X add 202. 0.403762 0;
#X add 204. 0.490219 0;
#X add 210. 0.723546 0;
#X add 219. 0.525574 0;
#X add 220. 0.497816 0;
#X add 220. 0.497816 0;
#X add 221. 0.477348 0;
#X add 222. 0.009174 0;
#X add 230. 0.570299 0;
#X add 240. 0.324656 0;
#X add 250. 0.439921 0;
#X domain 250.;
#X range 0. 1.;
#X done;
#P user multiSlider 102 164 437 111 0. 1. 250 2681 47 1 0 2 0 22 0;
#M frgb 255 161 0;
#M brgb 199 204 204;
#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 comment 297 97 100 9961481 get every nth value;
#P user panel 256 91 265 48;
#X brgb 231 231 231;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 20 0 18 0;
#P hidden connect 20 0 17 0;
#P hidden connect 19 0 20 0;
#P hidden connect 19 0 16 0;
#P connect 15 0 16 0;
#P connect 12 0 11 0;
#P fasten 5 0 3 0 27 310 97 310 97 278 107 278;
#P fasten 9 0 3 0 10 340 97 340 97 278 107 278;
#P connect 16 0 2 0;
#P connect 6 0 2 0;
#P connect 7 0 2 0;
#P connect 11 0 2 0;
#P connect 14 0 2 0;
#P connect 13 0 14 0;
#P hidden connect 18 0 9 1;
#P lcolor 1;
#P hidden connect 17 0 5 1;
#P lcolor 1;
#P connect 8 1 5 0;
#P connect 8 0 9 0;
#P connect 10 0 8 0;
#P fasten 2 0 10 0 107 275 99 275 99 240 10 240;
#P window clipboard copycount 22;

#26397
Jun 14, 2006 at 5:25am

Wouldn’t it be better to search for maxima and minima instead of taking
a fixed number of steps? Afterwards you could eliminate those which have
a too little difference compared to direct connection of every second
point to get rid of points which would fit into a direct line…

In short words, instead of taking a too small amount and adding missing
points, take too many and eliminate those with little information…

Send in what you come up with, sounds interesting…

Stefan


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

#78836
Jun 23, 2006 at 10:27am

ah, there it is, nasty message. I knew someone would reply, thanks Stefan.

Your suggestion sounds reasonable, I’ll post something as soon as I find
time to get back to it.

nesa

#78837

You must be logged in to reply to this topic.