Update of /cvsroot/pure-data/externals/miXed/cyclone/sickle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29556/cyclone/sickle
Modified Files: Line.c Makefile.sources abs.c allsickles.c curve.c lores.c onepole.c rampsmooth.c reson.c slide.c svf.c Added Files: overdrive.c Log Message: cyclone alpha55 (see notes.txt for cyclone and shared)
Index: allsickles.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/allsickles.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** allsickles.c 27 Jan 2005 14:42:48 -0000 1.6 --- allsickles.c 21 Nov 2005 22:16:37 -0000 1.7 *************** *** 52,55 **** --- 52,56 ---- void mstosamps_tilde_setup(void); void onepole_tilde_setup(void); + void overdrive_tilde_setup(void); void peakamp_tilde_setup(void); void peek_tilde_setup(void); *************** *** 132,135 **** --- 133,137 ---- mstosamps_tilde_setup(); onepole_tilde_setup(); + overdrive_tilde_setup(); peakamp_tilde_setup(); peek_tilde_setup();
Index: slide.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/slide.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** slide.c 23 May 2003 12:29:51 -0000 1.1.1.1 --- slide.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 4,7 **** --- 4,8 ----
#include "m_pd.h" + #include "shared.h" #include "sickle/sic.h"
*************** *** 49,53 **** *out++ = last; } ! x->x_last = last; return (w + 7); } --- 50,54 ---- *out++ = last; } ! x->x_last = (PD_BIGORSMALL(last) ? 0. : last); return (w + 7); }
Index: rampsmooth.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/rampsmooth.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** rampsmooth.c 23 May 2003 12:29:51 -0000 1.1.1.1 --- rampsmooth.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 4,9 **** --- 4,11 ----
#include "m_pd.h" + #include "shared.h" #include "sickle/sic.h"
+ /* LATER select the mode fitter-optionally */ #define RAMPSMOOTH_GEOMETRIC /* geometric series (same as slide~) CHECKED */ #ifndef RAMPSMOOTH_GEOMETRIC *************** *** 83,88 **** else *out++ = target; } ! x->x_last = last; ! x->x_target = target; x->x_incr = incr; x->x_nleft = nleft; --- 85,90 ---- else *out++ = target; } ! x->x_last = (PD_BIGORSMALL(last) ? 0. : last); ! x->x_target = (PD_BIGORSMALL(target) ? 0. : target); x->x_incr = incr; x->x_nleft = nleft; *************** *** 121,125 **** *out++ = last = f; } ! x->x_last = last; return (w + 5); } --- 123,127 ---- *out++ = last = f; } ! x->x_last = (PD_BIGORSMALL(last) ? 0. : last); return (w + 5); }
--- NEW FILE: overdrive.c --- /* Copyright (c) 2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#include <math.h> #include "m_pd.h" #include "sickle/sic.h"
/* FIXME this is unnecessary in vc > 6.0 and darwin? */ #if defined(MSW) || defined(MACOSX) #define powf pow #endif
typedef struct _overdrive { t_sic x_sic; float x_drivefactor; } t_overdrive;
static t_class *overdrive_class;
/* CHECKED this is redundant (a design flaw), LATER fitter-optionally use float-to-signal conversion. */ static void overdrive_float(t_overdrive *x, t_float f) { x->x_drivefactor = f; }
static void overdrive_ft1(t_overdrive *x, t_floatarg f) { x->x_drivefactor = f; }
/* CHECKED negative parameter values may cause output to go out of bounds */ static t_int *overdrive_perform(t_int *w) { float df = *(t_float *)(w[1]); int nblock = (int)(w[2]); t_float *in = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); while (nblock--) { float f = *in++; if (f >= 1.) /* CHECKED incompatible (garbage for sig~ 1.) */ *out++ = 1.; /* CHECKED constant for > 1. */ else if (f > 0.) *out++ = 1. - powf(1. - f, df); /* CHECKED */ else if (f > -1.) /* CHECKED incompatible (garbage for sig~ -1.) */ *out++ = powf(1. + f, df) - 1.; /* CHECKED */ else *out++ = -1.; /* CHECKED constant for < -1. */ } return (w + 5); }
static void overdrive_dsp(t_overdrive *x, t_signal **sp) { dsp_add(overdrive_perform, 4, &x->x_drivefactor, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); }
static void *overdrive_new(t_floatarg f) { t_overdrive *x = (t_overdrive *)pd_new(overdrive_class); x->x_drivefactor = f; inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1")); outlet_new((t_object *)x, &s_signal); return (x); }
void overdrive_tilde_setup(void) { overdrive_class = class_new(gensym("overdrive~"), (t_newmethod)overdrive_new, 0, sizeof(t_overdrive), 0, A_DEFFLOAT, 0); /* CHECKED no float-to-signal conversion */ sic_setup(overdrive_class, overdrive_dsp, overdrive_float); class_addmethod(overdrive_class, (t_method)overdrive_ft1, gensym("ft1"), A_FLOAT, 0); }
Index: onepole.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/onepole.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** onepole.c 14 Aug 2003 14:32:00 -0000 1.1 --- onepole.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 99,103 **** while (nblock--) *out++ = ynm1 = b0 * (*xin++ - ynm1) + ynm1; ! x->x_ynm1 = (PD_BADFLOAT(ynm1) ? 0. : ynm1); return (w + 6); } --- 99,103 ---- while (nblock--) *out++ = ynm1 = b0 * (*xin++ - ynm1) + ynm1; ! x->x_ynm1 = (PD_BIGORSMALL(ynm1) ? 0. : ynm1); return (w + 6); }
Index: svf.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/svf.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** svf.c 11 Jan 2005 10:33:20 -0000 1.3 --- svf.c 21 Nov 2005 22:16:37 -0000 1.4 *************** *** 114,119 **** } /* LATER rethink */ ! x->x_band = (PD_BADFLOAT(band) ? 0. : band); ! x->x_low = (PD_BADFLOAT(low) ? 0. : low); return (w + 10); } --- 114,119 ---- } /* LATER rethink */ ! x->x_band = (PD_BIGORSMALL(band) ? 0. : band); ! x->x_low = (PD_BIGORSMALL(low) ? 0. : low); return (w + 10); }
Index: reson.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/reson.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reson.c 14 Aug 2003 14:32:00 -0000 1.1 --- reson.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 83,88 **** x->x_xnm2 = xnm2; /* LATER rethink */ ! x->x_ynm1 = (PD_BADFLOAT(ynm1) ? 0. : ynm1); ! x->x_ynm2 = (PD_BADFLOAT(ynm2) ? 0. : ynm2); return (w + 8); } --- 83,88 ---- x->x_xnm2 = xnm2; /* LATER rethink */ ! x->x_ynm1 = (PD_BIGORSMALL(ynm1) ? 0. : ynm1); ! x->x_ynm2 = (PD_BIGORSMALL(ynm2) ? 0. : ynm2); return (w + 8); }
Index: Makefile.sources =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/Makefile.sources,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.sources 27 Jan 2005 14:42:48 -0000 1.6 --- Makefile.sources 21 Nov 2005 22:16:37 -0000 1.7 *************** *** 51,54 **** --- 51,55 ---- mstosamps.c \ onepole.c \ + overdrive.c \ peakamp.c \ peek.c \
Index: lores.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/lores.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lores.c 14 Aug 2003 14:32:00 -0000 1.1 --- lores.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 75,80 **** } /* LATER rethink */ ! x->x_ynm1 = (PD_BADFLOAT(ynm1) ? 0. : ynm1); ! x->x_ynm2 = (PD_BADFLOAT(ynm2) ? 0. : ynm2); return (w + 7); } --- 75,80 ---- } /* LATER rethink */ ! x->x_ynm1 = (PD_BIGORSMALL(ynm1) ? 0. : ynm1); ! x->x_ynm2 = (PD_BIGORSMALL(ynm2) ? 0. : ynm2); return (w + 7); }
Index: Line.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/Line.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Line.c 11 Jan 2005 10:33:20 -0000 1.4 --- Line.c 21 Nov 2005 22:16:37 -0000 1.5 *************** *** 71,75 **** float inc = x->x_inc; float biginc = x->x_biginc; ! if (PD_BADFLOAT(curval)) /* LATER rethink */ curval = x->x_value = 0; retarget: --- 71,75 ---- float inc = x->x_inc; float biginc = x->x_biginc; ! if (PD_BIGORSMALL(curval)) /* LATER rethink */ curval = x->x_value = 0; retarget:
Index: curve.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/curve.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** curve.c 11 Jan 2005 10:33:20 -0000 1.4 --- curve.c 21 Nov 2005 22:16:37 -0000 1.5 *************** *** 101,105 **** float dy = x->x_dy; float y0 = x->x_y0; ! if (PD_BADFLOAT(curval)) /* LATER rethink */ curval = x->x_value = 0; retarget: --- 101,105 ---- float dy = x->x_dy; float y0 = x->x_y0; ! if (PD_BIGORSMALL(curval)) /* LATER rethink */ curval = x->x_value = 0; retarget:
Index: abs.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/cyclone/sickle/abs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** abs.c 23 May 2003 12:29:50 -0000 1.1.1.1 --- abs.c 21 Nov 2005 22:16:37 -0000 1.2 *************** *** 1,9 **** ! /* Copyright (c) 2002-2003 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#include "m_pd.h" #include "sickle/sic.h"
typedef t_sic t_abs; static t_class *abs_class; --- 1,22 ---- ! /* Copyright (c) 2002-2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+ #include <math.h> #include "m_pd.h" #include "sickle/sic.h"
+ /* some random tests (average percentage in load meter and top): + gcc 3.3.5 -O6, p4 2.66GHz, 4500 copies: perform 56, perf8 57, perf0 94 + gcc 3.3.5 -O6, p4 2.66GHz, 9000 copies: perform 118, perf8 123, perf0 194 + vc 6.0 /O2, p3 800Mhz, 750 copies: perform 61, perf8 56, perf0 82 */ + #ifdef KRZYSZCZ + //#define ABS_TEST + #endif + + #ifdef ABS_TEST + #include "common/fitter.h" + #endif + typedef t_sic t_abs; static t_class *abs_class; *************** *** 15,18 **** --- 28,42 ---- t_float *out = (t_float *)(w[3]); while (nblock--) + *out++ = fabsf(*in++); + return (w + 4); + } + + #ifdef ABS_TEST + static t_int *abs_perf0(t_int *w) + { + int nblock = (int)(w[1]); + t_float *in = (t_float *)(w[2]); + t_float *out = (t_float *)(w[3]); + while (nblock--) { float f = *in++; *************** *** 22,28 **** }
static void abs_dsp(t_abs *x, t_signal **sp) { ! dsp_add(abs_perform, 3, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); }
--- 46,80 ---- }
+ static t_int *abs_perf8(t_int *w) + { + int nblock = (int)(w[1])>>3; + t_float *in = (t_float *)(w[2]); + t_float *out = (t_float *)(w[3]); + while (nblock--) + { + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + *out++ = fabsf(*in++); + } + return (w + 4); + } + #endif + static void abs_dsp(t_abs *x, t_signal **sp) { ! #ifdef ABS_TEST ! t_symbol *tst = fitter_getsymbol(gensym("test")); ! if (tst == gensym("unroll")) ! dsp_add(abs_perf8, 3, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); ! else if (tst == gensym("branch")) ! dsp_add(abs_perf0, 3, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); ! else ! #endif ! dsp_add(abs_perform, 3, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); }
*************** *** 40,42 **** --- 92,97 ---- sizeof(t_abs), 0, 0); sic_setup(abs_class, abs_dsp, SIC_FLOATTOSIGNAL); + #ifdef ABS_TEST + fitter_setup(abs_class, 0); + #endif }