How can I make persistent ruby data within plugin?
Posted: Tue Nov 10, 2015 11:11 am
Hi,
I create an array and I randomize its value using a ruby function:
Once I create it, I'd like that every time I edit ruby script (recompile) or I close/reopen the project/plugin, the array stay persistent. So I work on the same values every time.
Once I re-random it, it recreate the array and store the new one. How this is possible in ruby? In Kontakt scripting for example I use make_persistent(myArray).
Is there somethings similar in FlowStone?
Thanks!
I create an array and I randomize its value using a ruby function:
Code: Select all
def init
@lfo_size = 100
@lfo_shape_1 = Array.new @lfo_size
end
def event i, v
if (i == "start")
# somethings
elsif (i == "random")
randomLFOs
end
end
def randomLFOs
for i in 0..@lfo_size
@lfo_shape_1[i]=rand(100)
end
end
Once I create it, I'd like that every time I edit ruby script (recompile) or I close/reopen the project/plugin, the array stay persistent. So I work on the same values every time.
Once I re-random it, it recreate the array and store the new one. How this is possible in ruby? In Kontakt scripting for example I use make_persistent(myArray).
Is there somethings similar in FlowStone?
Thanks!