Matlab唱歌?尊嘟假嘟?

2023-10-17 23:30
文章标签 matlab 尊嘟 假嘟 唱歌

本文主要是介绍Matlab唱歌?尊嘟假嘟?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

       在大二的时候,看到我们的智能优化老师用Matlab唱歌,当时就觉得很牛X,没想到Matlab还能当一个乐器,今天对这个我创作的过程做一个记录,也是对这方面有兴趣的同学做一个引导学习,废话不多说,我们开整!!!

今天我们要演凑的音乐是——达拉崩吧   

1.乐理小知识

1.1 十二平均律

      十二平均律又称十二等程律,是将一个八度的音程等分为是分成十二个半音的律制,各相邻两律之间的波长之比完全相等,十二平均律是由中国明朝皇族世子发现的。

1.12 计算方法

       一个八音音程,高音频率为基础音的2倍,将这个2连续开12次方,得出1.05946,这就是两个相邻半音之间的概率比。

第一律:440*2^{\frac{1}{12}}

第i律:440*2^{\frac{i}{12}}

G调萧
音名筒音作5筒音作2频率
d1

2_293.7
e163_329.6
f1#64_349.2
#f17_#4_370.0
g115_392.0
a126_440.0
b137_493.9
c241523.3
d252587.3
e263659.3
f2#64698.5
#f27#4740.0
g2高15784.0
a2高26880.0
b2高37987.8
c3高4高11046.5
d3高5高21174.7
e3高6高31318.5
f3高#6高41396.5
#f3高7高#41480.0
g3超高1高51568.0

乐理知识学习这么多,就已经我们用的了,现在开我们Matlab的教学片!!!

2.Matlab教学

2.1 sound函数(将信号数据矩阵转换为声音)

语法:

  • sound(y) 以默认采样率8192Hz向扬声器发送音频信号y
  • sound(y,Fs) 以采样率Fs向扬声器发送音频信号y
  • sound(y,Fs,nBits) 对音频信号y使用nBits的采样位数
%tone是音符,rhythm是频率大小
function y=musiclower(tone,rhythm)
Fs=8192;
%低DO 低RE 低M 低FA 低SO 低LA 低SI
freqs=[262,294,330,349,392,440,494];%七个音符对应的频率
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*(exp(-0.7*x/rhythm));
end

>> y=[];
>> for i=1:7y=[y,musiclower(i,0.3)];
end
>> plot(y);
>> sound(y)%默认是8192

音乐就是因为震动产生的,震动的幅度不同,音色自然而然也就不同

所以自然而然的出现了很多优化方式,具体见:利用包络函数优化MATLAB中sound函数的发声【matlab调音_2】_matlab 编程实现包络和音色_歪卜巴比的博客-CSDN博客

 源代码:

  • musiclower.m
%tone是音符,rhythm是频率大小
function y=musiclower(tone,rhythm)
Fs=8192;
%低DO 低RE 低M 低FA 低SO 低LA 低SI
freqs=[262,294,330,349,392,440,494];%七个音符对应的频率
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*(exp(-0.7*x/rhythm));
end
  • musiclower_mid.m
function y=musiclower_mid(tone,rhythm)
Fs=8192;
%半音 半DO 半RE 半FA 半SO 半LA
freqs=[277,311,370,415,466];
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*((1-x./rhythm.*2*pi));
end
  • musicmid.m
%tone是音符,rhythm是频率大小
%中
function y=musicmid(tone,rhythm)
Fs=8192;
%中DO-1 中SO-5 中LA-6  中SI-7
freqs=[523,784,880,988];
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*(exp(-0.7*x/rhythm));
end
  • musicmid_mid.m
function y=musicmid_mid(tone,rhythm)
Fs=8192;
%中半音 半FA 半SO 半LA
freqs=[740,831,932];
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*(exp(-0.7*x/rhythm));
end
  • music_high.m
function y=music_high(tone,rhythm)
Fs=8192;
%高DO 高RE 高M 高FA
freqs=[1046,1175,1318,1397];%七个音符对应的频率
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*(exp(-0.7*x/rhythm));
end
  • musichigh_mid.m
function y=musichigh_mid(tone,rhythm)
Fs=8192;
%高半音 半DO 半RE 半FA 
freqs=[1109,1245,1480];
x=linspace(0,2*pi*rhythm,floor(Fs*rhythm));
y=sin(freqs(tone)*x).*((1-x./rhythm.*2*pi));
end
  • dalabengba.m
