On Sun, Sep 13, 2009 at 9:01 PM,
mescalinum@gmail.com <mescalinum@gmail.com> wrote:
if I were writing an external that is somewhat an interface to arrays
(read/write), I have some design choices:
1) copy/paste the code of array (g_array.c) (or eventually only copy
[tabread]/[tabwrite])
pros: resulting external is tight & tidy
cons: code duplication, possible breakage in future releases
2) provide appropriate inlets and outlets, and require the user to patch
the external among [tabread]/[tabwrite] objects
pros: modular. is independent from the array implementation.
cons: tricky to use, the user can patch it incorrectly and won't work.
3) is possible to patch the required objects without phisically put them
in the canvas [?]
pros: all pros mentioned in 1) and 2)
cons: [?]
obviously, 1) and 2) are ugly under some point of view; what I am
interested in is 3), hence asking here if possible, and directions on
how to proceed.
I would suggest the following two options. Everything used in the examples is declared in the "m_pd.h" header that you have to include in your external anyway. Basically, I will explain the techniques used by the pd objects that operate on arrays and the delay objects, so this is stuff that will most probably not be broken for numerous future releases, or a very large part of pd should drastically change.
1.