[PD-dev] pd-core lib + SIMD

Mathieu Bouchard matju at artengine.ca
Sat Jan 21 08:37:43 CET 2006


On Fri, 20 Jan 2006, Hans-Christoph Steiner wrote:

> Perhaps a better route would be to make the pd-core lib.  But then make
> new libs with those objects and use SIMD in them.  For example a "math"
> lib would make a lot of sense, I don't know if there should be "math~"
> as well, or whether everything should just be in "math", but that's the
> general idea.

IMHO, [+] and [+~] should be merged in one class. Short of doing that, 
they should share as much code as possible. Likewise for other 
float-vs-signal object pairs.

IMHO, the whole code for those classes and more, would be like:

MAKE_ARITH_CLASS("+", x+y)
MAKE_ARITH_CLASS("-", x-y)
MAKE_ARITH_CLASS("*", x*y)
MAKE_ARITH_CLASS("/", x/y)

and that would make both float-classes and signal-classes, supposing that
the appropriate macro is defined.

But supposing we use devel's SIMD functions, it would be more like:

MAKE_ARITH_CLASS("+", plus)
MAKE_ARITH_CLASS("-", minus)
MAKE_ARITH_CLASS("*", times)
MAKE_ARITH_CLASS("/", over)

to match the names of the functions.

In practice, two macro invocations have to be used per class, because of 
limitations of C: one for defining the class's specific functions, and one 
for registering with Pd inside the _setup.

> "timing" is another idea.  "core" could be objects like [trigger],
> [select], [route], [symbol], [float], [print], etc.  "gui" could be
> another lib.

You know, jMax was modularized like that. Maybe you could look at how its 
libraries were organised =)

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada




More information about the Pd-dev mailing list