Page 1 of 2

Lfo in ruby

Posted: Sat Jun 22, 2013 2:38 pm
by borodadada
Hello, trying to write the LFO on Ruby, but it is not my true test, I think. I need a number generator for example from 0 to 1 and back again, what I want step , endlessly. Data format float for example, an example is attached ...
Do not get me to do the cycle, may be who knows how to do this?
Okey... screenshot.
http://rghost.ru/46940249/image.png

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 2:56 pm
by Tronic
missing an important parameter
which increase-rate should reach?
seconds, milliseconds or more?

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 3:50 pm
by borodadada
sorry, I find it difficult to translate this answer

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 3:58 pm
by Nubeat7
why not putting the values in an array and increase the index with time - is this possible? (i`m not at home atm..)

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 4:14 pm
by borodadada
arr = [1, 2, 3, 4, 5, 6,.....] ?
arr[0]
arr[1]
arr[2]
.....
?

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 4:20 pm
by Nubeat7
i tought a while loop .. which runs as long as input x is on

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 4:31 pm
by Nubeat7
something like:

Code: Select all


i = 0
values = [your values]

while @inX  #or what ever condition
  output values[i],t+2.2
  i += 1
end


but don`t know if the syntax for the time adding works like this (still not at home)

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 4:37 pm
by borodadada
If I'm not mistaken, this ruby can not use loops.

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 5:15 pm
by nix
What you want is a Ruby wavetable osc maybe,
and sure u can use feedback loops in Ruby.
I can help in the next week

Re: Lfo in ruby

Posted: Sat Jun 22, 2013 5:48 pm
by Tronic
borodadada wrote:sorry, I find it difficult to translate this answer


your ruby LFO needs to work with the audio or just for the greens?
at what speed must run the increase of the step for your counter?