From da1f0065d07250b86b9a761b012987e4825f491f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 28 Nov 2005 16:53:25 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r4068, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/smlib/; revision=4069 --- source/vmin.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 source/vmin.c (limited to 'source/vmin.c') diff --git a/source/vmin.c b/source/vmin.c new file mode 100644 index 0000000..a0b578e --- /dev/null +++ b/source/vmin.c @@ -0,0 +1,52 @@ +#include "defines.h" + +/*--------------- vmin ---------------*/ +/* maximum value in a list of float + and its location (index) +*/ + +static t_class *vmin_class; + +typedef struct _vmin +{ + t_object x_obj; + t_outlet *m_out_maxi; +} t_vmin; + + +static void vmin_perform(t_vmin *x, t_symbol *s, int argc, t_atom *argv) +{ + int i; + int mini; + float min=MAXFLOAT; + for (i = 0; i < argc; i++) + { + float f=atom_getfloat(&argv[i]); + if (fx_obj.ob_outlet, min); + outlet_float(x->m_out_maxi, (float)(mini+1)); +} + +static void *vmin_new( t_float halfDecayTime) +{ + t_vmin *x=(t_vmin *)pd_new(vmin_class); + outlet_new(&x->x_obj, gensym("float")); + x->m_out_maxi=outlet_new(&x->x_obj, gensym("float")); + return (void *)x; +} + +void vmin_setup(void) +{ + vmin_class = class_new(gensym("vmin"), + (t_newmethod)vmin_new, 0, + sizeof(t_vmin), + CLASS_DEFAULT, + 0); + class_addlist(vmin_class, (t_method)vmin_perform); +} + -- cgit v1.2.1