(New page: <br>% 1.<br>% a) deltat = 5e-5; %detemine the length of each tempo<br>Q = 0:deltat:(60/112);<br>E = 0:deltat:(60/112/2);<br>DQ = 0:deltat:(60/112*1.5);<br>H = 0:deltat:(60/112*2); ...) |
|||
Line 43: | Line 43: | ||
<br>%2. | <br>%2. | ||
− | [beatles, Fs] = wavread('Beatles.wav');<br>beatles_rev = flipud(beatles);<br>sound(beatles_rev,Fs);<br>wavwrite(beatles_rev,Fs,'beatles_rev.wav');<br><br> | + | [beatles, Fs] = wavread('Beatles.wav');<br>beatles_rev = flipud(beatles);<br>sound(beatles_rev,Fs);<br>wavwrite(beatles_rev,Fs,'beatles_rev.wav');<br><br> |
+ | |||
+ | [https://www.projectrhea.org/rhea/images/7/7f/Smoke.wav www.projectrhea.org/rhea/images/7/7f/Smoke.wav] | ||
+ | |||
+ | [https://www.projectrhea.org/rhea/images/2/22/Smokefast.wav www.projectrhea.org/rhea/images/2/22/Smokefast.wav] | ||
+ | |||
+ | [https://www.projectrhea.org/rhea/images/6/61/Smokehigh.wav www.projectrhea.org/rhea/images/6/61/Smokehigh.wav] | ||
+ | |||
+ | [https://www.projectrhea.org/rhea/images/9/92/Beatles_rev.wav www.projectrhea.org/rhea/images/9/92/Beatles_rev.wav] |
Latest revision as of 15:57, 16 January 2011
% 1.
% a)
deltat = 5e-5; %detemine the length of each tempo
Q = 0:deltat:(60/112);
E = 0:deltat:(60/112/2);
DQ = 0:deltat:(60/112*1.5);
H = 0:deltat:(60/112*2);
fA = 440*2*pi; %detemine the frequency of each tune
fG = 2^(-2/12) * fA;
fBf = 2^(1/12) * fA;
fC = 2^(3/12) * fA;
fD = 2^(4/12) * fA;
QG = sin(fG * Q); %generate each tune
QBf = sin(fBf * Q);
DQC = sin(fC * DQ);
EDf = sin(fD * E);
HC = sin(fC * H);
melody = [QG,QBf,DQC,QG,QBf,EDf,HC,QG,QBf,DQC,QBf,QG]; %generate melody
sound(melody,1/deltat);
wavwrite(melody,1/deltat,'smoke.wav'); %generate sound file
pause(10);
% b)
deltat = 5e-5; %detemine the length of each tempo
Q = 0:deltat:(60/112/2);
E = 0:deltat:(60/112/2/2);
DQ = 0:deltat:(60/112*1.5/2);
H = 0:deltat:(60/112*2/2);
fA = 440*2*pi; %detemine the frequency of each tune
fG = 2^(-2/12) * fA;
fBf = 2^(1/12) * fA;
fC = 2^(3/12) * fA;
fD = 2^(4/12) * fA;
QG = sin(fG * Q); %generate each tune
QBf = sin(fBf * Q);
DQC = sin(fC * DQ);
EDf = sin(fD * E);
HC = sin(fC * H);
melody = [QG,QBf,DQC,QG,QBf,EDf,HC,QG,QBf,DQC,QBf,QG]; %generate melody
sound(melody,1/deltat);
wavwrite(melody,1/deltat,'smokefast.wav'); %generate sound file
pause(10);
% c)
deltat = 5e-5; %detemine the length of each tempo
Q = 0:deltat:(60/112);
E = 0:deltat:(60/112/2);
DQ = 0:deltat:(60/112*1.5);
H = 0:deltat:(60/112*2);
fA = 880*2*pi; %detemine the frequency of each tune
fG = 2^(-2/12) * fA;
fBf = 2^(1/12) * fA;
fC = 2^(3/12) * fA;
fD = 2^(4/12) * fA;
QG = sin(fG * Q); %generate each tune
QBf = sin(fBf * Q);
DQC = sin(fC * DQ);
EDf = sin(fD * E);
HC = sin(fC * H);
melody = [QG,QBf,DQC,QG,QBf,EDf,HC,QG,QBf,DQC,QBf,QG]; %generate melody
sound(melody,1/deltat);
wavwrite(melody,1/deltat,'smokefast.wav'); %generate sound file
pause(10);
%2.
[beatles, Fs] = wavread('Beatles.wav');
beatles_rev = flipud(beatles);
sound(beatles_rev,Fs);
wavwrite(beatles_rev,Fs,'beatles_rev.wav');
www.projectrhea.org/rhea/images/7/7f/Smoke.wav
www.projectrhea.org/rhea/images/2/22/Smokefast.wav