Page 6 of 7

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 6:12 pm
by steph_tsf
@Nubeat7 : such fix is not guaranteed to work. Have you tried on your side ? On my side sometimes (say 20% chances) after a double click the Readout doesn't get updated to "default", even when the output got correctly updated to "default". An explanation to this ? It could be that the "output 1, nil" trigger comes too fast, just after "output 0, @default". Can you redraw the Readout, triggered by a "Ticker 25" ? This would be bullet-proof.

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 6:21 pm
by MyCo

Code: Select all

def event i,v
    redraw 0
end


That's the right way... it means: whenever an input is triggered, repaint view

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 6:23 pm
by Nubeat7
thanks myco, this should also fix stephs problem - you dont need the trigger from the knob code to update the read out then

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 6:35 pm
by Tronic
I believe that it is always necessary to separate the calculations in the event method, making them run only if the various inputs or inputs change, and leave in the methodo v.draw draw only the command with the appropriate parameters.

Another thought is to have a sequence from up to down
es.

def someMethod
end

def event
end

def draw
end

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 7:14 pm
by MyCo
@Tronic, you are right. But you have to ensure that all your params are calculated before the first draw happens. For this I use a method recalc and a variable @calced. And then I do something like this:

Code: Select all

def draw(v)
  recalc(v) if @calced.nil?
  ...
end

def recalc(v)
   ...
   @calced = ...
end

def event(i,v)
    ...
    when something important has changed:
    ->   @calced = nil
    ->   redraw
end

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 10:07 pm
by steph_tsf
I'm posting a .fsm containing a few knobs derived from Nubeat7 initiative, no more Trigger Galore, debugged by MyCo. They are all different, featuring different transfer functions. In the properties you can change the colors and other details. I wanted them to be as simple as possible. There is no MIDI support.

Re: Ruby Knob fully customisable

Posted: Wed Jul 10, 2013 10:28 pm
by Nubeat7
thanks steph! very useful transfers, after u figured out the redraw issue, u saved my last project, i already was wondering why the readout was looking so crappy when in use :D, i also know now how importand it is to watch the task manager from time to time :lol:

Re: Ruby Knob fully customisable

Posted: Wed Jul 17, 2013 11:48 pm
by Nubeat7
tested the new in place edit in ruby, you can edit the value via left mouseclick now...

Re: Ruby Knob fully customisable

Posted: Sun Jul 21, 2013 9:55 pm
by Nubeat7
edit: look at the first post to get the latest vertsion!

Re: Ruby Knob fully customisable

Posted: Sun Oct 27, 2013 11:04 am
by Nubeat7
version 3 offers a complete detouched properties panel. Like this just one knobproperties panel for each knobdesign is needed somewhere in an upper level of the schematic. It has just one rubyvalue out so you can easy do different knobdesigns in your project with just changing one linkname, i also optimized the code which makes the knob really lightweight

edit: look at the first post to get the latest vertsion!