Browse code

Reconnected midi to drumrack

neauoire authored on 03/05/2021 23:26:41
Showing 1 changed files
... ...
@@ -84,10 +84,10 @@
84 84
 	;on-midi .Midi/vector DEO2
85 85
 
86 86
 	( store location/length )
87
-	#88 .Audio0/volume DEO #023c .Audio0/adsr DEO2
88
-	#7a .Audio1/volume DEO #1334 .Audio1/adsr DEO2
89
-	#a7 .Audio2/volume DEO #0414 .Audio2/adsr DEO2
90
-	#88 .Audio3/volume DEO #022c .Audio3/adsr DEO2
87
+	#dd .Audio0/volume DEO #023c .Audio0/adsr DEO2
88
+	#ce .Audio1/volume DEO #1334 .Audio1/adsr DEO2
89
+	#ec .Audio2/volume DEO #0414 .Audio2/adsr DEO2
90
+	#ee .Audio3/volume DEO #022c .Audio3/adsr DEO2
91 91
 
92 92
 	#0400 .Audio0/length DEO2
93 93
 	#0800 .Audio1/length DEO2
... ...
@@ -155,23 +155,17 @@ BRK
155 155
 
156 156
 @on-frame ( -> )
157 157
 	
158
-	.frame/y2 PEK2 .Screen/y DEO2
159
-
160
-	.center/x PEK2 PAD-WIDTH 2* SUB2 .Screen/x DEO2
161
-	.Audio0/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
162
-	#21 .Screen/color DEO
163
-
164
-	.center/x PEK2 PAD-WIDTH 2* SUB2 #0008 ADD2 .Screen/x DEO2
165
-	.Audio1/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
166
-	#21 .Screen/color DEO
167
-
168
-	.center/x PEK2 PAD-WIDTH 2* SUB2 #0010 ADD2 .Screen/x DEO2
169
-	.Audio2/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
170
-	#21 .Screen/color DEO
171
-
172
-	.center/x PEK2 PAD-WIDTH 2* SUB2 #0018 ADD2 .Screen/x DEO2
173
-	.Audio3/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
174
-	#21 .Screen/color DEO
158
+	( update VU monitors )
159
+	#00 #04
160
+	&loop
161
+		OVR STH
162
+		( x ) .mix-view/x1 PEK2 #0074 ADD2
163
+		( y ) .mix-view/y1 PEK2 PAD-HEIGHT DUPr STHr TOS MUL2 ADD2 #0002 ADD2
164
+		( output ) .Audio0/output STHr #10 MUL ADD DEI 
165
+		;draw-monitor JSR2
166
+		( incr ) SWP #01 ADD SWP
167
+		DUP2 LTH ,&loop JNZ
168
+	POP2
175 169
 
176 170
 BRK
177 171
 
... ...
@@ -200,7 +194,7 @@ BRK
200 194
 	.Midi/note DEI #00 NEQ ,&note-on JNZ BRK &note-on
201 195
 
202 196
 	.Midi/channel DEI #90 NEQ ,&no-drum JNZ 
203
-		( .Midi/note DEI DUP #80 ADD SWP #10 MOD ;play-pad JSR2 )
197
+		.Midi/note DEI #10 MOD ;play-pad JSR2 )
204 198
 		BRK
205 199
 	&no-drum
206 200
 
... ...
@@ -380,7 +374,7 @@ RTN
380 374
 	.wav-view/x1 PEK2 #0002 ADD2 .Screen/x DEO2
381 375
 
382 376
 	( waveform )
383
-	#00 #ff
377
+	#00 #e8
384 378
 	&loop
385 379
 		( dotted line )
386 380
 		OVR #01 AND ,&no-dot JNZ 
... ...
@@ -571,6 +565,28 @@ RTN
571 565
 
572 566
 RTN
573 567
 
568
+@draw-monitor ( x* y* stereo -- )
569
+
570
+	STH 
571
+
572
+	.Screen/y DEO2
573
+	.Screen/x DEO2
574
+
575
+	#00 #0f
576
+	&loop
577
+		OVR #10 SWP SUB DUPr STHr #0f AND LTH #01 ADD .Screen/color DEO
578
+		.Screen/x DEI2 #0002 ADD2 .Screen/x DEO2
579
+		OVR #10 SWP SUB DUPr STHr #04 SFT LTH #01 ADD .Screen/color DEO
580
+		.Screen/x DEI2 #0002 SUB2 .Screen/x DEO2
581
+		.Screen/y DEI2 #0002 ADD2 .Screen/y DEO2
582
+		( incr ) SWP #01 ADD SWP
583
+		DUP2 LTH ,&loop JNZ
584
+	POP2
585
+
586
+	POPr
587
+
588
+RTN
589
+
574 590
 @draw-key ( x* y* addr* color -- )
575 591
 		
576 592
 	STH