%海阔天空的简谱
%1=F 以F为do
fs=44100; %采样频率
%定义0音
zero=pause_(4,fs); %四分之一拍的零音
zeroh=pause_(8,fs); %八分之一拍的零音
zerohh=pause_(16,fs); %十六分之一拍的零音
%定义1阶音的多拍
f4_54=key(65,16/5,fs); %do的1.25拍
f4_2=key(65,2,fs); %do的两拍
f4_94=key(65,16/9,fs); %do的2.25拍
f4_52=key(65,8/5,fs); %do的2.5拍
f4_43=key(65,4/3,fs); %do的三拍
g4_34=key(67,16/3,fs); %re的0.75拍
g4_54=key(67,16/5,fs); %re的1.25拍
a4_32=key(69,8/3,fs); %mi的1.5拍
a4_72=key(69,8/7,fs); %mi的3.5拍
a4_92=key(69,8/9,fs); %mi的4.5拍
c5_34=key(65,16/3,fs); %sol的0.75拍
c5_32=key(65,8/3,fs); %sol的1.5拍
c5_2=key(72,2,fs); %sol的两拍
d5_34=key(74,16/3,fs); %la的0.75拍
d5_32=key(74,8/3,fs); %la的1.5拍
d5_2=key(74,2,fs); %la的两拍
d5_94=key(74,16/9,fs); %la的2.25拍
e5_2=key(76,2,fs); %xi的两拍
%定义2阶音的多拍
f5_34=key(77,16/3,fs); %do的0.75拍
f5_2=key(77,2,fs); %do的两拍
f5_94=key(77,16/9,fs); %do的2.25拍
f5_52=key(77,8/5,fs); %do的2.5拍
f5_43=key(77,4/3,fs); %do的三拍
f5_174=key(77,16/17,fs); %do的4.25拍
g5_32=key(79,8/3,fs); %re的1.5拍
g5_34=key(79,16/3,fs); %re的0.75拍
g5_74=key(79,16/7,fs); %re的1.75拍
g5_2=key(79,2,fs); %re的两拍
a5_34=key(81,16/3,fs); %mi的0.75拍
a5_2=key(81,2,fs); %mi的2拍
a5_94=key(81,16/9,fs); %mi的2.25拍
a5_92=key(81,8/9,fs); %mi的4.5拍
%定义低阶音的十六分之一拍
a3_16=key(57,16,fs); %3mi
d4_16=key(62,16,fs); %6la
%定义1阶音的四分之一拍
f4_4=key(65,4,fs); %o
g4_4=key(67,4,fs); %2re
a4_4=key(69,4,fs); %3mi
c5_4=key(72,4,fs); %5sol
d5_4=key(74,4,fs); %6la
e5_4=key(76,4,fs); %7xi
%定义1阶音的八分之一拍
f4_8=key(65,8,fs); %o
g4_8=key(67,8,fs); %2re
a4_8=key(69,8,fs); %3mi
b4_8=key(70,8,fs); %Oa
c5_8=key(72,8,fs); %5sol
d5_8=key(74,8,fs); %6la
e5_8=key(76,8,fs); %7xi
%定义1阶音的十六分之一拍
f4_16=key(65,16,fs); %o
g4_16=key(67,16,fs); %2re
a4_16=key(69,16,fs); %3mi
b4_16=key(70,16,fs); %Oa
c5_16=key(72,16,fs); %5sol
d5_16=key(74,16,fs); %6la
e5_16=key(76,16,fs); %7xi
%定义2阶音的四分之一拍
f5_4=key(77,4,fs); %o
g5_4=key(79,4,fs); %2re
a5_4=key(81,4,fs); %3mi
%定义2阶音的八分之一拍
f5_8=key(77,8,fs); %o
g5_8=key(79,8,fs); %2re
a5_8=key(81,8,fs); %3mi
%定义2阶音的十六分之一拍
f5_16=key(77,16,fs); %o
g5_16=key(79,16,fs); %2re
a5_16=key(81,16,fs); %3mi
%第一行简谱
part1=[f4_4 d5_4 c5_2];
part2=[g5_8 f5_8 e5_8 d5_4 b4_8 c5_8 f5_52];
part3=[zeroh b4_8 c5_8 f5_52];
part4=[zeroh b4_8 c5_8 g5_8];
part5=[f5_43 f5_4];
line1=[part1 part2 part3 part4 part5];
%第二行简谱
part6=[e5_2 g5_4 a4_8 g4_8];
part7=[f4_43 zeroh g4_16 a4_16];
part8=[c5_8 c5_16 c5_34 d5_8 c5_32 d5_16 e5_16];
part9=[f5_8 f5_16 f5_34 f5_8 f5_8 e5_8 d5_16 c5_8 d5_94];
line2=[part6 part7 part8 part9];
%第三行简谱
part10=[zero d5_8 c5_8];
part11=[c5_32 c5_8 g4_4 a4_8 b4_8];
part12=[a4_8 g4_8 g4_8 a4_16 g4_34 a4_8 g4_16 g4_34];
part13=[f4_8 f4_8 f4_16 f4_54 g4_8 f4_94];
line3=[part10 part11 part12 part13];
%第四行简谱
part14=[zero a4_8 g4_8];
part15=[f4_43 zeroh g4_16 a4_16];
part16=[c5_8 c5_16 c5_34 d5_8 c5_32 d5_16 e5_16];
part17=[f5_8 f5_16 f5_34 f5_8 f5_8 e5_8 d5_16 c5_8 d5_94];
line4=[part14 part15 part16 part17];
%第五行简谱
part18=[zero d5_8 c5_8];
part19=[c5_32 c5_8 a4_8 a4_8 b4_8];
part20=[a4_8 g4_8 g4_8 a4_16 g4_54 a4_8 g4_8];
part21=[g4_8 f4_8 f4_8 f4_16 f4_54 g4_8 f4_8];
line5=[part18 part19 part20 part21];
%第六行简谱
part22=[f4_43 zeroh d5_16 e5_16];
part23=[f5_8 f5_16 f5_34 f5_8 e5_8 d5_8 c5_16 c5_34];
part24=[c5_4 g4_4 f4_4 zero];
part25=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 g5_8 f5_16 g5_8 a5_94];
line6=[part22 part23 part24 part25];
%第七行简谱
part26=[a5_4 f5_4];
part27=[zeroh f5_16 f5_16 f5_8 g5_74 c5_16 c5_16];
part28=[a5_4 g5_4 f5_2];
part29=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 g5_16 g5_16 f5_16 e5_8 f5_174];
line7=[part26 part27 part28 part29];
%第八行简谱
part32=[zero zero zero a4_8 g4_8];
part33=[f4_43 zeroh g4_16 a4_16];
line8=[part32 part33];
%第九行简谱
part34=[c5_8 c5_16 c5_34 d5_8 c5_32 d5_16 e5_16];
part35=[f5_8 f5_16 f5_34 f5_8 e5_8 d5_16 c5_8 d5_94];
part36=[zero d5_8 c5_8];
part37=[c5_32 c5_8 g4_4 a4_8 b4_8];
line9=[part34 part35 part36 part37];
%第十行简谱
part38=[a4_8 g4_8 g4_8 a4_16 g4_54 a4_8 g4_16 g4_34 ];
part39=[f4_8 f4_8 f4_16 f4_54 a4_8 g4_8];
part40=[f4_43 zeroh d5_16 e5_16];
part41=[f5_8 f5_16 f5_34 f5_8 e5_8 d5_8 c5_16 c5_34];
line10=[part38 part39 part40 part41];
%第十一行简谱
part42=[c5_4 g4_4 f4_4 zero];
part43=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 f5_8 f5_16 g5_8 a5_94];
part44=[a5_4 f5_4];
part45=[zeroh f5_16 f5_16 f5_16 f5_16 g5_2 c5_16 c5_16];
line11=[part42 part43 part44 part45];
%第十二行简谱
part46=[a5_4 g5_4 f5_2];
part47=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 g5_16 g5_16 f5_16 e5_8 f5_94];
part48=[a5_4 f5_4];
part49=[zero zero zero zero];
line12=[part46 part47 part48 part49];
%第十三行简谱
part50=[a4_32 g4_16 a4_16 c5_34 d5_34 a4_92];
part51=[a4_32 g4_16 a4_16 c5_34 d5_34 a5_92];
part52=[a4_32 g4_16 a4_16 c5_34 d5_34 a4_72];
line13=[part50 part51 part52];
%第十四行简谱
part53=[zerohh a4_16 d5_16 a5_16];
part54=[a5_34 g5_34 d5_2 d5_8];
part55=[a5_34 g5_34 d5_32 c5_4];
part56=[d5_2 g5_16 f5_16 d5_16 a4_16 a4_4];
line14=[part53 part54 part55 part56];
%第十五行简谱
part57=[g4_16 f4_16 d4_16 a3_16 a4_16 g4_16 f4_16 g4_16];
part58=[zero d5_8 d5_8 e5_8 d5_8 e5_8 f5_2];
part59=[f5_16 f5_16 g5_8 f5_8 g5_8 a5_2];
part60=[a5_8 g5_32 f5_8];
line15=[part57 part58 part59 part60];
%第十六行简谱
part61=[f5_43 zeroh d5_16 e5_16];
part62=[f5_8 f5_16 f5_34 f5_8 e5_8 d5_8 c5_16 c5_34];
part63=[c5_4 a4_4 f4_2];
part64=[f5_16 f5_16 f5_8 f5_16 g5_34 g5_8 f5_16 g5_8 a5_94];
line16=[part61 part62 part63 part64];
%第十七行简谱
part65=[a5_8 a5_8 f5_4];
part66=[zeroh f5_16 f5_16 f5_8 f5_16 g5_74 c5_16 c5_16];
part67=[a5_4 g5_4 f5_2];
part68=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 g5_16 g5_16 f5_16 e5_8 f5_174];
line17=[part65 part66 part67 part68];
%第十八行简谱
part69=[zeroh f5_16 f5_16 f5_8 f5_16 g5_74 c5_16 c5_16];
part70=[a5_4 g5_4 f5_2];
part71=[zeroh f5_16 f5_16 f5_8 f5_16 g5_34 g5_16 g5_16 f5_16 e5_8 f5_174];
line18=[part69 part70 part71];
vector=[line1 line2 line3 line4 line5 line6 line7 line8 line9...
line10 line11 line12 line13 line14 line15 line16 line17...
line18];
sound(vector,fs,16);
wavwrite(vector,44100,32,'海阔天空'); %保存为wav格式,比特位取32位保证数据不被clipped