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

Ruby for noobs!

Post any examples or modules that you want to share here

Re: Ruby for noobs!

Postby trogluddite » Mon Jan 21, 2013 6:52 pm

Nubeat7 wrote:...is the load and save state needful in this example to work correct with a presetmanager?

Not any reason that I can see - the input and output values of the Ruby prim' are always stored anyway - but that will only affect the values when you first load a 'clean' copy of the plugin - once it's in a song, the preset manager should just take over.
Might help to keep the handle synce'd with the output values at load time though, so I wouldn't scrap them.

Couple of other little things I just noticed...
- With the drag behaviour changed, @x and @y aren't needed in the mouse routines any more - they get defined in the 'draw' method anyway..
- The 'event' parts for the 'set' input values could do with redraws, otherwise the handle may not move when you send preset values into them.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby for noobs!

Postby Nubeat7 » Sun Jan 27, 2013 3:48 pm

ok, i included preset parameters to use it with presetmanager, so XY Pad is finished now.

hope it is a good help for ruby noobs to understand some things bit better..
Attachments
xy pad.fsm
(8.72 KiB) Downloaded 1346 times
Last edited by Nubeat7 on Mon Jan 28, 2013 7:51 pm, edited 5 times in total.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby for noobs!

Postby pall » Sun Jan 27, 2013 6:49 pm

Thanks Nubeat!
But...
If you apply value 1 to the set y input, the y output is 0, and vice versa.
I do not know ... That's right? ;)
pall
 
Posts: 31
Joined: Thu Dec 09, 2010 1:27 pm
Location: Transilvania

Re: Ruby for noobs!

Postby Nubeat7 » Sun Jan 27, 2013 9:28 pm

[url][/url]oh, yeah i left a challenge! ;) .....
Code: Select all
if i==10
      @valy = [0,1-v,1].sort[1]
      output 1, 1-@valy
      redraw
   end
forgot the 1- before the value, there was a similar bug in the FS 3.0 stock slider....
should work right now! i reuploaded the FSM...
its just one thing left, it don`t redraw the position when setting it with the presetmanager?? hmm
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby for noobs!

Postby Nubeat7 » Sun Jan 27, 2013 11:10 pm

normally the preset module should send set value when doing a presetchange but this is not happening, sadly i cannot say why.... when watching the stock slider it is working but everything is the same inside the preset module, or?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby for noobs!

Postby Walter Sommerfeld » Mon Jan 28, 2013 2:21 pm

Hi Nubeat7,

have a look @ the Interact Bool,

def mouseMoveCaptured x,y => output 2 is always TRUE...
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Ruby for noobs!

Postby Nubeat7 » Mon Jan 28, 2013 7:11 pm

Walter Sommerfeld wrote:Hi Nubeat7,

have a look @ the Interact Bool,

def mouseMoveCaptured x,y => output 2 is always TRUE...

the missing code:
Code: Select all
def mouseLUpCaptured x,y
   output 2,false
   releaseMouse


thank you walter! shure when i dont tell ruby that it should be false when finish the mouse action, it cannotwork correct! :oops: ... so reuploaded again! now it really should work correctly :)

i also deleted the triggerswitches inside the preset module to make manual set val possible..
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby for noobs!

Postby Nubeat7 » Wed Feb 06, 2013 10:26 pm

i thightened the code a bit and fixed a little bug : interact was turning true in the mousemovecaptured section - only when moving - now it turns true when leftmousebuttondown, so it reacts already when you click in the mousearea
Attachments
xy pad 01.fsm
(2.27 KiB) Downloaded 1327 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby for noobs!

Postby Walter Sommerfeld » Sun Feb 10, 2013 12:02 pm

Hmm,

none of ur versions sets the right Preset after changes with the arrows...
Saving the param works and its only correctly set (placed on GUI coordinates) after reload the preset...

damn - i hate doing this :oops:
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Ruby for noobs!

Postby Nubeat7 » Sun Feb 10, 2013 10:25 pm

hmm, you checked the latest version too (xy pad 01) ? because it works here on my pc... i downloaded it and added a presetmanager and everything workes right the the coordinates and the values as well!

anyway it sounds weird because when changing a preset the presetparameter prim sends the values directly to the outputs and also to the ruby to set the position as well so when it sets the position right it has to set the values right as well because the datas are from the same source - the current value output of the presetparameter primitive! the only situation where this is happening is when you set the values from outside because before the value from the rubymodule arrives the presetparameter prim there is a triggerswitch which allows signals only while mouseinteract is true but when setting from outside it is false because there is no mouseaction... because of that i removed this option but it could easily added again, just add a lastswitch after the triggerswitch for setting values from outside similar to the one for midicc
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

PreviousNext

Return to User Examples

Who is online

Users browsing this forum: No registered users and 65 guests