add tracker as it exists, readme file, and licence

This commit is contained in:
Nico 2022-02-23 17:12:33 +00:00
parent 0760f0d832
commit 268ab09a58
3 changed files with 30 additions and 4 deletions

9
LICENCE Normal file
View File

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright © 2022 nihilazo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# kalama sin
kalama sin is a simple music playback engine for the varvara virtual machine. It uses a tracker-style module format which is documented in format.md. The engine itself is in engine.tal, which you can include in whatever varvara program you wish to add music. It's not super well documented but should be easy enough to figure out from the code.
tracker.tal was the first version of the tracker for kalama module files. It's very early in development (forever), but here in case anybody wants to pick it up, and for historical reasons.

View File

@ -51,6 +51,9 @@
&songloop $1 ( if song loops or not )
&songpos $2 ( position in song table )
@tracker
&selected-pattern $1
( program )
|0100 ( -> )
@ -75,7 +78,7 @@ BRK
BRK
@draw-song
.Screen/x DEI2 ,&pos STR2
.Screen/x DEI2 ;&pos STA2
#00 ,&count STR
#01 .Screen/auto DEO
.kalama/module LDZ2 #0003 ADD2 DUP2
@ -90,8 +93,16 @@ BRK
,&pos LDR2 .Screen/x DEO2
#01 ,&count STR
&draw
DUP2
LDA #01 ;draw-hex JSR2
DUP2 DUP2 STHrk2 SWP2 SUB2 STH2
LDA
STHr2 #0004 DIV2 .tracker/selected-pattern LDZ #00 SWP EQU2 ,&selected JCN
,&unselected JMP
&selected
#08 ,&draw-hex JMP
&unselected
#01
&draw-hex
;draw-hex JSR2
#0001 ADD2 DUP2
#00 .Screen/sprite DEO
STHrk2 NEQ2 ,&loop JCN ( if not at the end of song, go again )
@ -100,6 +111,7 @@ RTN
&count $1
&pos $2
@draw-pattern ( p )
.Screen/x DEI2 ,&x STR2
;k-get-pattern JSR2
@ -123,7 +135,7 @@ RTN
#01 .Screen/sprite DEO
#0002 ADD2 LDA #01 ;draw-hex JSR2 ( draw effect argument )
RTN
&effect-letters '_ 'V 'I 'A 'D 'S 'R 'T
&effect-letters '- 'V 'I 'A 'D 'S 'R 'T
@draw-note ( n color -- )
#01 .Screen/auto DEO