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

Need a Ruby float array solution

For general discussion related FlowStone

Need a Ruby float array solution

Postby kortezzzz » Sat Dec 12, 2015 9:29 pm

Hi,

I'm trying to find a simple ruby solution that would replace the whole array values to my own value. For instance, if the array is:

0.5
0.7
0.6
0.4

I would like to replace the whole bunch of values with 0.1 to end up with:

0.1
0.1
0.1
0.1

Why is it needed? because while FS's multisample module extracts the sfz file's values correctly, it yet doesn't allow determining them with knobs, so I can't prevent fundamentals values like "release=29" to be streamed... moreover, for instance, if I would like to customize the each of the AHDSR array values with my one desired values (with knobs), I have no way to control the arrays correctly. Any suggestions?
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Need a Ruby float array solution

Postby tulamide » Sat Dec 12, 2015 10:14 pm

I can only answer the Ruby part. There's a method for arrays, called fill. It takes an object as parameter.
Code: Select all
ary = 0.5, 0.7, 0.6, 0.4
ary.fill(0.1)
# Now the array is [0.1, 0.1, 0.1, 0.1]


If you create a float array input and a float input, and name them "array_in" and "float_in", plus a float array output, then this code should work:

Code: Select all
def event i, v
    a = @array_in
    a.fill(@float_in)
    output a
end


This will activate whenever you change the float array at input or the float you wish the array to fill with.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Need a Ruby float array solution

Postby kortezzzz » Sun Dec 13, 2015 10:04 am

Thanks tulamide, works perfectly and now, each aspect of the multisample module can be controlled manually :D
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm


Return to General

Who is online

Users browsing this forum: No registered users and 50 guests