Matlab實現《追光者》簡譜


MATLAB除了生孩子,其他全都能做系列。

使用MATLAB進行播放《追光者》,純文本內容哦。

1 Fs = 8192;
2 load y;
3 sound(y, Fs);

加載的y是哪里來的呢?當然是調用函數生成的咯。

function y = gen_wave(tone, rythm, type)
    Fs = 8192;
    freqs = [261, 293, 329, 349, 392, 440, 494, 523, 587, 659, 698, 783, 880, 988, 1046, 1174, 0];
    x = linspace(0, 2 * pi * rythm, floor(Fs * rythm));
    if type == 1
        y = sin(freqs(tone) * x);
    else
        y = sin(freqs(tone) * x) .* (1 - x / (2 * pi * rythm));
    end
end

y中的內容就不展示了,全是數據。

鏈接:!!!!!

鏈接:https://pan.baidu.com/s/1NPh4SaAJZ3ZMiN2M98vL6g
提取碼:8qpu


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM