0001
0002
0003 txtFile='C:\Program Files\Karami4\plugin\SingingSearch\demo.txt';
0004 dbFile='C:\Program Files\Karami4\plugin\SingingSearch\demo.db';
0005
0006 fprintf('Reading "%s" and "%s" ...\n', txtFile, dbFile);
0007 songData=songDbRead(txtFile, dbFile, 1);
0008 songNum=length(songData);
0009 fprintf('Finished reading %d songs\n', songNum);
0010
0011 songName='高山青';
0012 index=-1;
0013 for i=1:songNum
0014 if strcmp(songData(i).songName, songName)
0015 index=i;
0016 break;
0017 end
0018 end
0019
0020 if index>0
0021 n=40;
0022 fprintf('播放 "%s" 的前 %d 個音符...\n', songName, n/2);
0023 playmidi(songData(index).track(1:n));
0024 end