Filter löschen
Filter löschen

Need help for modification in code

1 Ansicht (letzte 30 Tage)
moonman
moonman am 22 Sep. 2011
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 Kommentar
Walter Roberson
Walter Roberson am 22 Sep. 2011
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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Just for fun finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by