hi @murray, thanks.
sorry, i should have been much clearer. in the post above, by “resources” i am exclusively referring to storage and RAM, which are impacted by the parameters we’re discussing. i wasn’t referring to CPU cycles, which basically are not.
i am not suggesting using a LL interface to access op and connection data during the runtime event loop. we don’t need performance metrics to tell us that would be a bad idea; bees network is arbitrarily interconnected and that would obvs require lots of looping over the list. (as to the point about cachce - avr32 UCA has a single level of 16k DCACHE which is probably not gonna come into play here.)
i am just talking about converting the data structure of the aleph:bees operator network to be dynamically allocated, rather than the very strange thing that it is now:
[ https://github.com/tehn/aleph/blob/dev/apps/bees/src/net_protected.h ]
[ https://github.com/tehn/aleph/blob/dev/apps/bees/src/net.c ]
- this looks so crazy because it was written before we had a fully functional malloc()!
it would seem reasonable to me to malloc() each operator and add 4 or 8 bytes to link it in the op list, just for the purpose of making arbitrary editing much, much easier - delete any op at any position by unlinking and free()ing it. but this really a minor detail.
preset content should also be dynamically allocated; this is the biggest restriction in the current structure, and i’d say also the trickiest part of this hypothetical rework.
but in any case, i would certainly continue to maintain regular arrays of pointers to ops, to be used during the event processing loop. possibly these would keep pretty much the same structure (array of op pointers, array of output targets as input indices, array of input value pointers), or possibly something else would be easier / more efficient - this would depend largely on the structure of preset data, and i won’t go into the details now.
the difference is that these regular arrays would be completely rebuilt any time the op list changes, and everything would generally be much smaller and more flexible.
maybe you are wondering why this is a priority. there are at least two specific problems to solve:
-
the OP’s issue - accommodate a variety of different patch shapes - a few big, self-contained ops (like WW, or custom things), a lot of small, generic ops with many I/O nodes, many presets, no presets, etc.
-
maybe less obvious, but even more compelling to me: if the serialized scene data were small enough (and many/most scenes would be, if the serialization were more efficient) then it could be stored in the UCA0512 internal flash. the limit would be (512K - 64K [dsp] - [code size] - [param scaling data]) - call it ~100k.
then, the aleph could run bees without an SDCARD using a single scene and DSP module, which would be really really useful.
this would be a great candidate for a bees-0.7.0 feature. not really that much work but not trivial either. would break scene binary compatibility.