diff options
author | carmen rocco <ix9@users.sourceforge.net> | 2005-05-24 23:38:22 +0000 |
---|---|---|
committer | carmen rocco <ix9@users.sourceforge.net> | 2005-05-24 23:38:22 +0000 |
commit | e0ec2a5235bcc0da03b55ba03edba439cc3470d3 (patch) | |
tree | f4a719c4e7b464d5c5c3207e58a16dc69fa553fd /extensions/gui | |
parent | 6bb83ed5e34dfd01516c3fce1c3f0ab7c8c9f67d (diff) |
.
svn path=/trunk/; revision=3083
Diffstat (limited to 'extensions/gui')
-rwxr-xr-x | extensions/gui/ix/kbd-demo.pd | 36 | ||||
-rwxr-xr-x | extensions/gui/ix/kbd.wid | 15 | ||||
-rwxr-xr-x | extensions/gui/ix/mat-demo.pd | 40 |
3 files changed, 53 insertions, 38 deletions
diff --git a/extensions/gui/ix/kbd-demo.pd b/extensions/gui/ix/kbd-demo.pd index 82765a8d..a9baf395 100755 --- a/extensions/gui/ix/kbd-demo.pd +++ b/extensions/gui/ix/kbd-demo.pd @@ -1,4 +1,4 @@ -#N canvas 360 12 554 299 12; +#N canvas 360 12 574 324 12; #X obj 56 57 widget kbd k1 #octaves 7 -width 444.094 -height 63.4421 ; #X obj 56 134 unpack; @@ -6,8 +6,8 @@ #X floatatom 90 155 5 0 0 0 - - -; #X floatatom 98 135 5 0 0 0 - - -; #X obj 56 29 pack 0 1; -#X floatatom 56 11 5 0 0 0 - - -; -#X obj 98 12 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +#X floatatom 56 13 5 0 0 0 - - -; +#X obj 99 14 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X floatatom 21 32 5 0 0 0 - - -; #X obj 56 217 osc~ 440; @@ -17,17 +17,24 @@ #X obj 80 265 dac~ 1 2; #X obj 81 242 *~; #X obj 92 173 * 0.4; -#X floatatom 115 14 5 0 1 0 - - -; #X floatatom 149 21 5 0 12 0 - - -; #X msg 148 38 #octaves \$1; -#X obj 165 140 widget kbd k2 #octaves 3 #bg purple #fg pink -height +#X obj 143 134 widget kbd k2 #octaves 3 #bg hotpink #fg orange -height 32; #X obj 56 174 + 36; +#X obj 345 134 widget kbd k2 #octaves 3 #bg blue #fg cyan -height 32 +; +#X obj 207 232 * 127; +#X obj 171 230 + 36; +#X obj 171 265 noteout; +#X obj 170 203 unpack 0 0 0; +#X obj 160 172 Append 1; +#X obj 232 173 Append 2; #X connect 0 0 1 0; #X connect 0 0 4 0; #X connect 1 0 2 0; #X connect 1 1 3 0; -#X connect 2 0 20 0; +#X connect 2 0 19 0; #X connect 3 0 15 0; #X connect 5 0 0 0; #X connect 6 0 5 0; @@ -40,8 +47,15 @@ #X connect 14 0 13 0; #X connect 14 0 13 1; #X connect 15 0 12 0; -#X connect 16 0 5 1; -#X connect 17 0 18 0; -#X connect 18 0 0 0; -#X connect 19 0 1 0; -#X connect 20 0 10 0; +#X connect 16 0 17 0; +#X connect 17 0 0 0; +#X connect 18 0 25 0; +#X connect 19 0 10 0; +#X connect 20 0 26 0; +#X connect 21 0 23 1; +#X connect 22 0 23 0; +#X connect 24 0 22 0; +#X connect 24 1 21 0; +#X connect 24 2 23 2; +#X connect 25 0 24 0; +#X connect 26 0 24 0; diff --git a/extensions/gui/ix/kbd.wid b/extensions/gui/ix/kbd.wid index bf624964..177f503b 100755 --- a/extensions/gui/ix/kbd.wid +++ b/extensions/gui/ix/kbd.wid @@ -1,4 +1,12 @@ namespace eval ::ix {
+ proc kbd_list {p t args} {
+ variable _
+ set w $p.f[expr [lindex $args 0] / 12].[lindex $args 0]
+ if {[llength $args] == 1} {set v 1;if {$_($t:lp) != -1 && $_($t:lp) ne $w} {kbd_action $_($t:lp) $t 0}} {set v [lindex $args 1]}
+ kbd_action $w $t $v
+ set _($t:lp) $w
+ }
+
proc kbd_play {t m b x y} {
variable _
foreach a {{rs {0 sunken 1 raised}} {v {0 0 1 {($y - [winfo rooty $w]) / ([winfo height $w] + 0.0)}}}} {array set [lindex $a 0] [lindex $a 1]}
@@ -15,8 +23,8 @@ namespace eval ::ix { proc kbd_off {p t octaves} {
for {set o 0} {$o < $octaves} {incr o} {
for {set on 0} {$on < 12} {incr on} {
- set no [expr $o * 12 + $on]
- if {[$p.f$o.$no cget -relief] eq "sunken"} {kbd_action $p.f$o.$no $t 0}}}}
+ set w $p.f$o.[expr $o * 12 + $on]
+ if {[$w cget -relief] eq "sunken"} {kbd_action $w $t 0}}}}
proc kbd {path t octaves b f} {
if {![winfo exists $path.f0]} {
@@ -36,5 +44,6 @@ namespace eval ::ix { #> kbd frame
#. -height 100 -width 60
#. #octaves 6 #bg black #fg white
-
+#. @list ::ix::kbd_list .- .| .#args
+#. @float ::ix::kbd_list .- .| .#args
::ix::kbd .- .| .#octaves .#bg .#fg
diff --git a/extensions/gui/ix/mat-demo.pd b/extensions/gui/ix/mat-demo.pd index 9ca22010..df994ec9 100755 --- a/extensions/gui/ix/mat-demo.pd +++ b/extensions/gui/ix/mat-demo.pd @@ -19,31 +19,27 @@ #X obj 37 871 * 127; #X obj 16 901 pack f f f; #X obj 18 958 print note; -#X obj 73 927 makenote 99 250; +#X obj 39 925 makenote 99 250; #X obj 92 961 noteout; #X msg 317 2 #Ya 1 \, #Yb 128 \, #qYv 8; #X obj 535 833 rp ss kbd; #X obj 591 833 rp ss kb2; #X obj 109 775 widget kbd k1 #bg blue #fg green -height 32; #X obj 207 823 widget kbd k2 #bg blue #fg green -height 32; -#X obj 97 854 unpack 0 0; -#X obj 98 897 pack 0 0 1; -#X obj 211 894 * 127; -#X obj 175 892 + 36; -#X obj 187 869 unpack 0 0; -#X obj 188 912 pack 0 0 2; #X msg 283 874 redefine; #X msg 414 885 #bg blue \, #fg green; -#X obj 115 818 print a; +#X obj 98 855 unpack 0 0 0; +#X obj 106 819 Append 1; +#X obj 201 864 Append 2; #X connect 0 0 13 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 3 0; #X connect 6 0 4 0; -#X connect 7 0 27 1; +#X connect 7 0 20 1; #X connect 9 0 8 0; -#X connect 10 0 27 0; +#X connect 10 0 20 0; #X connect 12 0 11 0; #X connect 13 0 15 0; #X connect 14 0 0 0; @@ -56,18 +52,14 @@ #X connect 19 0 20 0; #X connect 19 1 20 1; #X connect 21 0 0 0; -#X connect 24 0 26 0; -#X connect 24 0 34 0; +#X connect 24 0 29 0; #X connect 25 0 30 0; -#X connect 26 0 10 0; -#X connect 26 1 7 0; -#X connect 27 0 20 0; -#X connect 28 0 31 1; -#X connect 29 0 31 0; -#X connect 30 0 29 0; -#X connect 30 1 28 0; -#X connect 31 0 20 0; -#X connect 32 0 24 0; -#X connect 32 0 25 0; -#X connect 33 0 25 0; -#X connect 33 0 24 0; +#X connect 26 0 24 0; +#X connect 26 0 25 0; +#X connect 27 0 25 0; +#X connect 27 0 24 0; +#X connect 28 0 10 0; +#X connect 28 1 7 0; +#X connect 28 2 20 2; +#X connect 29 0 28 0; +#X connect 30 0 28 0; |