From 420ada2dde4af8d71bc1d9c6988311961cf47f1b Mon Sep 17 00:00:00 2001 From: daniel aschauer Date: Fri, 9 Jan 2009 17:23:55 +0000 Subject: svn path=/trunk/externals/algocomp/; revision=10494 --- distribute.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 distribute.c (limited to 'distribute.c') diff --git a/distribute.c b/distribute.c new file mode 100755 index 0000000..d39d16a --- /dev/null +++ b/distribute.c @@ -0,0 +1,35 @@ +#include "m_pd.h" +#include +#include +#include + +static t_class *distribute_class; + +typedef struct _distribute { + t_object x_obj; + t_int counter; + t_int max; + t_outlet *out[128];//,*r_out,*n_out; +} t_distribute; + +void distribute_float(t_distribute *x,t_float in) +{ +outlet_float(x->out[x->counter],in); +x->counter++; +if (x->counter == x->max) +x->counter = 0; +//x->out[x->counter] = in; +} + +void *distribute_new(t_floatarg f1) +{ + int i; + t_distribute *x = (t_distribute *)pd_new(distribute_class); + x->counter = 0; + if ((f1>0) && (f1<128)) + x->max = (t_int) f1; + else x->max = 8; + for (i=0;imax;i++) + x->out[i] = outlet_new(&x->x_obj,&s_float); + return (void *)x; +} -- cgit v1.2.1