[PD] log function in slider

Alexandre Torres Porres porres at gmail.com
Wed Mar 12 01:08:41 CET 2014


Thanks Jonathan. Unfortunately, my C expertise is kinda poor and I'm still
lost. I see it's got something to do with [exp] but haven't got my head
around the function needed to emulate it. I'm making extensive
documentation about Pd, so I'd like to write about it. I find it worth
noting.

In the patch I'm sending, which was my attempt to get this right before
reaching the list, I was able to emulate a bit reasonably with [expr
pow($f1, 0.25)].

Cheers


2014-03-06 21:56 GMT-03:00 Jonathan Wilkes <jancsika at yahoo.com>:

> From g_vslider.c:
>
>     if(x->x_lin0_log1)
>         out = x->x_min*exp(x->x_k*(double)(x->x_val)*0.01);
>
>
> Where x->x_k is:
>         log(x->x_max/x->x_min)/(double)(x->x_gui.x_h - 1);
>
> And x->x_gui.x_h is the height of the slider
>
> -Jonathan
>
>
>   On Thursday, March 6, 2014 7:37 PM, Alexandre Torres Porres <
> porres at gmail.com> wrote:
>  hi folks, out of curiosity, what's the exact log function used in the
> slider? I'd like to emulate it.
>
> cheers
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140311/7119d40e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slider.pd
Type: application/octet-stream
Size: 568 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140311/7119d40e/attachment.obj>


More information about the Pd-list mailing list