basic synth example

This commit is contained in:
~d6 2023-08-12 13:10:13 -04:00
parent 004920ff72
commit 575c5e8b40
1 changed files with 33 additions and 0 deletions

33
synth.tal Normal file
View File

@ -0,0 +1,33 @@
|30 @Audio0 [ &vec $2 &pos $2 &out $1 &pad $3 &adsr $2 &len $2 &addr $2 &vol $1 &pitch $1 ]
|0000
@next $2
|0100
#ff .Audio0/vol DEO
;square .Audio0/addr DEO2
#0002 .Audio0/len DEO2
;play .Audio0/vec DEO2
( fall-through )
@play
.next LDZ2 #0002 MUL2 ;asdrs ADD2 LDA2 .Audio0/adsr DEO2
.next LDZ2 ;notes ADD2 LDA .Audio0/pitch DEO
.next LDZ2 INC2 ;size LDA2 DIV2k MUL2 SUB2 .next STZ2
BRK
@size 0018
@asdrs
0400 0200 0200 0400 0200 0200
0400 0200 0200 0400 0200 0200
0400 0200 0200 0400 0200 0200
0400 0200 0200 0400 0200 0200
@notes
18 18 18 24 18 24
18 18 18 24 18 24
1b 1b 1b 27 1b 27
1d 1d 1d 29 1d 29
@square ff 00