ECE301 Summer09 Hw01 Problem 4 Name:Yicheng Guo
A=440; UA=A*2 C=A*3/5 UC=C*2 E=C*5/4; UE=E*2 G=C*3/2 UG=G*2 B=15*C/8; UE=B*2 LG=G/2; LE=E/2; LA=A/2 LB=B/2;
DELTA = 0.0001; t8 = 0:DELTA:.5/2;
t4 =0:DELTA:1/2;
t2 = 0:DELTA:2/2; t16 = 0:DELTA:.25/2; tdot8 = 0:DELTA:.5*1.5/2; y1 = sin(2*pi*UE*t16); %a high E related to middle C through table 1 then doubled to for 1 higher octave. This is held for the same duration as a 16th note %E sound(y1,1/DELTA);%plays a E note in the 5th octave y1 = sin(2*pi*UE*t8); %E sound(y1,1/DELTA); y1 = sin(2*pi*UE*t16); %E sound(y1,1/DELTA); y1 = sin(2*pi*0*t16); %rest 16 sound(y1,1/DELTA); y1 = sin(2*pi*UC*t16); %C sound(y1,1/DELTA); y1 = sin(2*pi*UE*t8); %E sound(y1,1/DELTA); y1 = sin(2*pi*UG*t4); %G sound(y1,1/DELTA); y1 = sin(2*pi*0*t4); %rest4 sound(y1,1/DELTA); y1 = sin(2*pi*UC*tdot8); %C sound(y1,1/DELTA); y1 = sin(2*pi*G*t16); %G sound(y1,1/DELTA); y1 = sin(2*pi*0*t8); %when sin(0) y1=0 and no sound will play for a rest %rest 8 sound(y1,1/DELTA); y1 = sin(2*pi*E*t8); %E sound(y1,1/DELTA); y1 = sin(2*pi*0*t16); %rest 16 sound(y1,1/DELTA); y1 = sin(2*pi*A*t8); %A sound(y1,1/DELTA); y1 = sin(2*pi*B*t16); %B sound(y1,1/DELTA); y1 = sin(2*pi*0*t16); %rest 16 sound(y1,1/DELTA); y1 = sin(2*pi*A*t8); %A 8 sound(y1,1/DELTA);