aboutsummaryrefslogtreecommitdiff
path: root/externals/vanilla/stripnote.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-03-21 21:01:26 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-03-21 21:01:26 +0000
commit0f12c96d992570360af4676b90d1cb2f40cf6fa8 (patch)
treede217ab398ef18b7618001d084ed9f445196f2b2 /externals/vanilla/stripnote.c
parent70fa5194a370320732db2d7048316c8e09b07a88 (diff)
refactored x_midi.c into individual objects, and split out inmidi_* functions to e_midi.c in pd-extended.git
svn path=/trunk/; revision=15037
Diffstat (limited to 'externals/vanilla/stripnote.c')
-rw-r--r--externals/vanilla/stripnote.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/externals/vanilla/stripnote.c b/externals/vanilla/stripnote.c
new file mode 100644
index 00000000..d9899e76
--- /dev/null
+++ b/externals/vanilla/stripnote.c
@@ -0,0 +1,49 @@
+/* Copyright (c) 1997-2001 Miller Puckette and others.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* MIDI. */
+
+#include "m_pd.h"
+
+static t_class *stripnote_class;
+
+typedef struct _hang
+{
+ t_clock *h_clock;
+ struct _hang *h_next;
+ t_float h_pitch;
+ struct _makenote *h_owner;
+} t_hang;
+
+typedef struct _stripnote
+{
+ t_object x_obj;
+ t_float x_velo;
+ t_outlet *x_pitchout;
+ t_outlet *x_velout;
+} t_stripnote;
+
+static void *stripnote_new(void )
+{
+ t_stripnote *x = (t_stripnote *)pd_new(stripnote_class);
+ floatinlet_new(&x->x_obj, &x->x_velo);
+ x->x_pitchout = outlet_new(&x->x_obj, &s_float);
+ x->x_velout = outlet_new(&x->x_obj, &s_float);
+ return (x);
+}
+
+static void stripnote_float(t_stripnote *x, t_float f)
+{
+ t_hang *hang;
+ if (!x->x_velo) return;
+ outlet_float(x->x_velout, x->x_velo);
+ outlet_float(x->x_pitchout, f);
+}
+
+void stripnote_setup(void)
+{
+ stripnote_class = class_new(gensym("stripnote"),
+ (t_newmethod)stripnote_new, 0, sizeof(t_stripnote), 0, 0);
+ class_addfloat(stripnote_class, stripnote_float);
+}