Ruby Knob fully customisable

Post any examples or modules that you want to share here
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Ruby Knob fully customisable

Post 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.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Ruby Knob fully customisable

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

Re: Ruby Knob fully customisable

Post 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
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Ruby Knob fully customisable

Post 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
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Ruby Knob fully customisable

Post 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
steph_tsf
Posts: 249
Joined: Sun Aug 15, 2010 10:26 pm

Re: Ruby Knob fully customisable

Post 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.
Attachments
knobs.png
knobs.png (81.05 KiB) Viewed 29575 times
knobs properties.png
knobs properties.png (31.1 KiB) Viewed 29575 times
knobs (Nubeat7 steph_tsf MyCo).fsm
(6.56 KiB) Downloaded 1433 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Knob fully customisable

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

Re: Ruby Knob fully customisable

Post by Nubeat7 »

tested the new in place edit in ruby, you can edit the value via left mouseclick now...
Attachments
knoblabel edit.fsm
(2.51 KiB) Downloaded 1408 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Knob fully customisable

Post by Nubeat7 »

edit: look at the first post to get the latest vertsion!
Last edited by Nubeat7 on Wed Dec 19, 2018 3:59 pm, edited 2 times in total.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Knob fully customisable

Post 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!
Last edited by Nubeat7 on Wed Dec 19, 2018 4:12 pm, edited 4 times in total.
Post Reply