aboutsummaryrefslogtreecommitdiff
path: root/source/split~.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-09 21:05:37 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-09 21:05:37 +0000
commitf9e3fe480e7e3c448a626d508f1976f4fec2f759 (patch)
tree4c82fc18ec367525537358a0be41d9be8ab55bad /source/split~.c
parent10c09b5f8fafb9bf02fd8ad21e7093fb55e14b45 (diff)
convert file layout to libdir style and setup everything with the new template Makefile+debian stuff
svn path=/trunk/externals/sigpack/; revision=13153
Diffstat (limited to 'source/split~.c')
-rw-r--r--source/split~.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/source/split~.c b/source/split~.c
deleted file mode 100644
index 49b8d82..0000000
--- a/source/split~.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* sIgpAck
- * for
- * pure-data
- * www.weiss-archiv.de */
-
-#include "m_pd.h"
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
-/* ------------------------ split~ ----------------------------- */
-/* signal splitter */
-
-static t_class *split_tilde_class;
-
-typedef struct _split_tilde
-{
- t_object x_obj;
- float x_f;
- t_sample x_thres;
-} t_split_tilde;
-
-static void *split_tilde_new(t_floatarg thres)
-{
- t_split_tilde *x = (t_split_tilde *)pd_new(split_tilde_class);
- x->x_thres = thres;
- outlet_new(&x->x_obj, gensym("signal"));
- outlet_new(&x->x_obj, gensym("signal"));
- floatinlet_new(&x->x_obj, &x->x_thres);
- x->x_f = 0;
- if(thres) x->x_thres = thres;
- else x->x_thres = 0;
- return (x);
-}
-
-static t_int *split_tilde_perform(t_int *w)
-{
- t_split_tilde *x = (t_split_tilde *)(w[1]);
- t_float *in = (t_float *)(w[2]);
- t_float *out1 = (t_float *)(w[3]);
- t_float *out2 = (t_float *)(w[4]);
- int n = (int)(w[5]);
- while (n--)
- {
- float f = *in++;
- if(f < x->x_thres)
- {
- *out1++ = f;
- *out2++ = 0;
- }
- else if(f >= x->x_thres)
- {
- *out1++ = 0;
- *out2++ = f;
- }
- }
- return (w+6);
-}
-
-static void split_tilde_dsp(t_split_tilde *x, t_signal **sp)
-{
- dsp_add(split_tilde_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n);
-}
-
-void split_tilde_setup(void)
-{
- split_tilde_class = class_new(gensym("split~"), (t_newmethod)split_tilde_new, 0,
- sizeof(t_split_tilde), 0, A_DEFFLOAT, 0);
- CLASS_MAINSIGNALIN(split_tilde_class, t_split_tilde, x_f);
- class_addmethod(split_tilde_class, (t_method)split_tilde_dsp, gensym("dsp"), 0);
-}