0

您好,我一直在创建 Yamaha DX7 合成器的 matlab 脚本。这是为了更好地理解我的合成器(Nord 模块化 G2 与 DX7 模拟器)。DX7 有 32 种不同的算法。此刻我只有第一个见图算法

我拥有的代码是以下matlab代码:

%% Feedback loop DX 7 Like
fs = 44100; f_b = 440; t = 0:1/44100:5; % f_b = Frequency basic
n = 5 * fs +1;

r = [1 1 1 1 1 1]; % ratio's for the different tones.
l = [1 1 1 .75 1 .5]; % Levels of amplitude 
feedback = 1; % how much go back in the system 
% 0 = 0%; 1 = @%; 2 = @%; 3 = @%; 4 = @%; 5 = @%; 6 = @%; 7 = @%
if feedback ==0
    fb = 0;
elseif feedback == 1;
    fb = 1^2;
elseif feedback == 2;
    fb = 2^2;
elseif feedback == 3;
    fb = 3^2;
elseif feedback == 4;
    fb = 4^2;   
elseif feedback == 5;
    fb = 5^2;  
elseif feedback == 6;
    fb = 6^2;
elseif feedback == 7;
    fb = 7^2;
else
    fb = 7^2;
end
%% DX7 stuff
% Operator 6
for k=1:n
    if k == 1;
        phif = 0;
    else
    phif = y6(1,k-1)*fb;
    end
    y6(1,k) = l(1,6) * sin (2*pi*r(1,6)*f_b*t(1,k)+phif);

end

y5 = l(1,5) * sin (2*pi*r(1,5)*f_b*t+y6);
y4 = l(1,4) * sin (2*pi*r(1,4)*f_b*t+y5);
y3 = l(1,3) * sin (2*pi*r(1,3)*f_b*t+y4);

y2 = l(1,2) * sin (2*pi*r(1,2)*f_b*t+0);
y1 = l(1,1) * sin (2*pi*r(1,1)*f_b*t+y2);

y = y3 + y1;
figure; plot(t,y4);xlim([0,0.5]);

下一步是创建一种用于获取生根更改的查找表。我想要的是y = A *sin(2*pi*f*t + phi)phi 的输入来自查找表。所以对于算法 2,我有更改phif = y2(1,k-1)*fb;y2 = l(1,2) * sin (2*pi*r(1,2)*f_b*t+phif)并且y6(1,k) = l(1,6) * sin (2*pi*r(1,6)*f_b*t(1,k)+0)

编辑:我有 6 个正弦输出信号 y1 - y6,我有 6 个信号 phi1 - phi6 的相位输入。我也有混音。

我想从查找表中读出路由。例如算法 7:mix1 = y4 + y5phi5 = y6.
phi5 = y6存储在查找表中。并从查找表中我需要导入我的变量

但我不知道我该怎么做……</p>

我希望有人能帮助我。

4

0 回答 0