cool!
did you look at this? https://monome.org/docs/aleph/dev/bees/
it will show you all the steps required to add an operator.
also i would look at the teletype CHAOS discussion on this forum, and resultant code. that’s very close to what you’re proposing (but using simpler models than lorenz/rossler.)
i’ve been reading posts regarding fixed point math, and searched the web. i get the idea i think but i really need to practice with simple examples before i can get something useful out of the strange attractors…
this is one of the situations where it’s extremely difficult or impossible to use fixed-point; these structures require accuracy over a big dynamic range (much bigger than audio). you can use floats on avr32 just fine. they are slow, like 10 instructions for a multiply. that is still millions of multiplies per second. just use them as sparingly as possible.
i don’t know how to label the type of the variables.
you mean the state variables? just make them floats (not double.) input and output variables must be io_t which is 16-bit signed.
i’m looking for a function to trigger the op and another to input a value. could you point me to the way inputs are done from one op to another ?
bees operators expose input functions that generally cause output to happen via call to net_activate when the input is set. like here
[https://github.com/monome/aleph/blob/dev/apps/bees/src/ops/op_add.c#L58]
in the case of an iterated map i guess you would have inputs for the parameters that probably don’t trigger output, and a separate “update” input that doesn’t care about its value and just acts as a “bang.”
or maybe you want the trigger input to only activate on values > 0, as in TOG (where the input is poorly named “STATE” - should be BANG or TRIG or something.)
[ https://github.com/monome/aleph/blob/dev/apps/bees/src/ops/op_tog.c#L67 ]
i need to set the range and scale of the input and output values, something relevant and useful for the bees network. how do i do that ?
as in teletype, bees input and output values are signed 16-bit. if you are working with floats you just need to scale them to the range [-32768, 32767], and cast to s16 or io_t.
see the [op_math] header: [ https://github.com/monome/aleph/blob/dev/apps/bees/src/op_math.h ]
then : what happens to the values outside of the range ? it’s wrapping, right ?
would you change the name of the var in str_att.c (e.g. l, m, n instead of x, y z) ?
see the op_math header again. overflow in multiplies will wrap, but there are sadd and ssub for saturating add and subtract.
is there any coding conventions or style i should be aware of ? could you point me to them ?
no, not really. it’s a pretty striaghtfowrad style i think… the main conttoversial thing is that there are a lot of typedef’d structs, that are then passed around:
foo.h:
typedef struct foo { } foo_t;
void do_something_with_foo(foo_t* foo);
this is a style i’ve since been convinced is inferior to passing void* (with or without typedef), and keeping all struct access explicit and confined to a single code module. oh well, too late
what would you do after cloning the aleph repo : create a dev branch locally, then create a branch for the op?
yes