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

[SOLVED] Ruby component problem

For general discussion related FlowStone

[SOLVED] Ruby component problem

Postby Dave_Scream » Mon Oct 07, 2013 7:04 pm

Hello.
I have problem with a Ruby component.
My problem in 1 screenshot:
Image
and there is info from manual:
Image

so why error?


Also.

input compare with name not work.
Image
Image
"if (i=0)" - work,
"if (i=="freq")" not working.

this is a working code, because in FL Studio version it works good. But in standalone it throw errors. But I read manual for standalone version and it have section for clearEvents...

whole code
Code: Select all
#--------------------------------------------------------------
#--------------------------------------------------------------
def init
   @ntick = 0
   @counter = 0
   @main_freq = 0
   @ticking = false
   @min_delay = 0.2

   #input "state", true, time+1
end
#--------------------------------------------------------------
def freq_setup
   if @freq <= 0
      @main_freq = 0
   else
      _mfreq = @period.to_f / @freq.to_f
      if _mfreq < 0.1 then
         _mfreq = 0.1
      end
      @main_freq = _mfreq
   end
end
#--------------------------------------------------------------
def event i,v,t
   if (i=="freq" || i=="period" || i=="state")
      watch "f", "lol"
      clearEvents
      freq_setup()
      watch "mfreq", @main_freq
      if @state && @main_freq > 0
         @ticking = true
         input 100,nil,(t+@main_freq)
      else
         @ticking = false
      end
   end
   case i
   when 100 #main_timer
      if @state
         watch "main_timer", t
         input 100,nil,t+@main_freq
         
         rnd = @min_delay + rand((@main_freq.to_f-@min_delay)*100.0)/100.0
         watch "rnd", rnd
         input 101,nil,(t+rnd)
      else
         @ticking = false
      end
   when 101 #event
      output "out"
      
      output "led", true
      input 102,nil,t+0.1
      
      @counter = @counter + 1
      output "counter", @counter
   when 102 #led off
      output "led", false
   end
end
Last edited by Dave_Scream on Mon Oct 07, 2013 8:24 pm, edited 1 time in total.
Dave_Scream
 
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

Re: Ruby component problem

Postby Dave_Scream » Mon Oct 07, 2013 7:24 pm

Allright. FL Studio have version 3.0.2

My standalone version is 3.0.0


3.0.0 is not support clearEvents and connector labels.


version history for 3.0.2:
- New connector referencing in the Ruby component allows you to use an index or a label name to refer to a connector
- New clearEvents method that removes all pending events posted for the Ruby component from which it is called
Dave_Scream
 
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

Re: [SOLVED] Ruby component problem

Postby trogluddite » Mon Oct 07, 2013 10:42 pm

Something we'll have to watch out for this - FL is one step behind, and the updates are much more often than they used to be.
Would be good if we try to remember to say "Built with version XXX", when posting schematic files.
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


Return to General

Who is online

Users browsing this forum: No registered users and 82 guests