Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Animated Knobs - Where are the 'Steps' ?

For general discussion related FlowStone

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Tue Apr 30, 2013 1:25 am

Nubeat7 wrote:i edited the download, it includes the default now too, for me grafics and interacting really brought me into the ruby but i`m still far away from more complex stuff yet, but thats the nice thing after short time you will be able to write little codes and be happy that they work and bring you more easy solutions than doing it in green, and so you can grow slowly into it..


Thanks for both the 'update' AND the encouragement !!! :D

My SM sat on the 'shelf' for quite some time ... I had some delusional ideas that I could maybe write a better VST :shock:
:lol:

About 2 months ago I needed to put a 'virtual controller' together for a special project. Thanks to 'forums' and all the very helpful 'experts', I been able to realize this. Now I find myself having to decide to take this to the next level, and it seems that FS would be an obvious choice.

Since it all has been quite a learning curve for me to this point, the expansion of tools available with FS [along with the now more familiar SM concept] all point to making the migration sooner than later.

Another point ... seeing that sooo many of those I owe 'cases of beer, wine, etc' are here at the FS forum ... it would only be fair to transfer the 'running tab' to the new hang. :lol:


EDIT: Just checked out the latest version. Works great.

I was also interested to see where the new code went in. I was close ... but from what I've read ... being close is no cigar with RUBY :lol:
Thanks again NuBeat !
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Tue Apr 30, 2013 10:02 pm

Playing with RUBY ... or should I say, 'RUBY is playin ME'. :oops:

Using the recently modified 'Knob with Gauge' [which now has 'Stepped' values, and [CNTRL-click] to 'Default' ...

The next major element is to populate the 'gauge' with user defined values. This is what I've been now trying to do.

I need to be able to enter a list of [say] EQ values that comprise of alpha-numeric values [i.e.: 22, 150, 800, 1k5,
3k6, 7k8, 10k, 12k, etc] for example.

I wanted to feed this into the RUBY panel, having it know all the values AND the total #. Basically looking to 'automate' the process of labeling a knob.

In the schematic, I've tried to sneak in and alter parts of the code as I try to learn how this RUBY stuff works. I was able to munge together a few lines and get some encouraging results. I also have been very successful in having Ruby light up error messages like no bodies business :lol:

I included 2 array boxes. The pure 'numeric' one plays clean, but as soon as the alpha/numeric mix is tried ... the dreaded ruby-error :roll:

This is brand new stuff for me. I'm reading through all the post I can find ... but I still need a lot more time actually studying this stuff.

This 'Gauge' feature is so important to anything I want to build [I'm sure for many others too]. This one feature is the decider to migrate from SM to FS. Doing this GUI stuff within KnobMan worked, but is too time consuming and have many limitations to what project design I'm thinking toward.

The 'error' seems to relate to a mismatch variable type. My 'hack' to the original code is nothing more than that. This needs to be a very smart, clean implementation ... and this rookie ain't got it :oops:

Appreciate any help trying to do this !
Thanks!
Eq values around knob guage-1.fsm
(7.93 KiB) Downloaded 918 times
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby Tronic » Tue Apr 30, 2013 11:05 pm

you can use this function to reformat the string

Code: Select all
str = '12k'' # work too with 1k5
if str =~ /k/ # regex condition if any character 'k' is found
replace = str.gsub(/k/,"\.").to_i  # replace character 'k' with '.'
replace*1000 # make it in kilo vlaue
end
# => 12000
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby Tronic » Tue Apr 30, 2013 11:18 pm

I forgot,
of course use this for the mathematical side, and to the label instead of the value,
you supply the text from the array ... '1k5'
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Tue Apr 30, 2013 11:25 pm

Hi Tronic,

hmmm ... don't misunderstand ... I'm not needing to convert 1k5 to 1500.

The guage display SHOULD be able to display whatever is in the string array. For some reason, the example I posted baulks when it hits the alpha portion.

BTW ... the intent is to 'short hand' the label display to minimize clutter.

In projects I'm building, I may have [some] 16 different equalize panels to house. Each with Frequencies, Gain values, and 'Q' bandwidth values. I would like to hand enter those into an array list for each knob [as entered], and have the gauge properly notated.

Does that make sense ?

... also ... I DO appreciate the code you posted ! Not so much for this need ... but there will be other situations that this would be ideal. Thank-you!
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby Tronic » Tue Apr 30, 2013 11:28 pm

sorry my mistake only make this change

v.drawString ("%g"%val),font,sf,rect,(Brush.new @colour)

to

v.drawString ("%s"%val),font,sf,rect,(Brush.new @colour)
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Tue Apr 30, 2013 11:41 pm

Tronic wrote:sorry my mistake only make this change

v.drawString ("%g"%val),font,sf,rect,(Brush.new @colour)

to

v.drawString ("%s"%val),font,sf,rect,(Brush.new @colour)


Oh my ... that did it !!!!!!!!!!!!!!!!!!!!!!!!!!

What is the difference that %g to %s make ??? What do the g and the s represent ??

Because at the top of all the code, the 's' would seem to define the 'size' for the guage .
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby Tronic » Wed May 01, 2013 12:04 am

's' represents a variable in the code,
while the "%g" or "%s" is a string format.
a link better than a thousand words.

however you can take the size of the array with 'size' method.

@eq_label.size
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Wed May 01, 2013 12:30 am

Tronic wrote:'s' represents a variable in the code,
while the "%g" or "%s" is a string format.
a link better than a thousand words.

however you can take the size of the array with 'size' method.

@eq_label.size


Thank-you Tronic ! Not only for the corrections, but for the cheat-sheet link, and the size variable.

I'm going to need quite some time just to get bad with this stuff :shock:

You 'Guys' might not think this good ... but this single programming option/flexibility has tilted the decision to move over to the FS platform. The BAD part [for you-es guys] .... I'll have to hang here at THIS forum :shock:
:lol:

Really ... I hope to NOT be a PITA. I have plenty of just foundational concepts to study and learn. This forum is proving to be a wealth of information [as SM forum].

Again ... Thanks for your time, patience, and help!
:)
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

Re: Animated Knobs - Where are the 'Steps' ?

Postby RJHollins » Wed May 01, 2013 12:33 am

update ... it now appears that I didn't even need the 'str array' primitive to feed RUBY.
8-)
RJHollins
 
Posts: 1569
Joined: Thu Mar 08, 2012 7:58 pm

PreviousNext

Return to General

Who is online

Users browsing this forum: Google [Bot] and 8 guests