Array within gen.codebox?
Dear list,
Is there a way in which gen.codebox can use arrays, either directly as an input or output or by sharing the array name like with data and buffer?
Currently I copy list data to and from buffers using fluid.buf2list and fluid.list2buf plus the size of the list within my gencode.
Best, Hans.
Currently, that is as good a solution as I could recommend.
I've made a Feature Request for the ability to set a Data object's values with a list somehow. That one shouldn't be terribly hard, but no commitment to if/when. Getting as output will likely have to remain something like your solution.
FWIW, RNBO can handle list input and output well for such tasks, but we have not yet made a rnbo.codebox~ object.
Great, and thanks for your quick reply. Is there a difference in efficiency/speed in running data through rnbo vs gen (with the above method using flucoma)? In this case, I am talking control rate and in overdrive.
The great thing about rnbo~ is that it has list and event support built in, whereas gen~ is only single sample audio processing (optionally running at control rate with gen no tilde).
If you check the rnbo codebox help file's list tab there are some nice examples of list processing at control rate.
I think it probably depends on what you are doing w/r/t performance, but I'd encourage you doing some comparisons.

Hi Joshua,
Yes, thanks, I found that already.
There is an issue though with rnbo~ and threading, if I check with threadcheck, it is all within the schedular thread, but clearly the messages from rnbo~ are delayed. Maybe it is expected behaviour or I miss a setting somewhere. When I use the right side of the following patch, everything goes well.
The left one though spits out the following print sequence:
print: sel all
print: eraseslot 24
print: clearselection
print: setslot [ 24 `G- ]
print: clearselection
print: setslot [ 24 `C7 ]
print: clearselection
print: setslot [ 24 `F∆ ]
print: clearselection
print: setslot [ 24 `Bb7 ]
print: clearselection
print: setslot [ 24 `A- ]
print: clearselection
print: setslot [ 24 `Abº ]
print: clearselection
print: setslot [ 24 `G- ]
print: clearselection
print: setslot [ 24 `Eø ]
print: clearselection
print: setslot [ 24 `A7 ]
print: clearselection
print: setslot [ 24 `D- ]
print: clearselection
print: setslot [ 24 `G7 ]
print: clearselection
print: setslot [ 24 `G- ]
print: clearselection
print: setslot [ 24 `D7 ]
print: clearselection
print: sel chord 3. 1. 2.
print: sel chord 1. 1. 2.
print: sel chord 1. 1. 2.
print: sel chord 1. 2. 2.
print: sel chord 1. 3. 2.
print: sel chord 1. 3. 4.
print: sel chord 1. 4. 2.
print: sel chord 1. 4. 4.
print: sel chord 2. 1. 2.
print: sel chord 2. 2. 2.
print: sel chord 2. 2. 4.
print: sel chord 2. 3. 2.
print: sel chord 2. 3. 4.
print: sel chord 2. 4. 2.
print: sel chord 2. 4. 4.
Hi Joshua,
And also an idea. Instead of filling a data object with a list might it not be handy to feed lists directly into gen or out of it? And then have an attribute 'lists inout' for gen that makes a few internal dataobject when the attribute is selected? With a copy to buffers (re)sizing buffers becomes an issue as I understood from flucoma development. Internally you can solve that with indexing I guess?
Best, Hans.