Fs=9000;%采样频率
%0%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第一行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y0=empty(0,0.05);
y8=empty(0,0.01);
%低5 下点
y1=musiclower(2,0.27);
%低6 下点 延长
y2=musiclower(3,0.32);
%低5 下点 延长
y3=musiclower(2,0.32);
%低6 下点
y4=musiclower(3,0.27);
%中2 延长
y5=musicmid(3,0.32);
%中2 
y6=musicmid(3,0.27);
%中3 
y7=musicmid(4,0.27);
y=[y0,y1,y0,y2,y3,y4,y0,y1,y0,y1,y0,y2,y5,y7,y0,y6,y0,y1,y0,y2,y3,y4,y0,y1,y0,y1,y0,y4,y5,y7,y0,y6];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第二行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pause(0.5);%暂定0.5
%低7 
y9=musiclower(4,0.27);
%中 1
y10=musicmid(2,0.27);
%中 1 下划线
y13=musicmid(2,0.27);
%中 2
y11=musicmid(3,0.27);
%中 2 下划线
y14=musicmid(3,0.27);
%中 3 下线
y12=musicmid(4,0.27);
%中 3  连音线
y16=musicmid(4,0.32);
%中 3 双连下划线 
y17=musicmid(4,0.31);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,...y10,y11,y17,y7,y11,y10,y14,y13,y9,y10,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第三行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中 2 双连音线
y18=musicmid(3,0.32);
%中1 延长
y19=musicmid(2,0.32);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,...y10,y11,y7,y0,y18,y19,y9,y6,y7];%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第四行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,y19,y11,y7,...y7,y11,y10,y14,y13,y9,y10,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%第五行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%双低7 连音
y20=musiclower(4,0.32);
%半中2 
y21=musicmid_mid(3,0.27);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,y10,y11,y7,...y0,y18,y19,y20,y21,y7];
%%%%%%%%%%%%%%%%%%%%%%%%第六行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中6  
y22=musicmid(1,0.27);
%中 3
y23=musicmid(4,0.27);
%中 半2
y24=musicmid_mid(3,0.27);
%中 半4
y25=musicmid(1,0.27);
%中 5
y26=musicmid(1,0.27);
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y19,y12,y25,y26,y22,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y10,y12,y25,y25];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第二行 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pause(0.5);%暂定0.5
%低7 
y9=musiclower(4,0.27);
%中 1
y10=musicmid(2,0.27);
%中 1 下划线
y13=musicmid(2,0.27);
%中 2
y11=musicmid(3,0.27);
%中 2 下划线
y14=musicmid(3,0.27);
%中 3 下线
y12=musicmid(4,0.27);
%中 3  连音线
y16=musicmid(4,0.32);
%中 3 双连下划线 
y17=musicmid(4,0.31);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,...y10,y11,y17,y7,y11,y10,y14,y13,y9,y10,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第三行 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中 2 双连音线
y18=musicmid(3,0.32);
%中1 延长
y19=musicmid(2,0.32);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,...y10,y11,y7,y0,y18,y19,y9,y6,y7];%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第四行 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,y19,y11,y7,...y7,y11,y10,y14,y13,y9,y10,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%第五行 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%双低7 连音
y20=musiclower(4,0.32);
%半中2 
y21=musicmid_mid(3,0.27);
y=[y,y0,y16,y2,y9,y10,y11,y7,y0,y16,y2,y9,y10,y11,y10,y0,y16,y2,y9,y10,y11,y7,...y0,y18,y19,y20,y21,y7];
%%%%%%%%%%%%%%%%%%%%%%%%第六行 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中6  
y22=musicmid(1,0.27);
%中 3
y23=musicmid(4,0.27);
%中 半2
y24=musicmid_mid(3,0.27);
%中 半4
y25=musicmid(1,0.27);
%中 5
y26=musicmid(1,0.27);
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y19,y12,y25,y26,y22,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y10,y12,y25,y25];
%%%%%%%%%%%%%%%%%%%%%第七行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%半 中5
y27=empty(620,0.27);
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y19,y4,y26,y27,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y10,y22,y0];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第八行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%长音 8
y28=musicmid(2,1.5);
%长音 7
y29=musicmid(1,1.5);
%长音 0
y30=empty(0,1);
y=[y,y28,y29,y30,y24,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第九行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y10,y26,y27,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y10,y7,y26];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第10行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%高 1
y31=music_high(4,0.27);
%中7
y32=musicmid_mid(1,0.27);
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y19,y4,y26,y27,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y31,y21,y7];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第11行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y3,y19,y23,y25,y1,y27,y22,y23,y24,y23,y24,y23,...y9,y23,y4,y23,y10,y24,y23];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第12行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y22,y23,y24,y23,y24,y23,y10,y23,y9,y23,y4,y23,y26,y4,y26,y27,y22,y23,y24,y23,y24,y23,...y9,y23,y9,y23,y4,y23,y10,y7,y26];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第13行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中 5超级延长 3
y33=musicmid(1,0.6);
y=[y,y22,y22,y31,y22,y22,y26,y22,y26,y22,y23,y22,y33,y22,y22,y22,y31,y22,y22,y26,y22,y26,y26,y23,y22,y26,y26,y31,y22];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第14行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%中 5超级延长 2
y34=musicmid(1,0.5);
y=[y,y22,y22,y31,y22,y22,y26,y22,y26,y22,y22,y22,y22,y22,y22,y34,y31,y22,y22,y26,y22,y26,y26,y23,y22,y26,y22,y31,y26,y22,y0];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%第15行%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y=[y,y0,y1,y0,y2,y26,y0,y6,y4,y0,y0,y0,y0];
plot(y);
filename = 'handel.wav';
audiowrite(filename,y,Fs);
sound(y,Fs)

