aboutsummaryrefslogtreecommitdiff
path: root/cyclone/sickle
diff options
context:
space:
mode:
Diffstat (limited to 'cyclone/sickle')
-rw-r--r--cyclone/sickle/Makefile.sources2
-rw-r--r--cyclone/sickle/allsickles.c4
-rw-r--r--cyclone/sickle/maximum.c50
-rw-r--r--cyclone/sickle/minimum.c50
-rw-r--r--cyclone/sickle/pong.c4
5 files changed, 108 insertions, 2 deletions
diff --git a/cyclone/sickle/Makefile.sources b/cyclone/sickle/Makefile.sources
index 0cb46aa..b4a5d75 100644
--- a/cyclone/sickle/Makefile.sources
+++ b/cyclone/sickle/Makefile.sources
@@ -41,6 +41,8 @@ Line.c \
linedrive.c \
log.c \
lookup.c \
+maximum.c \
+minimum.c \
minmax.c \
peakamp.c \
peek.c \
diff --git a/cyclone/sickle/allsickles.c b/cyclone/sickle/allsickles.c
index dd97ad2..f543879 100644
--- a/cyclone/sickle/allsickles.c
+++ b/cyclone/sickle/allsickles.c
@@ -44,6 +44,8 @@ void kink_tilde_setup(void);
void linedrive_setup(void);
void log_tilde_setup(void);
void lookup_tilde_setup(void);
+void maximum_tilde_setup(void);
+void minimum_tilde_setup(void);
void minmax_tilde_setup(void);
void peakamp_tilde_setup(void);
void peek_tilde_setup(void);
@@ -110,6 +112,8 @@ void allsickles_setup(void)
linedrive_setup();
log_tilde_setup();
lookup_tilde_setup();
+ maximum_tilde_setup();
+ minimum_tilde_setup();
minmax_tilde_setup();
peakamp_tilde_setup();
peek_tilde_setup();
diff --git a/cyclone/sickle/maximum.c b/cyclone/sickle/maximum.c
new file mode 100644
index 0000000..8d947ec
--- /dev/null
+++ b/cyclone/sickle/maximum.c
@@ -0,0 +1,50 @@
+/* Copyright (c) 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. */
+
+/* LATER use hasfeeders */
+
+#include "m_pd.h"
+#include "sickle/sic.h"
+
+#define MAXIMUM_DEFRHS 0. /* CHECKED */
+
+typedef t_sic t_maximum;
+static t_class *maximum_class;
+
+static t_int *maximum_perform(t_int *w)
+{
+ int nblock = (int)(w[1]);
+ t_float *in1 = (t_float *)(w[2]);
+ t_float *in2 = (t_float *)(w[3]);
+ t_float *out = (t_float *)(w[4]);
+ while (nblock--)
+ {
+ t_float f1 = *in1++;
+ t_float f2 = *in2++;
+ *out++ = (f1 > f2 ? f1 : f2);
+ }
+ return (w + 5);
+}
+
+static void maximum_dsp(t_maximum *x, t_signal **sp)
+{
+ dsp_add(maximum_perform, 4, sp[0]->s_n,
+ sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
+}
+
+static void *maximum_new(t_symbol *s, int ac, t_atom *av)
+{
+ t_maximum *x = (t_maximum *)pd_new(maximum_class);
+ sic_inlet((t_sic *)x, 1, MAXIMUM_DEFRHS, 0, ac, av);
+ outlet_new((t_object *)x, &s_signal);
+ return (x);
+}
+
+void maximum_tilde_setup(void)
+{
+ maximum_class = class_new(gensym("maximum~"),
+ (t_newmethod)maximum_new, 0,
+ sizeof(t_maximum), 0, A_GIMME, 0);
+ sic_setup(maximum_class, maximum_dsp, SIC_FLOATTOSIGNAL);
+}
diff --git a/cyclone/sickle/minimum.c b/cyclone/sickle/minimum.c
new file mode 100644
index 0000000..cb31f49
--- /dev/null
+++ b/cyclone/sickle/minimum.c
@@ -0,0 +1,50 @@
+/* Copyright (c) 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. */
+
+/* LATER use hasfeeders */
+
+#include "m_pd.h"
+#include "sickle/sic.h"
+
+#define MINIMUM_DEFRHS 0. /* CHECKED */
+
+typedef t_sic t_minimum;
+static t_class *minimum_class;
+
+static t_int *minimum_perform(t_int *w)
+{
+ int nblock = (int)(w[1]);
+ t_float *in1 = (t_float *)(w[2]);
+ t_float *in2 = (t_float *)(w[3]);
+ t_float *out = (t_float *)(w[4]);
+ while (nblock--)
+ {
+ t_float f1 = *in1++;
+ t_float f2 = *in2++;
+ *out++ = (f1 < f2 ? f1 : f2);
+ }
+ return (w + 5);
+}
+
+static void minimum_dsp(t_minimum *x, t_signal **sp)
+{
+ dsp_add(minimum_perform, 4, sp[0]->s_n,
+ sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
+}
+
+static void *minimum_new(t_symbol *s, int ac, t_atom *av)
+{
+ t_minimum *x = (t_minimum *)pd_new(minimum_class);
+ sic_inlet((t_sic *)x, 1, MINIMUM_DEFRHS, 0, ac, av);
+ outlet_new((t_object *)x, &s_signal);
+ return (x);
+}
+
+void minimum_tilde_setup(void)
+{
+ minimum_class = class_new(gensym("minimum~"),
+ (t_newmethod)minimum_new, 0,
+ sizeof(t_minimum), 0, A_GIMME, 0);
+ sic_setup(minimum_class, minimum_dsp, SIC_FLOATTOSIGNAL);
+}
diff --git a/cyclone/sickle/pong.c b/cyclone/sickle/pong.c
index 59a8beb..d52ed44 100644
--- a/cyclone/sickle/pong.c
+++ b/cyclone/sickle/pong.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002-2003 krzYszcz and others.
+/* Copyright (c) 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. */
@@ -243,5 +243,5 @@ void pong_tilde_setup(void)
sizeof(t_pong), 0, A_GIMME, 0);
sic_setup(pong_class, pong_dsp, SIC_FLOATTOSIGNAL);
class_addmethod(pong_class, (t_method)pong_mode,
- gensym("mode"), A_FLOAT, 0);
+ gensym("mode"), A_DEFFLOAT, 0); /* CHECKED default */
}