commit c9f10cd45a43ecfa1d979a3d46b559e95fd245f2
parent 9fdb49e0edcba3e1c8eb015f727ebe42ed69a296
Author: neauoire <aliceffekt@gmail.com>
Date: Tue, 29 Jun 2021 20:54:11 -0700
Implemented console i/o to drum-rack
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/projects/examples/demos/drum-rack.tal b/projects/examples/demos/drum-rack.tal
@@ -1,8 +1,4 @@
-( drum rack
-
- TODO
- - When selecting a pad, should highlight note in octave
-)
+( drum rack )
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
@@ -24,6 +20,7 @@
( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
+|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|40 @Audio1 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
@@ -67,6 +64,7 @@
;on-control .Controller/vector DEO2
;on-mouse .Mouse/vector DEO2
;on-frame .Screen/vector DEO2
+ ;on-message .Console/vector DEO2
( channel defaults )
#dd .Audio0/volume DEO
@@ -151,6 +149,12 @@
BRK
+@on-message ( -> )
+
+ .Console/read DEI #10 MOD ;play-pad JSR2
+
+BRK
+
@on-frame ( -> )
( update VU monitors )
@@ -298,8 +302,8 @@ BRK
BRK
-@play-pad ( note pad -- )
-
+@play-pad ( pad -- )
+
( unselect last )
.pads/last LDZ #01 ;draw-pad JSR2
DUP .pads/last STZ