aboutsummaryrefslogtreecommitdiff
path: root/control/rtout.c
diff options
context:
space:
mode:
Diffstat (limited to 'control/rtout.c')
-rwxr-xr-xcontrol/rtout.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/control/rtout.c b/control/rtout.c
new file mode 100755
index 0000000..95df28c
--- /dev/null
+++ b/control/rtout.c
@@ -0,0 +1,41 @@
+/* (C) Guenter Geiger <geiger@epy.co.at> */
+
+
+#include <m_pd.h>
+
+/* -------------------------- rtout -------------------------- */
+
+void sys_putmidimess(int portno, int a, int b, int c);
+
+static t_class *rtout_class;
+
+
+
+typedef struct _rtout
+{
+ t_object x_obj;
+ t_float x_rt;
+ t_float x_channel;
+} t_rtout;
+
+static void *rtout_new(t_floatarg channel)
+{
+ t_rtout *x = (t_rtout *)pd_new(rtout_class);
+ if (channel <= 0) channel = 1;
+ x->x_channel = channel;
+ return (x);
+}
+
+static void rtout_float(t_rtout *x, t_float f)
+{
+ int binchan = (int) x->x_channel - 1;
+ sys_putmidimess((binchan>>4),(int) f,0,0);
+}
+
+void rtout_setup(void)
+{
+ rtout_class = class_new(gensym("rtout"), (t_newmethod)rtout_new, 0,
+ sizeof(t_rtout), 0, A_DEFFLOAT, A_DEFFLOAT, 0);
+ class_addfloat(rtout_class, rtout_float);
+}
+