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
Radio buttons under preset manager
43 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Re: Radio buttons under preset manager
thanks for the encouraging words, billv
The last 6 months since I started with SM, and then the recent transition to FS has been very interesting. I was intriqued by the 'circuit board' [schematic] concept. Adding RUBY to FS has now expanded the Universe.
Although I still struggle to hit the '#" and often times hit the '@' key instead
As I played with with the Radio button by changing to Case...Select, I found that I can further reduce the coding.
For each of the 'WHEN' statements, we don't [seem] to need the 'i=' part.
We can simplify to
So the new code can be:
This [probably] has zero influence on code efficiency or optimization ... but it can sometimes be easier to type and read.
Fun stuff ! Thanks
The last 6 months since I started with SM, and then the recent transition to FS has been very interesting. I was intriqued by the 'circuit board' [schematic] concept. Adding RUBY to FS has now expanded the Universe.
Although I still struggle to hit the '#" and often times hit the '@' key instead
As I played with with the Radio button by changing to Case...Select, I found that I can further reduce the coding.
For each of the 'WHEN' statements, we don't [seem] to need the 'i=' part.
- Code: Select all
when i=4
We can simplify to
- Code: Select all
when 4
So the new code can be:
- Code: Select all
def event i,v
case i
when 0
output 0,0
when 1
output 0,1
when 2
output 0,2
when 3
output 0,3
when 4
output 0,4
when 5
output 0,5
when 6
output 0,6
when 7
output 0,7
when 8
output 0,8
end
end
This [probably] has zero influence on code efficiency or optimization ... but it can sometimes be easier to type and read.
Fun stuff ! Thanks
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Radio buttons under preset manager
RJHollins wrote:by changing to Case...Select
Yeh RJ, that's probably much better.
I remember the "case...select" thing from back when i tried to learn VB....
but it never sunk into my repertoire...I'm still writing like a baby...
I'm finding it real hard to process all the new things I'm learning....
Seems like for every new thing I learn, there's another dozen things I pick up in
the process, that i have no time for and have to backburner it, hoping to get back to it
in the future.
Can be frustrating how powerful this software is...
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
I'm going through a similar experience like that.
If it wasn't for the forums, and the kind/smart members here ... my 'projects' would be half baked ...if that.
I try not to get too overwhelmed. I do make it a point to follow every thread I can. Some of them are well above my current understanding, which is fine for the moment. There have been several times I've gone back later [often from a search], and have a new perspective and a better sense. Then I'll try to do something that should be so easy, and just have all kinds of trouble with it Oh well ... as long as I keep improving and have fun with the challenge.
If it wasn't for the forums, and the kind/smart members here ... my 'projects' would be half baked ...if that.
I try not to get too overwhelmed. I do make it a point to follow every thread I can. Some of them are well above my current understanding, which is fine for the moment. There have been several times I've gone back later [often from a search], and have a new perspective and a better sense. Then I'll try to do something that should be so easy, and just have all kinds of trouble with it Oh well ... as long as I keep improving and have fun with the challenge.
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Radio buttons under preset manager
I got to share a "Graphics Fix" for the original selector I posted.
Was working on my Pitch Mod...
one trigger has got to move 20 selectors and 10 knobs....
end result wrong...redraw's not fast enough and not "clean"....
graphics section re-drawing at three points.....background,foreground and text colour.
Now the background and green text are not re-drawn...the black text copied into every forground,
so the text is not re-drawn either, just appears with the foreground on selection.
Re-uploaded( forgot to connect b/ground to gui)
Was working on my Pitch Mod...
one trigger has got to move 20 selectors and 10 knobs....
end result wrong...redraw's not fast enough and not "clean"....
graphics section re-drawing at three points.....background,foreground and text colour.
Now the background and green text are not re-drawn...the black text copied into every forground,
so the text is not re-drawn either, just appears with the foreground on selection.
Re-uploaded( forgot to connect b/ground to gui)
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
Too many componnents for this. I would recommend you great trogluddite post with example in GRAPHICS CLASSES 2_001.fsm
http://dsprobotics.com/support/viewtopic.php?f=3&t=1114
There is exactly what you need and only one ruby module.
http://dsprobotics.com/support/viewtopic.php?f=3&t=1114
There is exactly what you need and only one ruby module.
-
TrojakEW - Posts: 111
- Joined: Sat Dec 25, 2010 10:12 am
- Location: Slovakia
Re: Radio buttons under preset manager
TrojakEW wrote:There is exactly what you need and only one ruby module.
Thanks for the tip ....got that fsm....will take a look at method later when i get home,
see if i can work out how it's done..Was way over my head last time i looked...maybe
now I can understand it a bit more....
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
That's a great example from Trog........
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
...but hard to modify for learner....
That's the problem with Trog...he writes code in "genius" .... hard to access...
I failed yesterday to mod his selector to suit...at 3 different places....
So his technique is out of reach for me at the moment.
But i saw the results of his methods...and this is a MUST HAVE for my current project.
Had no choice now but to slam on the brakes.....go into the ruby "graphics" section
for the first time...work out how to do it....
User guide had the info i needed...almost there....
That's the problem with Trog...he writes code in "genius" .... hard to access...
I failed yesterday to mod his selector to suit...at 3 different places....
So his technique is out of reach for me at the moment.
But i saw the results of his methods...and this is a MUST HAVE for my current project.
Had no choice now but to slam on the brakes.....go into the ruby "graphics" section
for the first time...work out how to do it....
User guide had the info i needed...almost there....
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
My first attempt is working . Strung about 50 together and its clean...
Seems like its more work to modify than Trogs though...
But it's written in "dumb"..so for me easy to work with so far..
Suggestions welcome....
Seems like its more work to modify than Trogs though...
But it's written in "dumb"..so for me easy to work with so far..
Suggestions welcome....
- Code: Select all
def draw v
#OUTPUT VALUE IN GREEN
output 0,@index
#MY LABELS
@mystring0 = "1/1"
@mystring1 = "1/4"
@mystring2 = "1/8"
@mystring3 = "16"
#FONT
font = Font.new "Arial",1.1,"bold"
sf = StringFormat.new
sf.setAlignment "center"
sf.setLineAlignment "center"
#CREATE BACKDROP
v.drawBitmap @background,[0,0,2,2]
v.drawBitmap @background,[0,2,2,2]
v.drawBitmap @background,[0,4,2,2]
v.drawBitmap @background,[0,6,2,2]
###DRAW BACKGROUNDS
#DRAW BACKGROUND 1
rect = [0,0,2,2]
v.drawString @mystring0,font,sf,rect,(Brush.new @backtext)
#DRAW BACKGROUND 2
rect = [0,2,2,2]
v.drawString @mystring1,font,sf,rect,(Brush.new @backtext)
#DRAW BACKGROUND 3
rect = [0,4,2,2]
v.drawString @mystring2,font,sf,rect,(Brush.new @backtext)
#DRAW BACKGROUND 4
rect = [0,6,2,2]
v.drawString @mystring3,font,sf,rect,(Brush.new @backtext)
#MOVE THE GRAPHIC
if @index==0 then @level =0 end
if @index==1 then @level =2 end
if @index==2 then @level =4 end
if @index==3 then @level =6 end
v.drawBitmap @foreground,[0,@level,2,2]
#DRAW THE SELECTED TEXT
rect = [0,@level,2,2]
#CHANGE THE STRING
if @index==0 then v.drawString @mystring0,font,sf,rect,(Brush.new @color) end
if @index==1 then v.drawString @mystring1,font,sf,rect,(Brush.new @color) end
if @index==2 then v.drawString @mystring2,font,sf,rect,(Brush.new @color) end
if @index==3 then v.drawString @mystring3,font,sf,rect,(Brush.new @color) end
#REDRAW THE GRAPHIC
redraw @state
end
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Radio buttons under preset manager
Wow ... everyone must be so busy ... anyway,
This is some fine work here billv !!
These are nice GUI interfaces to have available. Hope to look through the coding to see if I can understand
I've been playing with arrays and strings in RUBY ... not too exciting ... except when I get something to work !
I noticed you put the CASE...SELECT to work in your last post. Looks like you have it down nicely
I do have a RUBY question that you might help me with ... I've noticed the use of the 'V' for some of the INs and OUTs. I need to to some manual reading, but was wondering if anyone could help explain what data is using [or needing] the 'V' type ???
Thanks!
This is some fine work here billv !!
These are nice GUI interfaces to have available. Hope to look through the coding to see if I can understand
I've been playing with arrays and strings in RUBY ... not too exciting ... except when I get something to work !
I noticed you put the CASE...SELECT to work in your last post. Looks like you have it down nicely
I do have a RUBY question that you might help me with ... I've noticed the use of the 'V' for some of the INs and OUTs. I need to to some manual reading, but was wondering if anyone could help explain what data is using [or needing] the 'V' type ???
Thanks!
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
43 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 107 guests