《All Of me》源代码:

function y = ADSR(x, f)
% 声音包络处理
% 这个函数是给混频后的钢琴单音进行包络处理,让人听起来有打击感
[~,N] = size(x);
if f ~= 0d = round(-36492*log(f) + 325507);r = round(d / 400);m = linspace(0,6.2146,d);ds = 0.5 * exp(-m);adsr = [ds zeros(1,6*44100-d)];    % dsadsr(1:r) = linspace(0,adsr(r),r); % aadsr = adsr(1:N);adsr(end - r + 1:end) = linspace(adsr(end-r),0,r); % ry = x .* adsr;
elsey = x;
end
%All of me
clear;clc;
fs = 44100;    %采样频率
degree = 127 / 60 * 2;    %演奏速度 
global Odd
Odd = 0;       %每节前后补齐作用% all of me ----- John Legend
%  这里是每个音符的基音
%- do re mi fa so la si -% 1 = Ab
ll = [51.913 58.270 65.406 69.296 77.782 87.307 97.999];
lls = [55.000 61.735 0 73.416 82.407 92.499];
l = ll * 2;
ls = lls * 2;
m = l * 2;
ms = ls * 2;
h = m * 2;
hs = ms * 2;
hh = h * 2;
hhs = hs * 2;%定义音轨结构体
rail = struct('y',[],'tone',[],'beat',[],'accumulation',0);%创建歌(机构体),有高低音轨,一首歌有多条音轨
Song.h_rail = rail;
Song.h_rail(2) = rail;
Song.h_rail(3) = rail;
Song.l_rail(1) = rail;
Song.l_rail(2) = rail;
Song.l_rail(3) = rail;%整个乐谱在下面Song.h_rail(1).tone = [0 ...m(6) m(6) m(6) ...m(6) m(6) m(6) ...m(5) m(5) m(5) ...m(5) m(5) m(5) ...jie0 0 hs(1) h(3) h(3) ...h(4) h(3) h(3) h(3) h(1) ...h(1) 0 h(2) h(3) h(3) ...h(3) h(2) h(3) h(3) h(2) h(1) h(1) ...jiem(6) m(6) h(3) h(2) h(3) ...h(4) h(3) h(1) ...h(4) h(3) h(1) h(1) ...h(2) h(3) h(2) ...jiem(6) h(2) h(3) h(3) ...h(3) h(2) h(3) h(3) h(2) h(1) h(1) ...h(3) h(3) h(3) ...
h(5) h(4) h(3) h(3) h(2) h(1) m(6) ...jie?h(3) h(3) ...h(4) h(3) h(1) h(1) ...h(4) h(3) h(1) h(1) ...h(2) h(3) h(2) ...jieh(4) 0 h(2) ...h(6) h(5) h(4) h(3) ...h(2) h(1) m(7) ...m(6) m(5) m(6) m(6) ...jie0 h(6) ...h(6) h(5) h(4) h(3) ...h(3) h(2) h(1) h(2) ...0 h(3) ...jieh(5) h(3) h(6) ...h(3) ...h(2) h(1) h(3) ...h(3) h(3) ...jieh(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...jieh(5) h(3) h(6) ...h(6) h(3) ...h(2) h(1) h(3) ...
h(3) h(3) ...jie?h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) h(4) h(5) hh(1) ...jieh(7) h(6) ...h(3) h(3) ...0 0 h(3) h(3) h(4) h(5) hh(1) ...jieh(7) h(6) ...h(3) h(3) ...
h(3) h(2) ...jie?0 0 hs(1) h(3) h(3) ...h(4) h(3) h(3) h(3) h(1) ...h(1) 0 h(2) h(3) h(3) ...h(3) h(2) h(3) h(3) h(2) h(1) h(1) ...jiem(6) m(6) h(3) h(2) h(3) ...h(4) h(3) h(1) ...h(4) h(3) h(1) h(1) ...h(2) h(3) h(2) ...jiem(6) h(2) h(3) h(3) ...h(3) h(2) h(3) h(3) h(2) h(1) h(1) ...h(3) h(3) h(3) ...
h(5) h(4) h(3) h(3) h(2) h(1) m(6) ...jie?h(3) h(3) ...h(4) h(3) h(1) h(1) ...h(4) h(3) h(1) h(1) ...h(2) h(3) h(2) ...jieh(4) 0 h(2) ...h(6) h(5) h(4) h(3) ...h(2) h(1) m(7) ...m(6) m(5) m(6) m(6) ...jie0 h(6) ...h(6) h(5) h(4) h(3) ...h(3) h(2) h(1) h(2) ...0 h(3) ...jieh(5) h(3) h(6) ...h(3) ...h(2) h(1) h(3) ...h(3) h(3) ...jieh(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...jieh(5) h(3) h(6) ...h(6) h(3) ...h(2) h(1) h(3) ...
h(3) h(3) ...jie?h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) h(4) h(5) hh(1) ...jieh(7) h(6) ...h(3) h(3) ...0 0 h(3) h(3) h(4) h(5) hh(1) ...jieh(7) h(6) ...h(3) h(3) ...
h(3) h(2) ...jie?h(2) h(3) h(5) hh(1) h(7) h(6) ...h(6) ...h(6) h(5) h(4) hh(1) ...h(7) h(6) h(5) ...jieh(4) h(3) h(2) ...h(6) h(5) h(4) hh(1) ...h(7) h(6) h(5) ...jie0 h(3) ...h(5) h(3) h(6) ...h(3) ...
h(2) h(1) h(3) ...jieh(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...jieh(3) h(3) ...h(5) h(3) h(6) ...hh(1) h(7) ...h(6) h(5) h(3) ...jieh(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...h(3) h(3) ...h(2) h(2) h(2) h(1) h(2) ...jieh(3) h(3) h(4) h(5) hh(1) ...h(7) h(6) ...h(3) h(3) ...0 ...jie0 0 h(3) h(3) h(4) h(5) hh(1) ...h(7) h(6) ...h(3) h(3) ...0 ...jie0 0 h(3) h(4) h(5) hh(1) ...hh(2) h(7) hh(1) h(6) ...h(5) h(3) h(3) ...
0 ...jie0 0 h(3) h(4) h(5) hh(1) ...hh(1) hh(2) h(7) hh(1) h(6) ...h(5) h(3) h(3) ...0 ...jie0 0 h(3) h(4) h(5) hh(1) ...h(7) h(6) ...h(5) h(3) h(3) ...jieh(3) ...h(2) ...jie?];Song.h_rail(1).beat = [8 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie2 2 1 1 2 ...2 1 1 2 2 ...2 2 1 1 2 ...1 1 2 1 1 1 1 ...jie3 1 1 1 2 ...4 1 3 ...4 1 2 1 ...4 1 3 ...jie4 1 2 1 ...1 1 2 1 1 1 1+4 ...1 1 2 ...
1 1 2 1 1 1 1+4 ...jie1 3 ...4 1 2 1 ...4 1 2 1 ...4 1 3 ...jie6 1 1 ...3 1+1 2 1+3 ...1+1 2 1+3 ...1+1 1 1 1+6 ...jie1 1+3 ...1+1 1 1 1+3 ...1+1 1 1 1+6 ...1 1 ...jie6 1 1+4 ...4 ...6 1 1+4 ...1 3 ...jie2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+4 ...1 3 ...jie6 1 1+4 ...1 3 ...6 1 1+4 ...
1 3 ...jie2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+3 ...1 1 1 1 1+4 ...jie3 1+6 ...1 1+8 ...2 1 1 1 1 1 1+4 ...jie3 1+6 ...1 1+6 ...
1 1+8 ...jie2 2 1 1 2 ...2 1 1 2 2 ...2 2 1 1 2 ...1 1 2 1 1 1 1 ...jie3 1 1 1 2 ...4 1 3 ...4 1 2 1 ...4 1 3 ...jie4 1 2 1 ...1 1 2 1 1 1 1+4 ...1 1 2 ...
1 1 2 1 1 1 1+4 ...jie1 3 ...4 1 2 1 ...4 1 2 1 ...4 1 3 ...jie6 1 1 ...3 1+1 2 1+3 ...1+1 2 1+3 ...1+1 1 1 1+6 ...jie1 1+3 ...1+1 1 1 1+3 ...1+1 1 1 1+6 ...1 1 ...jie6 1 1+4 ...4 ...6 1 1+4 ...1 3 ...jie2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+4 ...1 3 ...jie6 1 1+4 ...1 3 ...6 1 1+4 ...
1 3 ...jie2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+3 ...1 1 1 1 1+4 ...jie3 1+6 ...1 1+8 ...2 1 1 1 1 1 1+4 ...jie3 1+6 ...1 1+6 ...
1 1+8 ...jie1 1 1 1+1 1 2 ...8 ...3 1+1 2 1+3 ...1+2 1 1+3 ...jie1+1 2 1+8 ...3 1+1 2 1+3 ...1+1 2 1+6 ...jie1 1 ...6 1 1+4 ...4 ...
6 1 1+4 ...jie1 3 ...2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+4 ...jie1 3 ...6 1 1+4 ...1 3 ...6 1 1+4 ...jie1 3 ...2 2 2 1 1+4 ...1 3 ...2 2 2 1 1+3 ...jie1 1 1 1 1+4 ...3 1+6 ...1 1+6 ...2 ...jie2 1 1 1 1 1 1+4 ...3 1+6 ...1 1+6 ...2 ...jie2 2 1 1 1 1+2 ...1 1+2 1 1+3 ...1+2 1 1+6 ...
2 ...jie2 2 1 1 1 1 ...2 1 1+2 1 1+3 ...1+2 1 1+6 ...2 ...jie2 2 1 1 1 1+3 ...1+3 1+3 ...1+2 1 1+6 ...jie2 ...8 ...jie]; Song.h_rail(2).tone = [0 ...hs(1) hs(1) hs(1) ...h(1) h(1) h(1) ...h(1) h(1) h(1) ...m(7) m(7) m(7) ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...0 ...jie];Song.h_rail(2).beat = [8 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...8 ...jie];Song.h_rail(3).tone = [0 ...h(3) h(3) h(3) ...h(4) h(4) h(4) ...h(3) h(3) h(3) ...h(2) h(2) h(2) ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...0 ...jie?0 ...0 ...0 ...
0 ...jie?0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...0 ...jie];Song.h_rail(3).beat = [8 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...8 ...jie];Song.l_rail(1).tone = [0 ...l(6) ...l(4) ...l(1) ...l(5) ...jiell(6) l(6) l(6) ...l(4) l(6) l(6) ...l(1) l(5) l(5) ...ll(5) l(5) l(5) ...jiell(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...ll(5) l(7) l(7) ...jiell(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...
ll(5) l(7) l(7) ...jie?ll(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...
ll(5) l(7) l(7) ...jie?
l(2) l(6) l(6) ...l(2) l(6) m(1) m(4) l(6) m(1) m(4) ...l(1) l(5) m(1) m(3) l(5) m(1) ...l(5) l(7) m(2) ...jiel(2) l(6) m(1) m(2) m(1) l(6) m(1) ...l(2) l(6) m(1) m(2) m(1) l(6) ...l(1) l(5) m(1) m(2) m(3) ...ll(5) l(2) l(5) l(6) l(7) m(2) ...jiel(1) l(5) m(1) m(2) m(3) l(5) ...l(1) l(5) m(1) m(2) m(3) l(5) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...jiel(4) l(6) m(1) m(3) m(1) m(3) ...l(4) l(6) m(1) m(3) m(1) m(3) ...ll(5) l(2) l(5) m(1) m(2) l(5) m(1) m(2) ...ll(5) l(2) l(5) l(7) m(2) l(7) l(5) l(7) ...jiel(1) l(5) m(1) m(2) m(3) m(5) ...l(1) l(5) m(1) m(2) m(3) m(5) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...
ll(6) l(3) l(6) l(7) m(1) m(3) ...jie?ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(5) l(2) l(5) m(1) m(2) l(5) m(1) m(2) ...ll(5) l(2) l(5) l(7) m(2) l(7) l(5) l(7) ...jiell(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...ll(5) l(2) l(5) l(6) l(7) m(2) ...jiell(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...
ll(5) l(2) l(5) l(6) l(7) m(2) ...jie?ll(6) l(6) l(6) ...l(4) l(6) l(6) ...l(1) l(5) l(5) ...ll(5) l(5) l(5) ...jiell(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...ll(5) l(7) l(7) ...jiell(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...
ll(5) l(7) l(7) ...jie?
ll(6) l(6) l(6) ...ll(4) l(6) l(6) ...l(1) m(1) m(1) ...
ll(5) l(7) l(7) ...jie?l(2) l(6) l(6) ...l(2) l(6) m(1) m(4) l(6) m(1) m(4) ...l(1) l(5) m(1) m(3) l(5) m(1) ...l(5) l(7) m(2) ...jiel(2) l(6) m(1) m(2) m(1) l(6) m(1) ...l(2) l(6) m(1) m(2) m(1) l(6) ...l(1) l(5) m(1) m(2) m(3) ...ll(5) l(2) l(5) l(6) l(7) m(2) ...jiel(1) l(5) m(1) m(2) m(3) l(5) ...l(1) l(5) m(1) m(2) m(3) l(5) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...jiel(4) l(6) m(1) m(3) m(1) m(3) ...l(4) l(6) m(1) m(3) m(1) m(3) ...ll(5) l(2) l(5) m(1) m(2) l(5) m(1) m(2) ...ll(5) l(2) l(5) l(7) m(2) l(7) l(5) l(7) ...jiel(1) l(5) m(1) m(2) m(3) m(5) ...l(1) l(5) m(1) m(2) m(3) m(5) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...
ll(6) l(3) l(6) l(7) m(1) m(3) ...jie?ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(5) l(2) l(5) m(1) m(2) l(5) m(1) m(2) ...ll(5) l(2) l(5) l(7) m(2) l(7) l(5) l(7) ...jiell(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...ll(5) l(2) l(5) l(6) l(7) m(2) ...jiell(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...
ll(5) l(2) l(5) l(6) l(7) m(2) ...jie?ll(5) l(2) l(5) l(6) l(7) m(2) ...l(2) l(6) m(2) m(3) m(4) m(6) ...l(2) l(6) m(2) m(3) m(4) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...jiell(5) l(2) l(5) l(6) l(7) m(2) ...l(2) l(6) m(2) m(3) m(4) m(6) ...l(2) l(6) m(2) m(3) m(4) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...jiel(5) m(2) m(5) m(6) m(7) h(2) ...l(1) l(5) m(1) ...
ll(6) l(3) m(1) ...jiell(4) l(6) m(2) ...ll(5) l(5) l(7) ...jiel(1) l(5) m(1) m(2) m(3) m(5) ...l(1) l(5) m(1) m(2) m(3) m(5) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...jiell(6) l(3) l(6) l(7) m(1) m(3) ...ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(4) l(1) l(4) l(6) m(1) l(6) ...ll(5) l(2) l(5) m(1) m(2) l(5) m(1) m(2) ...jiell(5) l(2) l(5) l(7) m(2) l(7) l(5) l(7) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...jiell(5) l(2) l(5) l(6) l(7) m(2) ...ll(6) l(3) l(6) l(7) m(1) m(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...jiell(5) l(2) l(5) l(6) l(7) m(2) ...l(6) m(3) m(6) m(7) h(1) h(3) ...l(4) m(1) m(4) m(5) m(6) ...
l(1) l(5) m(1) m(2) m(3) m(5) ...jie?ll(5) l(2) l(5) l(6) l(7) m(2) ...l(6) m(3) m(6) m(7) h(1) h(3) ...l(4) m(1) m(4) m(5) m(6) ...l(1) l(5) m(1) m(2) m(3) m(5) ...jiel(5) m(2) m(5) m(6) m(7) ...l(6) m(3) m(6) m(7) h(1) h(3) ...l(4) m(1) m(4) m(5) m(6) ...jiel(1) l(5) m(1) m(2) m(3) m(5) ...l(5) l(7) m(2) m(5) ...jie];Song.l_rail(1).beat = [8 ...8 ...8 ...8 ...8 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...1 1 1 1+1 1 1 1 ...1 1 1 1+1 1 2 ...1 1 6 ...jie1 1 1 1+1 1 1 1 ...1 1 1 1+1 1 2 ...1 1 1 1+1 3 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1+1 1 2 ...1 1 1 1+1 1 2 ...jie1 1 1 1+1 1 2 ...1 1 1 1+1 1 2 ...1 1 1 1 1 1 1 1 ...1 1 1 1 1 1 1 1 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...
1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 1 1 1 1 ...1 1 1 1 1 1 1 1 ...jie1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...
1 1 1 1 2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...1 1 1 1+1 1 1 1 ...1 1 1 1+1 1 2 ...1 1 6 ...jie1 1 1 1+1 1 1 1 ...1 1 1 1+1 1 2 ...1 1 1 1+1 3 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1+1 1 2 ...1 1 1 1+1 1 2 ...jie1 1 1 1+1 1 2 ...1 1 1 1+1 1 2 ...1 1 1 1 1 1 1 1 ...1 1 1 1 1 1 1 1 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...
1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 1 1 1 1 ...1 1 1 1 1 1 1 1 ...jie1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...
1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...2 2 4+8 ...
2 2 4+8 ...jie2 2 4+8 ...2 2 4+8 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 1 1 1 1 ...jie1 1 1 1 1 1 1 1 ...1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 4 ...
1 1 1 1 2 2 ...jie1 1 1 1 2 2 ...1 1 1 1 2 2 ...1 1 1 1 4 ...1 1 1 1 2 2 ...jie1 1 1 1 4 ...1 1 1 1 2 2 ...1 1 1 1 4 ...jie1 1 1 1 2 2 ...1 1 1 1+4 ...jie];  Song.l_rail(2).tone = [0 ...0 ...0 ...0 ...0 ...jie0 ms(1) ms(1) ...0 m(1) m(1) ...0 m(1) m(1) ...0 l(7) l(7) ...jie0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...0 m(2) m(2) ...jie0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...
0 m(2) m(2) ...jie?
0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...
0 m(2) m(2) ...jie?
0 m(1) m(1) ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ms(1) ms(1) ...0 m(1) m(1) ...0 m(1) m(1) ...0 l(7) l(7) ...jie0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...0 m(2) m(2) ...jie0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...
0 m(2) m(2) ...jie?
0 m(1) m(1) ...0 m(1) m(1) ...0 m(3) m(3) ...
0 m(2) m(2) ...jie?0 m(1) m(1) ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 m(3) ...
0 m(3) ...jie0 m(4) ...0 m(2) ...jie0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...jie0 ...0 ...jie];Song.l_rail(2).beat = [8 ...8 ...8 ...8 ...8 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...4 4+8 ...
4 4+8 ...jie4 4+8 ...4 4+8 ...jie8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...jie8 ...8 ...jie];  Song.l_rail(3).tone = [0 ...0 ...0 ...0 ...0 ...jie0 m(3) m(3) ...0 m(4) m(4) ...0 m(3) m(3) ...0 m(2) m(2) ...jie0 m(3) m(3) ...0 m(4) m(4) ...0 m(5) m(5) ...0 m(5) m(5) ...jie0 m(3) m(3) ...0 m(3) m(3) ...0 m(5) m(5) ...
0 m(5) m(5) ...jie?0 m(3) m(3) ...0 m(4) m(4) ...0 m(5) m(5) ...0 m(5) m(5) ...jie0 m(4) m(4) ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 m(3) m(3) ...0 m(4) m(4) ...0 m(3) m(3) ...0 m(2) m(2) ...jie0 m(3) m(3) ...0 m(4) m(4) ...0 m(5) m(5) ...0 m(5) m(5) ...jie0 m(3) m(3) ...0 m(3) m(3) ...0 m(5) m(5) ...
0 m(5) m(5) ...jie?0 m(3) m(3) ...0 m(4) m(4) ...0 m(5) m(5) ...0 m(5) m(5) ...jie0 m(4) m(4) ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 m(5) ...
0 m(5) ...jie0 m(6) ...0 m(5) ...jie0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...
0 ...jie0 ...0 ...0 ...0 ...jie0 ...0 ...0 ...jie0 ...0 ...jie];Song.l_rail(3).beat = [8 ...8 ...8 ...8 ...8 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...
3 1+2 2 ...jie3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...3 1+2 2 ...jie3 1+2 2 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...4 4+8 ...
4 4+8 ...jie4 4+8 ...4 4+8 ...jie8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...
8 ...jie8 ...8 ...8 ...8 ...jie8 ...8 ...8 ...jie8 ...8 ...jie];%先创建好的向量(数组)在下面n = 0:6*fs-1;%每个音轨的音符串成歌曲for j = 1:length(Song.h_rail)for i = 1:length(Song.h_rail(j).tone)high = mulfreq(Song.h_rail(j).tone(i), Song.h_rail(j).beat(i), degree, fs);high = ADSR(high, Song.h_rail(j).tone(i));Song.h_rail(j).y = [Song.h_rail(j).y high];Song.h_rail(j).accumulation = ...[Song.h_rail(j).accumulation Song.h_rail(j).accumulation(end)+length(high)];end
endfor j = 1:length(Song.l_rail)for i = 1:length(Song.l_rail(j).tone)low = mulfreq(Song.l_rail(j).tone(i), Song.l_rail(j).beat(i), degree, fs);low = ADSR(low, Song.l_rail(j).tone(i));Song.l_rail(j).y = [Song.l_rail(j).y low];Song.l_rail(j).accumulation = ...[Song.l_rail(j).accumulation Song.l_rail(j).accumulation(end)+length(low)];end
end%把每个音轨数组的数量取成相等Max = max([length(Song.h_rail(1).y), length(Song.h_rail(2).y), ...length(Song.l_rail(1).y), length(Song.l_rail(2).y), ...length(Song.l_rail(3).y)]);for i = 1:length(Song.h_rail)Song.h_rail(i).y = [Song.h_rail(i).y zeros(1,Max - length(Song.h_rail(i).y))];Song.h_rail(i).accumulation(end) = Max;
end
for i = 1:length(Song.l_rail)Song.l_rail(i).y = [Song.l_rail(i).y zeros(1,Max - length(Song.l_rail(i).y))];Song.l_rail(i).accumulation(end) = Max;
end%把高音2个音轨和低音三个音轨分别合成成两个高低音轨h_y = Song.h_rail(1).y + Song.h_rail(2).y + Song.h_rail(3).y;
l_y = Song.l_rail(1).y + Song.l_rail(2).y + Song.l_rail(3).y;%这里是左右声道的关键y = [h_y / max(h_y) ; l_y / max(l_y) * 0.8];%soundsc是会缩放数据和来进行播放soundsc(y,fs);
function y = mulfreq(F, beat, degree, fs)% 钢琴泛音函数% 这个函数是用来给每个钢琴的基音进行混频达到钢琴的效果global Oddif beat / degree * fs ~= ceil(beat / degree * fs)  % 不是整数if Odd == 0n = 0:ceil(beat / degree * fs) - 1;Odd = 1;elsen = 0:floor(beat / degree * fs) - 1;Odd = 0;end
else   % 是整数n = 0:beat / degree * fs - 1;
endif(F >= 27.5 && F < 77.782)A = [283.39 953.64 200.43 183.09 84.41 179.81 140.61 15.09 58.48 68.68 56.17 7.51 6.67 61.50 ... 177.24 75.90 5.08 18.64 34.17 6.91 18.33 99.55 42.76 48.43];num = 24;M = 1300;
elseif(F >= 77.782 && F < 103.826)A = [653.88 283.14 378.22 271.94 168.34 41.66 119.38 8.22 24.89 90.35 184.22 112.47 24.69 ...46.40  69.29 36.92 5.20 34.06 27.06 22.90 9.10 58.23 15.57 33.73];num = 24;M = 1300;
elseif(F >= 103.826 && F < 130.813)A = [389.83 472.58 228.25 218.33 68.28 42.41 64.61 35.93 14.52 60.04 23.63 33.17];num = 12;M = 1100;
elseif(F >= 130.813 && F < 155.563)A = [381.33 423.33 204.23 195.40 61.89 34.97 53.22 31.98 10.61 55.60 16.78 34.16];num = 12;M = 1000;
elseif(F >= 155.563 && F < 174.614)A = [796.75 627.25 122.95 110.3 36.5 48.78 25.55 70.71 62.7 41.715 21.59];num = 11;M = 1300;
elseif(F >= 174.614 && F < 261.626)A = [890.30 388.89 113.71 92.26 28.12 44.14 20.08 71.89 87.33 32.24];num = 10;M = 1300;
elseif(F >= 261.626 && F < 415.305)A = [774.76 256.83 90.41 65.96 60.62 43.41 20.47 63.47];num = 8;M = 1000;
elseif(F >= 415.305 && F < 622.254)A = [518.24 159.29 100.99 29.69 40.52 24.42 23.26];num = 7;M = 700;
elseif(F >= 622.254 && F < 932.328)A = [734.06 191.56 15.97 14.00 10.39];num = 5;M = 800;
elseif(F >= 932.328 && F < 1396.913)A = [323.06 12.17 11.88 12.73];num = 4;M = 300;
elseif(F >= 1396.913 && F < 2093.005)A = [287.29 21.75 4.09];num = 3;M = 300;
elseif(F >= 2093.005 && F < 2349.318)A = [208.30 17.06];num = 2;M = 200;
elseif(F >= 2349.318)A = [114.23 4.06];num = 2;M = 112.5;
else  % F == 0A = [0 0];num = 2;M = 0;
endangle = 2 * pi .* rand(num, 1);
A = A';
f = [];for i = 1:numf = [f;F*i];
endy = sum( A * M .* sin(2 * pi * f * n / fs + angle));end

这篇关于Matlab唱歌?尊嘟假嘟?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/228684

相关文章

matlab读取NC文件(含group)

matlab读取NC文件(含group): NC文件数据结构: 代码: % 打开 NetCDF 文件filename = 'your_file.nc'; % 替换为你的文件名% 使用 netcdf.open 函数打开文件ncid = netcdf.open(filename, 'NC_NOWRITE');% 查看文件中的组% 假设我们想读取名为 "group1" 的组groupName

利用matlab bar函数绘制较为复杂的柱状图,并在图中进行适当标注

示例代码和结果如下:小疑问:如何自动选择合适的坐标位置对柱状图的数值大小进行标注?😂 clear; close all;x = 1:3;aa=[28.6321521955954 26.2453660695847 21.69102348512086.93747104431360 6.25442246899816 3.342835958564245.51365061796319 4.87

C# double[] 和Matlab数组MWArray[]转换

C# double[] 转换成MWArray[], 直接赋值就行             MWNumericArray[] ma = new MWNumericArray[4];             double[] dT = new double[] { 0 };             double[] dT1 = new double[] { 0,2 };

libsvm在matlab中的使用方法

原文地址:libsvm在matlab中的使用方法 作者: lwenqu_8lbsk 前段时间,gyp326曾在论坛里问libsvm如何在matlab中使用,我还奇怪,认为libsvm是C的程序,应该不能。没想到今天又有人问道,难道matlab真的能运行libsvm。我到官方网站看了下,原来,真的提供了matlab的使用接口。 接口下载在: http://www.csie.ntu.edu.

Matlab/Simulink中PMSM模型的反电动势系数和转矩系数

Matlab/Simulink中PMSM模型的反电动势系数和转矩系数_matlab pmsm-CSDN博客

MATLAB层次聚类分析法

转自:http://blog.163.com/lxg_1123@126/blog/static/74841406201022774051963/ 层次聚类是基于距离的聚类方法,MATLAB中通过pdist、linkage、dendrogram、cluster等函数来完成。层次聚类的过程可以分这么几步: (1) 确定对象(实际上就是数据集中的每个数据点)之间的相似性,实际上就是定义一个表征

MATLAB的fix(),floor()和ceil()函数的区别与联系

fix(x),floor(x)和ceil(x)函数都是对x取整,只不过取整方向不同而已。 这里的方向是以x轴作为横坐标来看的,向右就是朝着正轴方向,向左就是朝着负轴方向。 fix(x):向0取整(也可以理解为向中间取整) floor(x):向左取整 ceil(x):向右取整 举例: 4个数:a=3.3、b=3.7、c=-3.3、d=-3.7 fix(a)=3 fl

MATLAB中的eig函数

在MATLAB中,计算矩阵A的特征值和特征向量的函数是eig(A),常用的调用格式有5种: E=eig(A):求矩阵A的全部特征值,构成向量E。 [V,D]=eig(A):求矩阵A的全部特征值,构成对角阵D,并求A的特征向量构成V的列向量。 [V,D]=eig(A,'nobalance'):与第2种格式类似,但第2种格式中先对A作相似变换后求矩阵A的特征值和特征向量,而格式3直接求矩阵A的特

MATLAB中的diag函数

diag函数功能:矩阵对角元素的提取和创建对角阵 设以下X为方阵,v为向量 1、X = diag(v,k)当v是一个含有n个元素的向量时,返回一个n+abs(k)阶方阵X,向量v在矩阵X中的第k个对角线上,k=0表示主对角线,k>0表示在主对角线上方,k<0表示在主对角线下方。例1: v=[1 2 3]; diag(v, 3) ans =      0     0     0

Matlab simulink建模与仿真 第十章(模型扩展功能库)

参考视频:simulink1.1simulink简介_哔哩哔哩_bilibili 一、模型扩展功能库中的模块概览         注:下面不会对Block Support Table模块进行介绍。 二、基于触发的和基于时间的线性化模块 1、Trigger-Based Linearization基于触发的线性化模块 (1)每次当模块受到触发时,都会调用linmod或者dlinmod函数