Need help for modification in code
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!