<div dir="ltr"><div>Hey, a few things have made sense to me now.<br></div><div><br></div><div>The minimum and maximum values in PD are in a 100 / 1 ratio. This ratio is important and it's a key in the formula. In the sense that if you have 10 and 1000, the plotting curve looks always the same. So if you forget about the minimum and maximum values, you can just work with this ratio variable.</div>
<div><br></div><div>Something like:</div><div><br></div><div>[expr exp($f1 * log(ratio))]<br></div><div><br></div><div>Now this will give you a value from 1 to the value of "ratio". And I thought it'd be cool to scale it from 0 to 1.</div>
<div><br></div><div>One thing that annoys me a lot is that the log function will not allow you to start at zero. So I wanted to tweak this in order to make it so.</div><div><br></div><div>Not hard, something like this does the trick.</div>
<div><br></div><div>[expr exp($f1 * log(ratio) - 1) / (ratio -1)]<br></div><div><br></div><div>You can always rescale this by multiplying to any factor and summing to a constant.</div><div><br></div><div>cheers</div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-03-18 19:27 GMT-03:00 Alexandre Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">cool, looks great<div><br></div><div>by the way, this guy was helping me out with the math, so I don't really know what's going on that well. </div><div><br></div><div>Apparently he couldn't figure out the slider height variable. And Roman didn't use that too.</div>
<div><br></div><div>The formula was behaving the same as Roman's patch, but we simplified the formula now so it's more related to Roman's patch.</div><div><br></div><div>It's something like this now</div>
<div>
<br></div><div>[expr~ min_$0 * exp($v1 * log(max_$0 / min_$0))]</div><div><br></div><div>then doing the inverse is not too complicated, just use "ln"</div><div><br></div><div>I still have not much clue about the original code, the slider height variable and other things, but, anyhow, these were the equations I was looking for ;)</div>
<div><br></div><div>cheers</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-18 18:32 GMT-03:00 Jonathan Wilkes <span dir="ltr"><<a href="mailto:jancsika@yahoo.com" target="_blank">jancsika@yahoo.com</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div>
<div>On 03/18/2014 04:05 PM, Alexandre
Torres Porres wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">and as I was checking before, not too far from
raising to the power of 0.25 (thicker line in the graph from the
picture attached)</div>
</blockquote>
<br></div>
Btw-- here's what that patch looks like in Pd-l2ork (attached).<br>
<br>
The array rectangle is orange because it's selected. I also changed
the size of the garray by click-dragging with the mouse.<span><font color="#888888"><br>
<br>
-Jonathan</font></span><div><div><br>
<br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-03-18 16:48 GMT-03:00 Alexandre
Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">the solution is as I thought, to just invert
the given formula in the code. Someone helped me with the
math, is something like
<div>
<br>
</div>
<div>expr ln($f1 / 1.27) / (((log(127 / 1.27) / 1.27)) *
0.01)<br>
</div>
<div><br>
</div>
<div>here's a patch attached</div>
<div><br>
</div>
<div>I'm finally gonna check what kind of curve this thing
gives :)</div>
<div><br>
</div>
<div>Thanks everyone</div>
<div><br>
</div>
<div>Cheers</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-03-18 5:13 GMT-03:00
Jonathan Wilkes <span dir="ltr"><<a href="mailto:jancsika@yahoo.com" target="_blank">jancsika@yahoo.com</a>></span>:
<div>
<div>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div style="font-size:12pt;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">
<div>
<div>
<div style="font-size:12pt;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">
No, the code I ported is from
vslider_set and vslider_draw_update
(might be different in Vanilla).<br>
<br>
In vslider_bang, math is done to output
the proper value. Without looking at
the code I would have guessed
vslider_bang simply outputs a stored
value like [float] does. Then just do
math to set the slider position or
calculate a new stored value from mouse
input.<span><font color="#888888"><br>
<br>
-Jonathan<br>
</font></span>
<div style="display:block"> <br>
<br>
<div style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:12pt">
<div style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:12pt">
<div>
<div dir="ltr"> <font face="Arial"> On Monday,
March 17, 2014 1:21 AM,
Alexandre Torres Porres <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>>
wrote:<br>
</font> </div>
</div>
<div>
<div>
<div>
<div>
<div dir="ltr">
<div>Hi Roman. This is
turning out trickier
than I thought. A
friend explained the
code to me and got to
the following
equation, with min/max
values as 0.01 and 1
respectively.</div>
<div><br>
</div>
<div>[expr 0.01 *
exp((log(1 / 0.01) /
0.01) * $f1 * 0.01)]<br>
</div>
<div><br>
</div>
<div>For what I've
checked, it seems to
behave like your
patch. But it doesn't
do the trick I'm
looking for yet. I
sent a patch earlier,
and I'm sending it
back again.</div>
<div><br>
</div>
<div>The goal is to
connect a linear
slider to an [expr]
(with this so called
"log" function) and
then to another linear
slider. The idea then
is that this second
slider behaves as one
that was set as being
"log".</div>
<div><br>
</div>
<div>In the patch
attached I was able to
emulate it poorly with
[pow 0.25], but that
was before reaching
the list. See that if
I use this expr
function from the code
or your patch it
presents quite a
different behavior.</div>
<div><br>
</div>
<div>maybe it is some
sort of inversion of
this equation, not
sure. Apparently this
code converts the
"log" function values
to linear and I'm
hoping to get the
exact opposite. Got
it?</div>
<div>
<br>
</div>
<div>Thanks for looking
into this</div>
</div>
<div><br>
<br>
<div>2014-03-12 4:38
GMT-03:00 Roman
Haefeli <span dir="ltr"><<a rel="nofollow">reduzent@gmail.com</a>></span>:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>On Don,
2014-03-06 at
21:37 -0300,
Alexandre Torres
Porres wrote:<br>
> hi folks, out
of curiosity,
what's the exact
log function used
in the<br>
> slider? I'd
like to emulate
it.<br>
<br>
</div>
I am not sure, if
this is what you
want. It converts
the incoming linear<br>
range between 0 and
1 to a logarithmic
range specified by
$1 and $2,<br>
respectively by the
second and third
inlet. They behave
like the lower<br>
and upper bound
specified in the
[vslider]/[hslider]
classes.<br>
<br>
<a rel="nofollow">https://raw.github.com/reduzent/netpd2-patches/master/abs/rh_scalelog.pd</a><br>
<span><font color="#888888"><br>
<br>
Roman<br>
</font></span>
<div>
<div><br>
<br>
<br>
<br>
_______________________________________________<br>
<a rel="nofollow">Pd-list@iem.at</a>
mailing list<br>
UNSUBSCRIBE and
account-management
-> <a rel="nofollow">http://lists.puredata.info/listinfo/pd-list</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
_______________________________________________<br>
<a rel="nofollow">Pd-list@iem.at</a>
mailing list<br>
UNSUBSCRIBE and
account-management -> <a rel="nofollow">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>