资源简介
用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*
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论