aboutsummaryrefslogtreecommitdiff
path: root/spigot~
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-08-16 17:08:55 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-08-16 17:08:55 +0000
commit506b8e7dedb80d79bf015e47d92e8b8dd8284584 (patch)
tree6393e98add0a0ae7f92388665b3b6242977f5b64 /spigot~
parent856eaf396d9a4d371a458a2c373a052bb72c8057 (diff)
added files straight from Yves' sources
svn path=/trunk/externals/unauthorized/; revision=864
Diffstat (limited to 'spigot~')
-rw-r--r--spigot~/CHANGES.LOG2
-rw-r--r--spigot~/INSTALL15
-rw-r--r--spigot~/Makefile97
-rw-r--r--spigot~/README21
-rw-r--r--spigot~/help-spigot~.pd14
-rw-r--r--spigot~/spigot~.c75
6 files changed, 224 insertions, 0 deletions
diff --git a/spigot~/CHANGES.LOG b/spigot~/CHANGES.LOG
new file mode 100644
index 0000000..153fb0a
--- /dev/null
+++ b/spigot~/CHANGES.LOG
@@ -0,0 +1,2 @@
+0.1
+ First implementation
diff --git a/spigot~/INSTALL b/spigot~/INSTALL
new file mode 100644
index 0000000..d8c07c9
--- /dev/null
+++ b/spigot~/INSTALL
@@ -0,0 +1,15 @@
+untar in /my/pd/dir/externs
+
+cd /my/pd/dir/externs/spigot~
+
+make clean
+
+make
+
+make install
+
+open help-spigot~.pd
+
+Thanx for getting here.
+Yves/
+comments and bugs @ ydegoyon@free.fr
diff --git a/spigot~/Makefile b/spigot~/Makefile
new file mode 100644
index 0000000..72ac0eb
--- /dev/null
+++ b/spigot~/Makefile
@@ -0,0 +1,97 @@
+NAME=spigot~
+CSYM=spigot_tilde
+
+current: pd_linux
+
+# ----------------------- NT -----------------------
+
+pd_nt: $(NAME).dll
+
+.SUFFIXES: .dll
+
+PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
+VC="C:\Program Files\Microsoft Visual Studio\Vc98"
+
+PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include
+
+PDNTLDIR = $(VC)\lib
+PDNTLIB = $(PDNTLDIR)\libc.lib \
+ $(PDNTLDIR)\oldnames.lib \
+ $(PDNTLDIR)\kernel32.lib \
+ \ftp\pd\bin\pd.lib
+
+.c.dll:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
+ link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
+
+# ----------------------- IRIX 5.x -----------------------
+
+pd_irix5: $(NAME).pd_irix5
+
+.SUFFIXES: .pd_irix5
+
+SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
+
+SGIINCLUDE = -I../../src
+
+.c.pd_irix5:
+ cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
+ rm $*.o
+
+# ----------------------- IRIX 6.x -----------------------
+
+pd_irix6: $(NAME).pd_irix6
+
+.SUFFIXES: .pd_irix6
+
+SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -Ofast=ip32
+
+.c.pd_irix6:
+ cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
+ rm $*.o
+
+# ----------------------- LINUX i386 -----------------------
+
+pd_linux: $(NAME).pd_linux
+
+.SUFFIXES: .pd_linux
+
+LINUXCFLAGS = -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wshadow -Wstrict-prototypes -Werror \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+LINUXINCLUDE = -I../../src
+
+.c.pd_linux:
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+ rm -f $*.o ../$*.pd_linux
+ ln -s $*/$*.pd_linux ..
+
+# ----------------------- Mac OSX -----------------------
+
+pd_darwin: $(NAME).pd_darwin
+
+.SUFFIXES: .pd_darwin
+
+DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+.c.pd_darwin:
+ cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
+ rm -f $*.o ../$*.pd_darwin
+ ln -s $*/$*.pd_darwin ..
+
+# ----------------------------------------------------------
+
+install:
+ cp help-*.pd ../../doc/5.reference
+
+clean:
+ rm -f *.o *.pd_* so_locations
diff --git a/spigot~/README b/spigot~/README
new file mode 100644
index 0000000..5de8d8d
--- /dev/null
+++ b/spigot~/README
@@ -0,0 +1,21 @@
+*****************************************************************************
+
+Version 0.1
+copyleft 2001 by Yves Degoyon
+tarballs and updates available @ http://ydegoyon.free.fr
+
+spigot~ : a signal router.
+
+To install spigot~, follow the steps from INSTALL
+
+This software is published under GPL terms.
+
+This is software with ABSOLUTELY NO WARRANTY.
+Use it at your OWN RISK. It's possible to damage e.g. hardware or your hearing
+due to a bug or for other reasons.
+We do not warrant that the program is free of infringement of any third-party
+patents.
+
+*****************************************************************************
+
+
diff --git a/spigot~/help-spigot~.pd b/spigot~/help-spigot~.pd
new file mode 100644
index 0000000..eb7f0eb
--- /dev/null
+++ b/spigot~/help-spigot~.pd
@@ -0,0 +1,14 @@
+#N canvas 172 55 627 444 10;
+#X obj 151 163 dac~;
+#X obj 150 127 spigot~;
+#X text 232 50 spigot~ sends its signal to its right or left outlet
+;
+#X text 232 65 according to the state of the toggle;
+#X obj 199 101 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
+1;
+#X obj 108 74 osc~ 233;
+#X text 237 148 bugs and comments @ ydegoyon@free.fr;
+#X connect 1 0 0 0;
+#X connect 1 1 0 1;
+#X connect 4 0 1 1;
+#X connect 5 0 1 0;
diff --git a/spigot~/spigot~.c b/spigot~/spigot~.c
new file mode 100644
index 0000000..934db00
--- /dev/null
+++ b/spigot~/spigot~.c
@@ -0,0 +1,75 @@
+/* spigot~ -- route a signal to its right or left output */
+
+/* Copyleft 2001 Yves Degoyon.
+Permission is granted to use this software for any purpose provided you
+keep this copyright notice intact.
+
+THE AUTHOR AND HIS EXPLOITERS MAKE NO WARRANTY, EXPRESS OR IMPLIED,
+IN CONNECTION WITH THIS SOFTWARE.
+
+*/
+
+#include "m_pd.h"
+
+typedef struct _spigot
+{
+ t_object x_obj;
+ t_int x_on;
+ t_float x_f;
+} t_spigot;
+
+static t_class *spigot_class;
+
+static char *spigot_version = "spigot~: a signal router : version 0.1, written by Yves Degoyon (ydegoyon@free.fr)";
+
+static void *spigot_new(void)
+{
+ t_spigot *x = (t_spigot *)pd_new(spigot_class);
+ x->x_on = 0;
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("seton") );
+ outlet_new(&x->x_obj, &s_signal);
+ outlet_new(&x->x_obj, &s_signal);
+ return (x);
+}
+
+static t_int *spigot_perform(t_int *w)
+{
+ t_float *in = (t_float *)(w[1]);
+ t_float *outr = (t_float *)(w[2]);
+ t_float *outl = (t_float *)(w[3]);
+ int n = (int)(w[4]);
+ t_spigot* x = (t_spigot*)(w[5]);
+ while (n--) {
+ if ( (x->x_on)==0.0 ) {
+ *(outl)=0.0;
+ *(outr)=*(in);
+ } else {
+ *(outl)=*(in);
+ *(outr)=0.0;
+ }
+ in++;outl++;outr++;
+ }
+ return (w+6);
+}
+
+static void spigot_dsp(t_spigot *x, t_signal **sp)
+{
+ dsp_add(spigot_perform, 5, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec,
+ sp[0]->s_n, x);
+}
+
+static void spigot_set(t_spigot *x, t_float f)
+{
+ x->x_on=f;
+}
+
+void spigot_tilde_setup(void)
+{
+ post ( spigot_version );
+ spigot_class = class_new(gensym("spigot~"), (t_newmethod)spigot_new, 0,
+ sizeof(t_spigot), 0, 0);
+ CLASS_MAINSIGNALIN( spigot_class, t_spigot, x_f );
+ class_sethelpsymbol(spigot_class, gensym("help-spigot~.pd"));
+ class_addmethod(spigot_class, (t_method)spigot_dsp, gensym("dsp"), 0);
+ class_addmethod(spigot_class, (t_method)spigot_set, gensym("seton"), A_FLOAT, 0);
+}