Page 1 of 1
found bug in Slider Vertical (ruby)
Posted: Sun Feb 15, 2015 2:02 am
by Walter Sommerfeld
dunno if it's already known:
If u try to use the set input as a remote one:
if u feed it with 0.2 the output shows 0.8 aso...
solution:
Code: Select all
def event i,v
if i==2
@value = [0,1-v,1].sort[1]
output 1-@value # was wrong: only @value (missing the 1-)
end
end
The Horizontal one is O.K.
Re: found bug in Slider Vertical (ruby)
Posted: Sun Feb 15, 2015 5:47 am
by billv
Yeh..it's real wierd in there Walter...

..don't understand the FS code fully,
but anyway, here's a
quick fix...(look in the def event..)
Seems ok....the other guys might come up with better solution ....
PS.(Dont' forget to report the issue if the ruby gurus see it as a bug.)
Re: found bug in Slider Vertical (ruby)
Posted: Sun Feb 15, 2015 9:27 am
by Nubeat7
the output should be without -1!
so it outputs what its input, if you do 1- value it outputs an inverted 0..1 value...
(to do it right do the output first and then do the sorting which inverts the value for drawing)
but this wouldn't arrive the output of the slider anyway, because it is locked by the interaction boolean!
the set input is only for drawing the slider so the output is not needed (don't know why it is here!?)
so set it from outside in the presetparameter part, use a last switch right before the value input of the presetparameter primitive (like the midi cc)
the 1- value is only for the drawing and setting with the mouse because 0 is at the top while in a slider 0 should be at the bottom
here is like i do it normally, no need to set the interaction boolean to true like billy is doing it - if you do it this way you need to set it back to false also! because other wise it wouldn't draw the the slider on programchanges
Re: found bug in Slider Vertical (ruby)
Posted: Sun Feb 15, 2015 10:40 am
by billv
Nubeat7 wrote:set it from outside in the presetparameter part
yeh..thats right...we are setting it from the wrong place. thanks nubeat7
Re: found bug in Slider Vertical (ruby)
Posted: Mon Feb 16, 2015 11:10 pm
by Walter Sommerfeld
Thanks for your versions guys...
my little mod works 4 me because i don't use the preset manager...
cheers!
Walter
Re: found bug in Slider Vertical (ruby)
Posted: Wed Feb 18, 2015 3:13 am
by RJHollins
Testing the NuBeat vertical slider [fix] ...
Still playing with it ... but a question.
The DEFAULT resetting. The value is set to 0.125, but there doesn't seem to be a way [mouse/key combo] that returns the slider to a default position.
This is a function feature that is important ... at least in my projects.
Just wanted to mention.
Thanks
Re: found bug in Slider Vertical (ruby)
Posted: Wed Feb 18, 2015 9:26 am
by Nubeat7
@Rj Hollins
i normally use doubleclick for it..
create a "default" input and add:
Code: Select all
def mouseLDouble x,y
@value = 1-@default
output 0,@default
end
or for key holding change the mouse capture methode:
Code: Select all
def mouseMoveCaptured x,y
if isKeyPressed "CTRL"
@value = 1-@default
output 0,@default
output 1,true
redraw
else
sensitivity = ((isKeyPressed "SHIFT") ? 10:1) * @sensitivity
@value -= (@downY-y)/sensitivity
@downY = y
@value = [[@value,1.0].min,0.0].max
output 0,1-@value
output 1,true
redraw
end
end
Re: found bug in Slider Vertical (ruby)
Posted: Wed Feb 18, 2015 5:22 pm
by RJHollins
Once again, saves the day ... Thank-you NuBeat
I'll add in the code for the [CNTRL-click], as that has somehow become a standard in many of the
plugins I use. Want to stay consistent with my little works.
Thanks!

Re: found bug in Slider Vertical (ruby)
Posted: Thu Feb 19, 2015 7:24 am
by RJHollins
hmm ... I'm getting RUBY errors using the '... for key holding change the mouse capture methode:'
will try again

Re: found bug in Slider Vertical (ruby)
Posted: Thu Feb 19, 2015 9:02 am
by Nubeat7
works here with FS 3.06