Browse code

Playing works in the daw

neauoire authored on 03/04/2021 02:50:20
Showing 1 changed files
... ...
@@ -25,6 +25,7 @@
25 25
 |0140 ;Keys { key 1 }
26 26
 |0150 ;Mouse { x 2 y 2 state 1 chord 1 }
27 27
 |0160 ;File { pad 8 name 2 length 2 load 2 save 2 }
28
+|0170 ;Audio { ch1adsr 2 ch2adsr 2 ch3adsr 2 ch4adsr 2 ch1pitch 1 ch1vol 1 ch2pitch 1 ch2vol 1 ch3pitch 1 ch3vol 1 ch4pitch 1 ch4vol 1 }
28 29
 |01F0 ;System { pad 8 r 2 g 2 b 2 }
29 30
 
30 31
 ( vectors )
... ...
@@ -42,6 +43,8 @@
42 43
 	~Screen.width #0002 DIV2 #0080 ADD2 =frame.x2
43 44
 	~Screen.height #0002 DIV2 #0038 ADD2 =frame.y2
44 45
 
46
+	#0438 =Audio.ch1adsr
47
+
45 48
 	,draw-timeline JSR2
46 49
 	,draw-controls JSR2
47 50
 
... ...
@@ -86,11 +89,17 @@ BRK
86 89
 BRK
87 90
 
88 91
 @bang ( -- )
89
-	(
90
-	~head.pos #08 DIV =Console.byte 
91
-	,track.ch1 #00 ~head.pos #08 DIV ADD2 PEK2 =Console.byte
92
-	)
93
-
92
+		
93
+	( load )
94
+	,track.ch1 #00 ~head.pos #08 DIV ADD2 PEK2 
95
+	#01 SUB
96
+	DUP #ff NEQ ^$skip JNZ
97
+		POP RTN
98
+	$skip
99
+	#00 SWP ,notes ADD2 PEK2
100
+	#0c #03 MUL SUB =Audio.ch1pitch
101
+	#44 =Audio.ch1vol
102
+	
94 103
 RTN
95 104
 
96 105
 @move-head ( -- )
... ...
@@ -360,8 +369,8 @@ RTN
360 369
 @vol_txt [ Volume 00 ]
361 370
 
362 371
 @notes [ 
363
-	60 61 62 63 64 65 66 
364
-	67 68 69 6a 6b 6c 6d 
372
+	60 62 64 65 67 69 71 
373
+	72 74 76 77 79 81 83
365 374
 ]
366 375
 
367 376
 @knob_icns [