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

A new approach to trigger limiting

Post any examples or modules that you want to share here

A new approach to trigger limiting

Postby tulamide » Sun Dec 27, 2015 5:51 pm

While working on r2 of the True Vector Pad (yes, an update is coming soon!), I needed a trigger limiter for the preset parameters that are sent from the preset manager to the module. The limiter prim is bound to the redraw rate, so I thought a Ruby solution could work even when there are no redraw triggers.

I kind of was successful. Indeed my solution limits incoming triggers, but it is very inaccurate the higher the limit rate is set. For example, at 10 triggers per second the real output rate is around 9.6 tps which is ok. But at 30 tps the real output rate is around 23 tps, etc.

I've made a test schematic for all you Rubyists that you can play with and hopefully optimize!
Attachments
Trigger Limiter.fsm
(2.78 KiB) Downloaded 1106 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2692
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: A new approach to trigger limiting

Postby martinvicanek » Tue Dec 29, 2015 12:23 am

Here is an alternative. It has a queue with configurable length in case you don't want to lose triggers which come too fast. Set qSize = 0 if you don't care. qSize >= 1 will output the desired rate, qSize = 0 will result in less than that because no buffering takes place.
Attachments
Trigger Limiter(MV).fsm
(3.13 KiB) Downloaded 1096 times
User avatar
martinvicanek
 
Posts: 1322
Joined: Sat Jun 22, 2013 8:28 pm

Re: A new approach to trigger limiting

Postby tulamide » Tue Dec 29, 2015 12:14 pm

Nice! A queue of course! Went into my toolbox. Thanks!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2692
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: A new approach to trigger limiting

Postby Tronic » Tue Dec 29, 2015 1:21 pm

I like to use this code for trigger limit, and also I can execute an block of code with it.

sorry only text editor avaible.... :|
I think it work....

Code: Select all
def init
   @block_test = 0
end

def event i, v , t
   trigLimit(100) {
      watch "block_executed", @block_test+=1
      output 0, nil
   }
end

def trigLimit(d,&block)
   @i ||=0
   if @i<d
      @i+=1
   else
      yield if block_given?      
      @i=0
   end
end


Edit: make the example more clear, for block.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm


Return to User Examples

Who is online

Users browsing this forum: No registered users and 15 guests