Math question

Peter Bogdanoff bogdanoff at me.com
Fri Feb 26 17:43:32 EST 2016


Hermann,

Reading your last message again….

The slider is marked in absolute increments of -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5.

The user moves the thumb to a position with a corresponding output of one of those numbers. That position is saved in the preferences.

I take the output from the slider and translate it to a timing change. The user sees an animation synced with music notation happen sooner or later on the screen. In the current linear form, that change is precisely the same for each increment. But I have found that most of the adjustment is needed around the zero mark, mainly having to do with the speed of the user’s computer, so I need finer adjustment there. 

If a user really wants to change the timing a lot, he can do so by moving it to 4 or 5—it’s all subjective for each user—but the point of the adjustment is to allow everyone to get it just right.

The number output from the algorithm is an offset to trigger the animation earlier so after processing is done the animation looks like it is in sync.

> What is your target output for example at -300, -60, 60 and 300
> and some other values in between? What numbers do you wish to see
> there?


It seems for Windows users, zero (-300 output) makes things happen too soon, and moving it to -1 (-360 output) makes it late. I could change the slider to show a range of -10 to +10 to keep the visual indication of exact linear change with more precision, but I’m choosing to try to do it in a non-linear fashion and keep the user interface simple.

Peter




On Feb 26, 2016, at 1:38 PM, Peter Bogdanoff <bogdanoff at me.com> wrote:

> Thanks Kay and Hermann,
> 
> I’m using the mobGUI slider.
> 
> The range of settings chosen on the slider can be -5 to +5. That range of values equals a span of 1 second—up to 1/2 second (300 blocks on the player) slower or faster. The actual position selected by the user will result in a time adjustment up to that or less.
> 
> Both of your methods seem to make sense and I’m trying them out now.
> 
> Thanks!
> 
> Peter
> 
> 
> On Feb 26, 2016, at 12:27 PM, [-hh] <hh at livecode.org> wrote:
> 
>>> Kay C. wrote:
>>> But then again I failed English so maybe I completely misunderstood what
>>> Peter was trying to achieve with his slider. :-(
>> 
>> @Kay C.
>> I didn't want to critisize you with my answer, sorry.
>> 
>> Of course you are correct with the "rounding", he said he can "vary the
>> events by 1 second", sorry. So he should use
>>   round(c*f(..))
>> with my solution too, because that *gets* the thumbpos.
>> 
>> After your remark reading Peter's first post again it's still not
>> clear for me what he really wants:
>> 
>> @Peter
>> Could you please go more in detail.
>> 
>> You have a scrollbar of width 200,
>>   startValue -300 (or -5*60),
>>   endValue 300 (or 5*60).
>> What is your target output for example at -300, -60, 60 and 300
>> and some other values in between? What numbers do you wish to see
>> there?
>> 
>> Possibly you are thinking of a scrollbar that varies it's thumbs
>> units. Say for example, if the width of your scrollbar is 200:
>> 
>> from left to left+40 divides into -5*60 to -2*60
>>     = 180 units scaled to width 40
>> from left+40 to left+160 divides into -2*60 to 2*60
>>     = 240 units scaled to width 120
>> from left+160 to left+200=right divides into 2*60 to 5*60
>>     = 180 units scaled to width 40
>> 
>> This would scale the **INPUT** (=the x-axis), what is possible
>> to achieve, but you then have to script your own "showValue" field.
>> 
>> The current approaches of Kay and me scale the **OUTPUT** (= y-axis),
>> usually quite different.
>> 
>> @Kay C.
>> Do you agree with that second possible interpretation?
>> 
>> hh
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list