[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Center and deviation from lo and hi



Oops, there's a mistake there - actually
d = hi - lo

so

c = lo/(1+lo-hi)

Nathaniel


2009/7/23 Nathaniel Virgo <nathanielvirgo@xxxxxxxxx>
I did

(re-write your formulae and expand out the brackets:)
lo = c - (c*d)
hi = c + d - (c*d)

subtracting lo from hi gives
d = lo - hi

we have
lo = c - (c*d) = c*(1-d)
divide by (1-d):
lo/(1-d) = c

then substitute d=lo-hi into this to give
c = lo/(1-(lo-hi)) = lo/(1 - hi + lo)

I hope all that's clear, let me know if not.


Nathaniel


2009/7/23 Uri Sala <urisala@xxxxxxxxx>

hey, thanks a lot!
I tried to solve the equations myself, to no avail. How did you solve it,
what factor did you isolate?



Nathaniel Virgo wrote:
>
> Hi Uri
>
> From solving your formulae as simultaneous equations it looks like
> deviation = lo - hi;
> center = lo/(1 - lo + hi);
>
> hth
> Nathaniel
>
>
> 2009/7/23 Uri Sala <urisala@xxxxxxxxx>
>
>> Hey
>>
>> I am controlling 2 variables, the center pitch and the deviation, through
>> 2
>> knobs. I am visualizing what this in a range slider through the following
>> formula:
>>
>> lo = center - (center * deviation);
>> hi = center + ((1 - center) * deviation);
>> This means I visualize center and dev as a sort of rrand(lo,hi).
>>
>> Now, I would also like to control these variables through the slider,
>> but
>> I cannot seem to find the formula that gives me the center and the
>> deviation
>> knowing upper and lower limits. Any clues?
>>
>> Thanks
>> Uri
>>
>
>

--
View this message in context: http://n2.nabble.com/Center-and-deviation-from-lo-and-hi-tp3309931p3311093.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/