怎样用Perl生成MIDI文件

From Yefu's notes
Jump to: navigation, search

原始链接

这个是我的测试程序:

#!/usr/bin/perl
use MIDI::Simple;
new_score;
$Volume = 127;
patch_change 1, 8; # set Channel 1 to Patch 8 = Celesta
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
n qn, Cs2; n Ds2; n F2; n hn, Cs2;
write_score 'chimes.mid';