Need help for modification in code

1 次查看(过去 30 天)
moonman
moonman 2011-9-22
Hi i have made a piano code and i am using soundsc(tone,fs) to listen 30 seconds music. Now i want to implement ADSR envolop on it. I have got ADSR Envolop from internet but it is only for one key where as my tone is combination of 100 keys of piano
The code of net is
A = linspace(0, 0.6, (length(tone)*0.2)); %rise 20% of signal
D = linspace(0.6, 0.5,(length(tone)*0.05)); %drop of 5% of signal
S = linspace(0.5, 0.5,(length(tone)*0.4)); %delay of 40% of signal
R = linspace(0.5, 0,(length(tone)*0.35)); %drop of 35% of signal
ADSR = [A D S R] ; %make a matrix
*
dif = length(tone) - length(ADSR); % How i have to change it as my %tone is row vector of thousands of elements*
x = cat(2, ADSR, zeros(1,dif));
xx = tone .* x; %times them together
**************************************
I want to apply ADSR on each key of piano. how to go for that
  1 个评论
Walter Roberson
Walter Roberson 2011-9-22
Does this mean that your previous question http://www.mathworks.com/matlabcentral/answers/16459-how-to-implement-adsr-envelop-on-matlab-piano-song is no longer required?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by