资源简介
用matlab编程实现天空之城的演奏,beautiful~
代码片段和文件信息
%天空の城
fs = 44100; % sample rate
dt = 1/fs;
T16 = 0.125;
t16 = 0:dt:T16;
[temp k] = size(t16);
t1 = linspace(016*T1616*k);
t34 = linspace(0 12*T16 12*k);
t2 = linspace(08*T168*k);
t38 = linspace(06*T166*k);
t4 = linspace(04*T164*k);
t8 = linspace(02*T162*k);
[temp i] = size(t4);
[temp j] = size(t8);
% Modification functions
mod1 = sin(pi*t1/t1(end));
mod34 = sin(pi*t34/t34(end));
mod38 = sin(pi*t38/t38(end));
mod2 = sin(pi*t2/t2(end));
mod4 = sin(pi*t4/t4(end));
mod8 = sin(pi*t8/t8(end));
f0 = 2*146.8; % reference frequency
ScaleTable = [1 9/8 5/4 4/3 3/2 5/3 15/8 ...
2 9/4 5/2 8/3 3 10/3 15/4];
%1 notes
la04 = mod1.*cos(2*pi*ScaleTable(6)*f0*t1);
mi14 = mod1.*cos(2*pi*ScaleTable(10)*f0*t1);
%1/2 notes
do0d = mod2.*cos(2*pi*ScaleTable(1)*f0*t2);
re0d = mod2.*cos(2*pi*ScaleTable(2)*f0*t2);
mi0d = mod2.*cos(2*pi*ScaleTable(3)*f0*t2);
fa0d = mod2.*cos(2*pi*ScaleTable(4)*f0*t2);
so0d = mod2.*cos(2*pi*ScaleTable(5)*f0*t2);
la0d = mod2.*cos(2*pi*ScaleTable(6)*f0*t2);
si0d = mod2.*cos(2*pi*ScaleTable(7)*f0*t2);
do1d = mod2.*cos(2*pi*ScaleTable(8)*f0*t2);
re1d = mod2.*cos(2*pi*ScaleTable(9)*f0*t2);
mi1d = mod2.*cos(2*pi*ScaleTable(10)*f0*t2);
fa1d = mod2.*cos(2*pi*ScaleTable(11)*f0*t2);
so1d = mod2.*cos(2*pi*ScaleTable(12)*f0*t2);
la1d = mod2.*cos(2*pi*ScaleTable(13)*f0*t2);
si1d = mod2.*cos(2*pi*ScaleTable(14)*f0*t2);
%3/8 notes
do0t = mod38.*cos(2*pi*ScaleTable(1)*f0*t38);
re0t = mod38.*cos(2*pi*ScaleTable(2)*f0*t38);
mi0t = mod38.*cos(2*pi*ScaleTable(3)*f0*t38);
fa0t = mod38.*cos(2*pi*ScaleTable(4)*f0*t38);
so0t = mod38.*cos(2*pi*ScaleTable(5)*f0*t38);
la0t = mod38.*cos(2*pi*ScaleTable(6)*f0*t38);
si0t = mod38.*cos(2*pi*ScaleTable(7)*f0*t38);
do1t = mod38.*cos(2*pi*ScaleTable(8)*f0*t38);
re1t = mod38.*cos(2*pi*ScaleTable(9)*f0*t38);
mi1t = mod38.*cos(2*pi*ScaleTable(10)*f0*t38);
fa1t = mod38.*cos(2*pi*ScaleTable(11)*f0*t38);
so1t = mod38.*cos(2*pi*ScaleTable(12)*f0*t38);
la1t = mod38.*cos(2*pi*ScaleTable(13)*f0*t38);
si1t = mod38.*cos(2*pi*ScaleTable(14)*f0*t38);
%3/4 notes
so0q = mod34.*cos(2*pi*ScaleTable(5)*f0*t34);
si0q = mod34.*cos(2*pi*ScaleTable(7)*f0*t34);
%1/4 notes
do0f = mod4.*cos(2*pi*ScaleTable(1)*f0*t4);
re0f = mod4.*cos(2*pi*ScaleTable(2)*f0*t4);
mi0f = mod4.*cos(2*pi*ScaleTable(3)*f0*t4);
fa0f = mod4.*cos(2*pi*ScaleTable(4)*f0*t4);
so0f = mod4.*cos(2*pi*ScaleTable(5)*f0*t4);
la0f = mod4.*cos(2*pi*ScaleTable(6)*f0*t4);
si0f = mod4.*cos(2*pi*ScaleTable(7)*f0*
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论