aboutsummaryrefslogtreecommitdiff
path: root/doc/additional/pd-msg/3.pdscript
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-13 08:53:08 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-13 08:53:08 +0000
commit59b6ed633cd63ec112f4367365ac14479a8e4120 (patch)
tree93246a8e380042152689005b2e50a542b03c5bd9 /doc/additional/pd-msg/3.pdscript
parent02a5595973b61d2cf789b9074167ed73b928d157 (diff)
This commit was generated by cvs2svn to compensate for changes in r208,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=209
Diffstat (limited to 'doc/additional/pd-msg/3.pdscript')
-rwxr-xr-xdoc/additional/pd-msg/3.pdscript/README16
-rwxr-xr-xdoc/additional/pd-msg/3.pdscript/lisp.pd2
-rwxr-xr-xdoc/additional/pd-msg/3.pdscript/pdsendbin0 -> 5120 bytes
-rwxr-xr-xdoc/additional/pd-msg/3.pdscript/test.sh38
-rwxr-xr-xdoc/additional/pd-msg/3.pdscript/test.txt83
5 files changed, 139 insertions, 0 deletions
diff --git a/doc/additional/pd-msg/3.pdscript/README b/doc/additional/pd-msg/3.pdscript/README
new file mode 100755
index 00000000..dbfc7054
--- /dev/null
+++ b/doc/additional/pd-msg/3.pdscript/README
@@ -0,0 +1,16 @@
+This is a short example how to "script" a pd patch
+with pd commands.
+
+First start pd
+# pd lisp.pd
+
+Then either start the automated shell script
+# ./test.sh
+
+or pipe the pd commands to pdsend directly:
+
+# pdsend 3005 < test.txt
+
+Read through text.txt for further explanations
+
+Guenter
diff --git a/doc/additional/pd-msg/3.pdscript/lisp.pd b/doc/additional/pd-msg/3.pdscript/lisp.pd
new file mode 100755
index 00000000..34dfa190
--- /dev/null
+++ b/doc/additional/pd-msg/3.pdscript/lisp.pd
@@ -0,0 +1,2 @@
+#N canvas 417 30 252 94 10;
+#X obj 39 27 netreceive 3005 0 old;
diff --git a/doc/additional/pd-msg/3.pdscript/pdsend b/doc/additional/pd-msg/3.pdscript/pdsend
new file mode 100755
index 00000000..cf6339e6
--- /dev/null
+++ b/doc/additional/pd-msg/3.pdscript/pdsend
Binary files differ
diff --git a/doc/additional/pd-msg/3.pdscript/test.sh b/doc/additional/pd-msg/3.pdscript/test.sh
new file mode 100755
index 00000000..107d3ec0
--- /dev/null
+++ b/doc/additional/pd-msg/3.pdscript/test.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+PORT=3005
+
+
+function setfreq()
+{
+./pdsend $PORT <<EOF
+freq $1 $2;
+EOF
+}
+
+#
+# Read in the script
+#
+./pdsend $PORT < test.txt
+
+sleep 3
+setfreq 220 5000
+sleep 5
+setfreq 1000 100
+sleep 1
+setfreq 100 50
+sleep 1
+setfreq 3000 1000
+sleep 1
+setfreq 100 1000
+sleep 1
+setfreq 3000 1000
+sleep 1
+setfreq 100 1000
+sleep 1
+setfreq 3000 1000
+sleep 1
+setfreq 100 1000
+# and so on
+
+
diff --git a/doc/additional/pd-msg/3.pdscript/test.txt b/doc/additional/pd-msg/3.pdscript/test.txt
new file mode 100755
index 00000000..652bfed8
--- /dev/null
+++ b/doc/additional/pd-msg/3.pdscript/test.txt
@@ -0,0 +1,83 @@
+
+// create a new canvas with name "new";
+// important to terminate each command to pd with a ";";
+pd filename new ./;
+#N canvas;
+#X pop 1;
+
+// now we create a osc~ i, *~ and a dac~;
+// the first word is the name of the canvas where the objects;
+// are put (with "pd-" prepended .. hence pd-new);
+// then the "obj" keyword;
+// then comes the position x y, propose to increment y for each;
+// object by 30, then the patch can still be read with the gui ;
+// then comes the object name and eventual parameters;
+// object number 0 and 1 and 2;
+
+pd-new obj 10 0 osc~ 220;
+pd-new obj 10 30 *~ 0.1;
+pd-new obj 10 60 dac~;
+
+// we connect them together;
+// we kept track of the objects we have created and can;
+// access them via numbers;
+// pd-new same as above, message connect, then the four parameters;
+// <number-of object> <outlet number> <number of 2nd object> <inlet number>;
+
+pd-new connect 0 0 1 0;
+pd-new connect 1 0 2 0;
+pd-new connect 1 0 2 1;
+
+// we put a comment;
+// object number 3;
+pd-new text 80 0 This is a comment;
+
+// a Message object;
+// object number 4;
+
+pd-new msg 10 90 440;
+
+// connect it to the osc~;
+
+pd-new connect 4 0 0 0;
+
+// and a number object;
+// nr 5;
+
+pd-new floatatom 10 120;
+
+// connect it;
+
+pd-new connect 5 0 0 0;
+
+// put a communication channel for the frequency (a "receive");
+// nr 6;
+
+pd-new obj 10 150 r freq;
+// a line;
+// nr 7;
+pd-new obj 10 180 line;
+
+// connect receive to the line;
+
+pd-new connect 6 0 7 0;
+
+// line to the osc~;
+
+pd-new connect 7 0 0 0;
+
+// turn on audio;
+
+pd dsp 1;
+
+// and ... control it the first word is the name of the receive above;
+
+freq 500 4000;
+
+// that's it, there will be several things to figure out, but by writing;
+// this patch down in ascii I get the feeling that coding pd in lisp;
+// will be a killer ... defininitely.;
+// we will be able to automate lots of things I had to do by hand here;
+
+
+