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 --- stochastic.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 stochastic.c (limited to 'stochastic.c') diff --git a/stochastic.c b/stochastic.c new file mode 100755 index 0000000..47b0c8a --- /dev/null +++ b/stochastic.c @@ -0,0 +1,29 @@ +//TODO Replace with classes fot stochastic + +#include "m_pd.h" +#include +#include +#include + +typedef struct _logistic { + t_object x_obj; + t_float x; + t_float a; + t_outlet *note_out; +} t_logistic; + +void logistic_bang(t_logistic *x) +{ +outlet_float(x->note_out, x->x); +x->x = x->a*x->x*(1-x->x); +} + +void *logistic_new(t_floatarg f) +{ + t_logistic *x = (t_logistic *)pd_new(logistic_class); + x->a = f; + x->x = 0.5; + x->note_out = outlet_new(&x->x_obj,&s_float); + floatinlet_new(&x->x_obj, &x->a); + return (void *)x; +} \ No newline at end of file -- cgit v1.2.1