[PD] log function in slider

Jonathan Wilkes jancsika at yahoo.com
Mon Mar 17 23:59:52 CET 2014


On 03/17/2014 04:34 PM, Roman Haefeli wrote:
> On Mon, 2014-03-17 at 02:21 -0300, Alexandre Torres Porres wrote:
>> Hi Roman. This is turning out trickier than I thought.
> I think I understand now what you are trying to achieve (sorry, took me
> a long time). But I don't really have a clue how to do it. The
> abstraction I posted emulates the output of a logarithmic slider, but
> you're looking for the function to feed a linear slider so that it
> behaves as if it would be a logarithmic slider, right?
>    
> I'm interested to see, if someone comes up with a solution...

This is from Pd-l2ork, so the codebase might be slightly different.

Also, notice I've got hard-coded slider height = 128 in the algo.

Still don't understand why math is done in vslider_bang.

-Jonathan

>
> Roman
>
>
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
>

-------------- next part --------------
#N canvas -9 19 513 614 10;
#X obj 16 319 cnv 15 202 227 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 65 57 cnv 15 351 255 empty empty empty 20 12 0 14 -233017 -66577
0;
#X floatatom 148 27 5 0 0 0 f - -, f 5;
#X obj 217 162 log;
#X obj 217 120 f 1;
#X obj 217 141 / 0.01;
#X obj 217 183 /;
#X obj 276 131 f 128;
#X obj 276 152 - 1;
#X text 331 139 x_k;
#X obj 148 142 / 0.01;
#X obj 148 163 log;
#X obj 148 230 /;
#X obj 148 67 t a b b;
#X obj 148 251 * 100;
#X obj 148 272 + 0.49999;
#X obj 148 293 int;
#X text 190 295 <- x_xval;
#X obj 148 374 t b a;
#X obj 148 395 f 2;
#X obj 148 416 + 127;
#X obj 148 437 -;
#X text 183 435 <- r;
#X obj 148 324 + 50;
#X obj 148 345 / 100;
#X obj 235 493 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X msg 148 459 128 \$1;
#X obj 148 480 -;
#X obj 288 493 vsl 15 128 0.01 1 1 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X text 68 58 vslider_set;
#X text 21 326 vslider_draw_update;
#X text 115 581 linear slider ->;
#X text 315 581 <- logarithmic slider;
#X connect 2 0 13 0;
#X connect 2 0 28 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 6 0 12 1;
#X connect 7 0 8 0;
#X connect 8 0 6 1;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 12 0 14 0;
#X connect 13 0 10 0;
#X connect 13 1 4 0;
#X connect 13 2 7 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 23 0;
#X connect 18 0 19 0;
#X connect 18 1 21 1;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 26 0;
#X connect 23 0 24 0;
#X connect 24 0 18 0;
#X connect 26 0 27 0;
#X connect 27 0 25 0;


More information about the Pd-list mailing list