Lfo in ruby

For general discussion related FlowStone
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Lfo in ruby

Post 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
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Lfo in ruby

Post by Tronic »

missing an important parameter
which increase-rate should reach?
seconds, milliseconds or more?
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Re: Lfo in ruby

Post by borodadada »

sorry, I find it difficult to translate this answer
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Lfo in ruby

Post 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..)
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Re: Lfo in ruby

Post by borodadada »

arr = [1, 2, 3, 4, 5, 6,.....] ?
arr[0]
arr[1]
arr[2]
.....
?
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Lfo in ruby

Post by Nubeat7 »

i tought a while loop .. which runs as long as input x is on
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Lfo in ruby

Post 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)
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Re: Lfo in ruby

Post by borodadada »

If I'm not mistaken, this ruby can not use loops.
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Lfo in ruby

Post 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
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Lfo in ruby

Post 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?
Post Reply