found bug in Slider Vertical (ruby)

For general discussion related FlowStone
Post Reply
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

found bug in Slider Vertical (ruby)

Post 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.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: found bug in Slider Vertical (ruby)

Post by billv »

Yeh..it's real wierd in there Walter... :lol: ..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.)
slider_vertical_fix.fsm
(214.58 KiB) Downloaded 936 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: found bug in Slider Vertical (ruby)

Post 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
Attachments
slider.fsm
(11.45 KiB) Downloaded 948 times
Last edited by Nubeat7 on Sun Feb 15, 2015 9:46 am, edited 1 time in total.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: found bug in Slider Vertical (ruby)

Post 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
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: found bug in Slider Vertical (ruby)

Post by Walter Sommerfeld »

Thanks for your versions guys...

my little mod works 4 me because i don't use the preset manager... ;)

cheers!
Walter
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: found bug in Slider Vertical (ruby)

Post 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
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: found bug in Slider Vertical (ruby)

Post 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
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: found bug in Slider Vertical (ruby)

Post by RJHollins »

Once again, saves the day ... Thank-you NuBeat :D

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!

8-)
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: found bug in Slider Vertical (ruby)

Post by RJHollins »

hmm ... I'm getting RUBY errors using the '... for key holding change the mouse capture methode:'

will try again :|
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: found bug in Slider Vertical (ruby)

Post by Nubeat7 »

works here with FS 3.06
Post Reply