diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-12-21 14:56:16 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-12-21 14:56:16 +0000 |
commit | d590f5e6e1fdaf2f1c5a229a51e345e60b9656ef (patch) | |
tree | 3eb94c5336fbad4a1142fdd447b6fc8adc8766c1 /src/z_sigbin.c | |
parent | b7d51f55367bebf34b83553675d4c37bc7c32e9b (diff) |
moved code for [abs~] into separate file
use sse-code (intrinsics) for [abs~]
svn path=/trunk/externals/zexy/; revision=4274
Diffstat (limited to 'src/z_sigbin.c')
-rw-r--r-- | src/z_sigbin.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/src/z_sigbin.c b/src/z_sigbin.c index 61f67d6..77de462 100644 --- a/src/z_sigbin.c +++ b/src/z_sigbin.c @@ -15,7 +15,7 @@ ******************************************************/ /* - finally :: some of the missing binops for signals :: abs~, sgn~, >~, <~, ==~, &&~, ||~ + finally :: some of the missing binops for signals :: sgn~, >~, <~, ==~, &&~, ||~ 1302:forum::für::umläute:2000 */ @@ -28,51 +28,6 @@ typedef struct _misc } t_misc; -/* ------------------------ sigABS~ ----------------------------- */ - -static t_class *sigABS_class; - -static t_int *sigABS_perform(t_int *w) -{ - t_float *in = (t_float *)(w[1]); - t_float *out = (t_float *)(w[2]); - int n = (int)(w[3]); - - while (n--) *out++ = fabsf(*in++); - - return (w+4); -} - -static void sigABS_dsp(t_misc *x, t_signal **sp) -{ - dsp_add(sigABS_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); -} - -static void sigABS_helper(void) -{ - post("\n%c abs~ \t\t:: absolute value of a signal", HEARTSYMBOL); -} - -static void *sigABS_new(void) -{ - t_misc *x = (t_misc *)pd_new(sigABS_class); - outlet_new(&x->x_obj, gensym("signal")); - - return (x); -} - -static void sigABS_setup(void) -{ - sigABS_class = class_new(gensym("abs~"), (t_newmethod)sigABS_new, 0, - sizeof(t_misc), 0, A_DEFFLOAT, 0); - class_addmethod(sigABS_class, nullfn, gensym("signal"), 0); - class_addmethod(sigABS_class, (t_method)sigABS_dsp, gensym("dsp"), 0); - - class_addmethod(sigABS_class, (t_method)sigABS_helper, gensym("help"), 0); - - class_sethelpsymbol(sigABS_class, gensym("zexy/sigbinops+")); -} - /* ------------------------ sgn~ ----------------------------- */ static t_class *sigSGN_class; @@ -800,7 +755,6 @@ static void sigOR_setup(void) void z_sigbin_setup(void) { - sigABS_setup(); sigSGN_setup(); sigGRT_setup(); sigLESS_setup(); |