aboutsummaryrefslogtreecommitdiff
path: root/list_change.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'list_change.tcl')
-rw-r--r--list_change.tcl32
1 files changed, 32 insertions, 0 deletions
diff --git a/list_change.tcl b/list_change.tcl
new file mode 100644
index 0000000..34ffe9a
--- /dev/null
+++ b/list_change.tcl
@@ -0,0 +1,32 @@
+source pdlib.tcl
+
+pd::class list_change {
+# inlet float
+ outlet list
+# outlet float
+
+ constructor {
+ if [pd::args] {
+ set n [pd::arg_int 0]
+ for {set i 0} {$i < $n} {incr i} {
+ pd::add_inlet $self float
+ }
+ }
+ set @curlist {}
+ }
+
+ 0_list {
+ set newlist $args
+ if {$newlist != $@curlist} {
+ pd::outlet $self 0 list $newlist
+ }
+ set @curlist $newlist
+
+ pd::outlet $self 1 float [pd::inlet $self 1]
+ }
+
+ 0_bang {
+ pd::post "right value is: [pd::inlet $self 1]"
+ }
+}
+