添加一些关于midi播放的项目

This commit is contained in:
terryLP
2025-03-24 14:30:56 +08:00
parent e31eb22077
commit 498b4ef13b
699 changed files with 186162 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
# perl mel2asm.pl < mel.txt > melody.asm
foreach (<STDIN>) {
chop;
s/;.*$//;
@lst = split(/ /);
if(@lst < 2) { next; }
$n = $lst[0] & 255; &putb;
$n = $lst[0] >> 8; &putb;
$p = 1;
while($lst[$p] ne '') {
$n = $lst[$p++];
if($lst[$p] eq '') { $n .= "|en"; }
&putb;
}
}
print "\n;$cnt\n";
exit;
sub putb
{
$cnt++;
if($c == 0) {
print "\n\t.db $n";
} else {
print ", $n";
}
$c = ($c + 1) & 15;
}