Page 13 of 14
Re: Flowstone Guru Blog
Posted: Wed Apr 08, 2015 1:05 am
by tulamide
You're right, there's no setColor method for the LinearGradientBrush class (which isn't inherited from the Brush class). But you can use the setInterpolationColor method. If you just want to change the initial 2 colors, you've set, then setInterpolationColor [[start color, 0], [end color, 1]] will do that (the second parameter defines the position on a the gradient as a percentage, with 0 = 0% and 1 = 100%, or start and end

But this is a method that is documented.
Here's a fun method that's undocumented: Name your ruby edit instance, then in the instance type "caption" (without the double quotes) With the callback structure we've created some time ago, you could do some magic

Re: Flowstone Guru Blog
Posted: Fri Apr 10, 2015 11:44 pm
by Exo
Thanks tulamide,
Not sure what you mean by naming the Ruby edit instance?

which method is that?
Re: Flowstone Guru Blog
Posted: Sat Apr 11, 2015 12:07 am
by tulamide
Just a misunderstanding! You can name the Ruby edit instance just as you can name all elements of Flowstone (by clicking on 'N' when the instance is selected). See attachment, although it's almost slanderous to provide you with an example

Re: Flowstone Guru Blog
Posted: Sat Apr 11, 2015 12:15 am
by Exo
Ah Okay very cool!
Yes that would be very handy and easy for setting an "id" for each Ruby Edit, thanks!
"Caption" is a strange name for the method though.
Re: Flowstone Guru Blog
Posted: Sat Apr 11, 2015 1:08 am
by tulamide
You asked for it, you get it.
Ruby Stripped, Part 3: ArraysCaution: A wall of text awaits you

Re: Flowstone Guru Blog
Posted: Sat Apr 11, 2015 2:45 am
by RJHollins
Wow ... a lot of stuff to absorb/learn .... Thanks tulamide !
After a first read, I realize that I still have plenty to understand. Arrays are so essential to many of my projects.
I had plenty of struggles learning how to use particular syntax to actually utilize the arrays as I need. Be it to make multi-dimensional arrays, sorting, searching, combining/separating, etc.
I know the power is there to do these things. And it seems it can be much cleaner [code wise] to do it with RUBY, rather than PRIMS.
If you did another 50 tutorials JUST on arrays, and various techniques to use them .... I wouldn't mind the least !!!
Thanks again, tulamide ... aways look forward to your postings !

Re: Flowstone Guru Blog
Posted: Sun Apr 12, 2015 6:07 pm
by tulamide
You're welcome

When you're at a point at which you would get away with just a documentation of the methods, I recommend
http://ruby-doc.org/core-1.9.3/Array.html
Re: Flowstone Guru Blog
Posted: Thu May 14, 2015 9:08 am
by martinvicanek
A new little blog entry on
mapping control parameters, along with stuff for
download.
Re: Flowstone Guru Blog
Posted: Fri May 15, 2015 12:44 am
by Nubeat7
thank you martin this is really useful,
i did one for delay speed a while ago which would maybe fit into this, if you think so you are welcome to include it.
it is done to fit to midi cc knobs (0..127 to get the best results with your midi controller) as well as for 0..1 input and calculates also various synced modes, it outputs samples from 1 sample up to 999ms (as integers for simple not interpolated delays)
Re: Flowstone Guru Blog
Posted: Fri May 15, 2015 6:11 pm
by Perfect Human Interface
Hey, cool. I like that you made some stream versions; that could be useful.
Just a couple things to contribute from my own experiences: the specific values you choose for max/min etc. are very important. For example, in a log scale, a max of 1 and min of .01 will give you a far different result than max 1 and min .0001 in terms of the "steepness" of the log scaling. Same thing if your min is 0.1 and max is 10 or max is 20. So oftentimes you'll just have to experiment with different values to get what "feels" right.
Also, for log mapping, since it can't go to 0, I use a trick of adding the min value to the input value, then performing the log math, then subtracting the min value off the result, resulting in a scale that goes to true 0. This also effects the "shape" of the scaling somewhat so it may require some tweaking as described above. I noticed however that you (Martin) included a pseudo-log method that does appear to go to 0. I'm not sure which is better.
