aboutsummaryrefslogtreecommitdiff
path: root/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
diff options
context:
space:
mode:
Diffstat (limited to 'doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd')
-rwxr-xr-xdoc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd b/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
new file mode 100755
index 00000000..883cc78e
--- /dev/null
+++ b/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
@@ -0,0 +1,33 @@
+#!/usr/bin/wish -f
+
+#Here a small exemple that show how to send msg to pd from TCL.
+#damien HENRY
+#dh20010806
+
+puts "*********************"
+puts "* pd -nogui example *"
+puts "* (c) Damien HENRY *"
+puts "* This is GPL... *"
+puts "*********************"
+puts ""
+puts "WARNING : you need to run pd -open and load recv.pd first"
+
+#definition of the procedure that send msg to pd
+proc pd_send {string2send} {
+ set to_pd [socket localhost 3006]
+ puts $to_pd $string2send
+ .lmsg configure -text $string2send
+ close $to_pd
+}
+
+#create the gui
+wm title . "a simple tcl/tk gui msg-sender to pd"
+button .bsend -text "send to pd" -width 20 -command {pd_send "$pd_rcv $text2send;"}
+button .bq -text "quit" -width 20 -command {exit}
+entry .msg -textvariable text2send -width 30
+entry .pd_rcv -textvariable pd_rcv -width 10
+label .l1 -text "destination"
+label .l2 -text "msg to send"
+label .lmsg
+
+pack .l1 .pd_rcv .l2 .msg .lmsg .bsend .bq \ No newline at end of file