%Chris Romanoff %ECE301, Prof. Boutin, MWF 2:30 %HW1

%PART 1

delta=.00005; tempo=112; %the tempo of the song whole=tempo/60; %the length of a whole note with tempo=112 bpm half=0:delta:whole/2;%half note length quarter=0:delta:whole/4;%quarter note length eighth=0:delta:whole/8;%eighth note length dotted=0:delta:1.5*(whole/4);%dotted quarter length, 1.5 times quarter %Notes G=sin(2*pi*(2^(-2/12)*440)*quarter); Bflat=sin(2*pi*(2^(1/12)*440)*quarter); Cdot=sin(2*pi*(2^(3/12)*440)*dotted); C=sin(2*pi*(2^(3/12)*440)*half); Dflat=sin(2*pi*(2^(4/12)*440)*eighth);

smoke=[G,Bflat,Cdot,G,Bflat,Dflat,C,G,Bflat,Cdot,Bflat,G];

sound(smoke,1/delta);%Plays the song wavwrite(smoke,1/delta,32,'smoke_normal');%saves the song as a file pause(8)

tempo=112/2;%changes the tempo whole=tempo/60; %the length of a whole note with tempo=112 bpm half=0:delta:whole/2;%half note length quarter=0:delta:whole/4;%quarter note length eighth=0:delta:whole/8;%eighth note length dotted=0:delta:1.5*(whole/4);%dotted quarter length, 1.5 times quarter %Notes G=sin(2*pi*(2^(-2/12)*440)*quarter); Bflat=sin(2*pi*(2^(1/12)*440)*quarter); Cdot=sin(2*pi*(2^(3/12)*440)*dotted); C=sin(2*pi*(2^(3/12)*440)*half); Dflat=sin(2*pi*(2^(4/12)*440)*eighth);

smoke=[G,Bflat,Cdot,G,Bflat,Dflat,C,G,Bflat,Cdot,Bflat,G];

sound(smoke,1/delta);%plays song but twice as fast since the tempo was changed wavwrite(smoke,1/delta,32,'smoke_fast'); pause(5)

tempo=112; %resets the tempo

whole=tempo/60; %the length of a whole note half=0:delta:whole/2;%half note length quarter=0:delta:whole/4;%quarter note length eighth=0:delta:whole/8;%eighth note length dotted=0:delta:1.5*(whole/4);%dotted quarter length, 1.5 times quarter %Notes at higher frequency G=sin(4*pi*(2^(-2/12)*440)*quarter);%4*pi instead of 2*pi to change freq. Bflat=sin(4*pi*(2^(1/12)*440)*quarter); Cdot=sin(4*pi*(2^(3/12)*440)*dotted); C=sin(4*pi*(2^(3/12)*440)*half); Dflat=sin(4*pi*(2^(4/12)*440)*eighth);

smoke=[G,Bflat,Cdot,G,Bflat,Dflat,C,G,Bflat,Cdot,Bflat,G];

sound(smoke,1/delta);%plays song but with the pitch changed wavwrite(smoke,1/delta,32,'smoke_higher'); pause(5)

%PART 2 [beatles,fs]=wavread('Beatles.wav'); sound(beatles,fs);%plays file forwards pause(5)

backwards=flipud(beatles); sound(backwards,fs);%plays file reversed wavwrite(backwards,fs,'beatles_backwards'); pause(5)

%Forwards it says 'Number 9' %Backwards it sounds like 'turn me on deadmen' or something

Media:smoke_normal.wav

Media:smoke_fast.wav

Media:smoke_higher.wav

Media:beatles_backwards.wav

Alumni Liaison

EISL lab graduate

Mu Qiao