aboutsummaryrefslogtreecommitdiff
path: root/src/z_sigbin.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-12-21 17:05:47 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-12-21 17:05:47 +0000
commitf0f2e78feae74ba5ea2faf3516fdc0711cc7fe3d (patch)
tree6532d4db5a757cf3e7ae9f359d1b91da90b4ab2a /src/z_sigbin.c
parentd590f5e6e1fdaf2f1c5a229a51e345e60b9656ef (diff)
moved sgn~ into separate file
initial SSE-support of sgn~ svn path=/trunk/externals/zexy/; revision=4275
Diffstat (limited to 'src/z_sigbin.c')
-rw-r--r--src/z_sigbin.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/src/z_sigbin.c b/src/z_sigbin.c
index 77de462..50610f7 100644
--- a/src/z_sigbin.c
+++ b/src/z_sigbin.c
@@ -15,68 +15,13 @@
******************************************************/
/*
- finally :: some of the missing binops for signals :: sgn~, >~, <~, ==~, &&~, ||~
+ finally :: some of the missing binops for signals :: >~, <~, ==~, &&~, ||~
1302:forum::für::umläute:2000
*/
#include "zexy.h"
-typedef struct _misc
-{
- t_object x_obj;
-} t_misc;
-
-
-/* ------------------------ sgn~ ----------------------------- */
-
-static t_class *sigSGN_class;
-
-static t_int *sigSGN_perform(t_int *w)
-{
- t_float *in = (t_float *)(w[1]);
- t_float *out = (t_float *)(w[2]);
- int n = (int)(w[3]);
- t_float x;
-
- while (n--) {
- if ((x=*in++)>0.) *out++=1.;
- else if (x<0.) *out++=-1.;
- else *out++=0.;
- }
-
- return (w+4);
-}
-
-static void sigSGN_dsp(t_misc *x, t_signal **sp)
-{
- dsp_add(sigSGN_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
-}
-
-static void sigSGN_helper(void)
-{
- post("\n%c sgn~ \t\t:: sign of a signal", HEARTSYMBOL);
-}
-
-static void *sigSGN_new()
-{
- t_misc *x = (t_misc *)pd_new(sigSGN_class);
- outlet_new(&x->x_obj, gensym("signal"));
-
- return (x);
-}
-
-static void sigSGN_setup(void)
-{
- sigSGN_class = class_new(gensym("sgn~"), (t_newmethod)sigSGN_new, 0,
- sizeof(t_misc), 0, A_DEFFLOAT, 0);
- class_addmethod(sigSGN_class, nullfn, gensym("signal"), 0);
- class_addmethod(sigSGN_class, (t_method)sigSGN_dsp, gensym("dsp"), 0);
-
- class_addmethod(sigSGN_class, (t_method)sigSGN_helper, gensym("help"), 0);
- class_sethelpsymbol(sigSGN_class, gensym("zexy/sigbinops+"));
-}
-
/* ------------------------ relational~ ----------------------------- */
/* ----------------------------- sigGRT ----------------------------- */
@@ -755,7 +700,6 @@ static void sigOR_setup(void)
void z_sigbin_setup(void)
{
- sigSGN_setup();
sigGRT_setup();
sigLESS_setup();
sigEQUAL_setup();