kortezzzz wrote:If so, whats the proper way to build an array in the "value" version?
They do build the array in the same way, but they also need the correct object (aka class) type to be present. With a midi input it is automatically the correct object type, but not with a generic RubyValue. And altough you have three inputs, you don't restrict the event method regarding what to react to and so the code is executed not only when midi data comes in, but also whenever lowest or highest note inputs are changed.
The "V" stands for RubyValue. This is no term from Ruby, but from Malc. And I don't think it's the best name for its purpose, because a RubyValue is no value, but a container. It can contain any object (aka class) that Ruby is aware of. An array as well as a number, a string as well as a hash table, even a graphics path. But, since it is a container, it won't be filled with the needed object type from the beginning. Instead it is filled initially with the nil class. And the nil class does not have a method called "to_a"/"to_array". And the first three times the method is called is from a empty V (so the nil class), the lowest note (it still looks at the v-input, so still the nil class) and the highest note input (again empty v-input/nil class)
Therefore you need to change two things:
1. It needs to be fed with a Ruby Midi class
2. It needs to only react to a midi event
The first one is important, since the red midi you know of is not a Ruby Midi Class. Luckily it is quite easy to convert it into a RubyValue that following modules will understand. I've created such a conversion module.
The second one is easily done by following the code examples I gave in my earlier posts...(think about it)...(think about it)...now be
I've also corrected the code of the modules to only react to midi events, following my own examples from my earlier posts...(yeah, I really enjoy seeing you go

)
But there's more. The Ruby Midi Class can be directly manipulated, without the need for a conversion to and from an array. Just use the class methods "status", "channel", "data1" and "data2". I've also added a module that makes use of it.