Search found 539 matches

by Tronic
Tue Oct 29, 2019 8:28 pm
Forum: General
Topic: How to do this properly in Ruby?
Replies: 7
Views: 15827

Re: How to do this properly in Ruby?

I post this here as alternative method, more or less performat of other?

Code: Select all

num = 5
a = [2, 3, 4]
a.sort.find{|x| x >= num} || a.first # =>2
by Tronic
Tue Oct 29, 2019 4:24 pm
Forum: General
Topic: How to do this properly in Ruby?
Replies: 7
Views: 15827

Re: How to do this properly in Ruby?

Hi Tulamide,
I think you can use the bsearch method for this case.

Code: Select all

num = 5
a = [2, 4, 6, 7, 9, 11, 1, 2]
a.sort.bsearch{|x| x >= num} || 0 # => 6


--edit to make the result is 0(zero) if nothing.
by Tronic
Fri Nov 10, 2017 2:12 pm
Forum: General
Topic: 64 BIT NEWS
Replies: 12
Views: 39308

Re: 64 BIT NEWS

Yes after this all is possible
viewtopic.php?f=6&t=9186
by Tronic
Sat Jul 16, 2016 2:24 pm
Forum: General
Topic: Timer problem with the midi keyboard
Replies: 3
Views: 13462

Re: Timer problem with the midi keyboard

The midi thread not work for windows timer,
you need to de-thread the trig with an trigger block
and re-thread it with an tick primitive.
by Tronic
Sun Jun 12, 2016 4:10 pm
Forum: User Examples
Topic: Karplus Strong Synthesis
Replies: 12
Views: 44971

Re: Karplus Strong Synthesis

:geek: :arrow: :idea: :arrow: :mrgreen:
by Tronic
Sat Jun 11, 2016 12:47 pm
Forum: General
Topic: knob tooltips
Replies: 79
Views: 190412

Re: knob tooltips

yes, I have already tried this, but if you drag an release too fast,
sometime you have an annoying flash redraw before it is cleared,
I've tried other solutions, but I think better than that for now it is not possible.
by Tronic
Sat Jun 11, 2016 12:13 pm
Forum: General
Topic: knob tooltips
Replies: 79
Views: 190412

Re: knob tooltips

@ Nubeat7
even your suffering of my own bugs,
I can not find an efficient way to handle the mouse up when captured after an drag and drop, and must be resolved.

@tulamide
Thanks for the explanation, but the clearEvents is documented in Chapter 8, page 148
by Tronic
Fri Jun 10, 2016 6:41 am
Forum: General
Topic: knob tooltips
Replies: 79
Views: 190412

Re: knob tooltips

This system has no degradation of performance redraw,
It can be easily customized
and has already implemented a wait before being displayed,
then move your mouse and wait a second to see appear on the tooltips popups.

Edit: need to fix the drag mouse up release, at moment not work, very well.
by Tronic
Sat Jun 04, 2016 3:37 pm
Forum: General
Topic: Trigger Switch in Ruby?
Replies: 8
Views: 23247

Re: Trigger Switch in Ruby?


I would reverse it, since there is no need to even check for 'knob' if switch is false:
def event i,v
if @switch
if i == "knob"
# this block of code is executed only if switch is true
@a = some very big and complicated formula
output 0, @a
end
end
end


yeah, but this not update the ...
by Tronic
Sat Jun 04, 2016 2:28 pm
Forum: General
Topic: Trigger Switch in Ruby?
Replies: 8
Views: 23247

Re: Trigger Switch in Ruby?

add all your code, in the "if" check block

Code: Select all

def event i,v
      if i == "knob"
          if @switch
          # this block of code is executed only if switch is true
             @a = some very big and complicated formula
              output 0, @a
          end
      end
end