How to generate a song on Matlab?
49 ビュー (過去 30 日間)
古いコメントを表示
I have to make a song on Matlab and then set up sine waves that correspond to the notes on the scale. The notes are CFDGCEAmCFGC. can someone help me with this?
0 件のコメント
採用された回答
David Barry
2016 年 12 月 19 日
Here's an example to get you started. 5 seconds of middle C.
fs = 1e4; % sampling frequency
t = 1:1/fs:5; % time signal
freq = 261.6; % note frequency in Hz (middle C)
y = sin(2*pi*freq*t); % create sine wave
player = audioplayer(y, fs); % create audio player object
play(player); % play the sound
その他の回答 (2 件)
zeeshan ali
2020 年 3 月 1 日
fs = 1e4; % sampling frequency
t = 1:1/fs:5; % time signal
freq = 261.6; % note frequency in Hz (middle C)
y = sin(2*pi*freq*t); % create sine wave
player = audioplayer(y, fs); % create audio player object
play(player); % play the sound
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Audio I/O and Waveform Generation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!