From 50a389bea35a91ddae1394c5d35a6f1c703f5bdd Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 9 Mar 2004 03:51:28 +0000 Subject: Checked in Olaf's 1.5.2 sources. Here are the changes: v 1.5.2 (17. december 2003): - modified netclient for not to drop received data: use of syspollfn instead of clock to poll for incoming data, circular recv buffer v 1.5 (18. october 2003): - added some usefull features to arraycopy (i.e. copying just parts of an array and copying to specified position in destination array) - new object: nchange - IRIX 6.5 port (for GCC 3.3) - OS X binary (Jaguar 10.2.6) v 1.4 (22. may 2003): - updated sources to compile with Pd0.37-test4 - new object: arraycopy v 1.3 (12. april 2003): - new objects: sync listfifo - all setup routines renamed to maxlib__setup() to avoid name clashes, old names still work via class_addcreator() - some improvements for the help files svn path=/trunk/externals/maxlib/; revision=1394 --- src/beta.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/beta.c') diff --git a/src/beta.c b/src/beta.c index ebc7a14..391dc48 100644 --- a/src/beta.c +++ b/src/beta.c @@ -22,8 +22,8 @@ /* Based on PureData by Miller Puckette and others. */ /* */ /* ---------------------------------------------------------------------------- */ - -#include "m_pd.h" + +#include "m_pd.h" #include #include #include @@ -32,10 +32,10 @@ #ifndef M_PI #define M_PI 3.1415927 #endif - + static char *version = "beta v0.1, generates a beta distributed random variable\n" " written by Olaf Matthes "; - + /* -------------------------- rand_beta ------------------------------ */ static t_class *rand_beta_class; @@ -61,7 +61,7 @@ static void *rand_beta_new(t_floatarg a, t_floatarg b) static void rand_beta_bang(t_rand_beta *x) { - t_float u1, u2, y1, y2, sum, a, b, ainv, binv; + t_float u1, u2, y01, y2, sum, a, b, ainv, binv; a = (x->x_a <= 0 ? 0.0001 : x->x_a); b = (x->x_b <= 0 ? 0.0001 : x->x_b); ainv = 1/a; @@ -78,12 +78,12 @@ static void rand_beta_bang(t_rand_beta *x) u2 = fran(); } while(u2 == 0); - y1 = pow(u1, ainv); + y01 = pow(u1, ainv); y2 = pow(u2, binv); - sum = y1 + y2; + sum = y01 + y2; } while(sum > 1); - outlet_float(x->x_obj.ob_outlet, y1/sum); + outlet_float(x->x_obj.ob_outlet, y01/sum); } #ifndef MAXLIB @@ -104,4 +104,4 @@ void maxlib_beta_setup(void) class_addcreator((t_newmethod)rand_beta_new, gensym("beta"), A_DEFFLOAT, A_DEFFLOAT, 0); class_sethelpsymbol(rand_beta_class, gensym("maxlib/help-beta.pd")); } -#endif \ No newline at end of file +#endif -- cgit v1.2.1