フィルターのクリア

How would I make my song have a diminuendo (a fade out over the last two bars)? This is what I have so far for this portion, but I can't get it to work. Thank you very much for your help in advance, it is greatly appreciated!

2 ビュー (過去 30 日間)
fadeOut = input('Do you want the song to fade out?(y/n)-->','s');
if (fadeOut == 'y')
dim = linspace(1,0.2,setRate*(2*setBarLength));
song = song(dim);
elseif fadeOut == 'n'
song;
end
  2 件のコメント
Stephen23
Stephen23 2017 年 9 月 21 日
@Snooping Poppet: it is not appreciated when you edit away the text of your question. Imagine if everyone did that, then this entire forum would be useless for anyone else as it would only consist of thousands of threads all reading "This post was taken down". Would you find that useful?
By deleting your question you unilaterally decided that Goeff Hayes' volunteered time helping you shall not be useful to anyone else. Does Geoff Hayes get a say in this decision? Do you think this is why we volunteers come here and write our advice and comments?
If you want a consulting service then you will find plenty of them on them internet. This is a community forum with answers provided by volunteers.
Rena Berman
Rena Berman 2017 年 9 月 28 日
(Answers Dev) Restored edit

サインインしてコメントする。

採用された回答

Geoff Hayes
Geoff Hayes 2016 年 9 月 25 日
Brandon - I'm not sure what units you are using for your SetBarLength but presumably you want to fade the last
setRate*(2*setBarLength)
samples from your song array. If that is the case, then you could just do
if strcmpi(fadeOut,'y')
N = setRate*(2*setBarLength);
dimFactors= linspace(1,0.2,N);
song(end - N + 1:end) = song(end - N + 1:end).*dimFactors;
end
In the above, we just multiply the remaining N samples of song by the diminuendo factors so that a fade out (of the song) occurs. You may need to adjust this multiplication because I don't know what the dimensions are for song.
Also, note the use of strcmpi for the string comparison.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by