(2 intermediate revisions by the same user not shown)
Line 28: Line 28:
 
%FAST SPEED
 
%FAST SPEED
 
delta = 0.00005;
 
delta = 0.00005;
half = [0:delta:1.0714*2];
+
half = [0:delta:1.0714*.5];
dottedquarter = [0:delta:0.8036*2];
+
dottedquarter = [0:delta:0.8036*.5];
quarter = [0:delta:0.5357*2];
+
quarter = [0:delta:0.5357*.5];
eighth = [0:delta:0.26785*2];
+
eighth = [0:delta:0.26785*.5];
  
 
%Notes used
 
%Notes used
Line 49: Line 49:
 
%HIGHER PITCH
 
%HIGHER PITCH
 
delta = 0.00005;
 
delta = 0.00005;
half = [0:delta:1.0714];
+
half = [0:delta:1.0714*.5];
dottedquarter = [0:delta:0.8036];
+
dottedquarter = [0:delta:0.8036*.5];
quarter = [0:delta:0.5357];
+
quarter = [0:delta:0.5357*.5];
eighth = [0:delta:0.26785];
+
eighth = [0:delta:0.26785*.5];
  
 
%Notes used
 
%Notes used
Line 66: Line 66:
 
sound(high_melody, 1/delta)
 
sound(high_melody, 1/delta)
 
wavwrite(high_melody, 1/delta, 32, 'higher.wav');
 
wavwrite(high_melody, 1/delta, 32, 'higher.wav');
pause(8)
+
pause(5)
  
 
%PART 2
 
%PART 2
Line 79: Line 79:
 
%sounds to me like "let me on the money", but I've read in the past people
 
%sounds to me like "let me on the money", but I've read in the past people
 
%think it says "turn me on dead man"
 
%think it says "turn me on dead man"
 
[[Media:regular.wav]]
 
[[Media:fast.wav]]
 
[[Media:higher.wav]]
 
[[Media:reverse.wav]]
 
 
</pre>
 
</pre>
 +
[[Media:regular.wav]]<br>
 +
[[Media:fast.wav]]<br>
 +
[[Media:higher1.wav]]<br>
 +
[[Media:reverse.wav]]<br>

Latest revision as of 13:30, 14 January 2011

%HW 1 ECE 301
%Jeff Gaines

%REGULAR SPEED
%beats/min = 112 -> quarter note = .5357 sec
delta = 0.00005;
half = [0:delta:1.0714];
dottedquarter = [0:delta:0.8036];
quarter = [0:delta:0.5357];
eighth = [0:delta:0.26785];

%Notes used
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
half_c = sin(2*pi*(2^(1/4)*440)*half);
half_g = sin(2*pi*(2^(-1/6)*440)*half);

%Note sequence (I made the last note a half G instead of quarter G since it
%sounds more like the song)
melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(melody, 1/delta)
wavwrite(melody, 1/delta, 32, 'regular.wav');
pause(8)

%FAST SPEED
delta = 0.00005;
half = [0:delta:1.0714*.5];
dottedquarter = [0:delta:0.8036*.5];
quarter = [0:delta:0.5357*.5];
eighth = [0:delta:0.26785*.5];

%Notes used
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
half_c = sin(2*pi*(2^(1/4)*440)*half);
half_g = sin(2*pi*(2^(-1/6)*440)*half);

%Note sequence
fast_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(fast_melody, 1/delta)
wavwrite(fast_melody, 1/delta, 32, 'fast.wav');
pause(5)

%HIGHER PITCH
delta = 0.00005;
half = [0:delta:1.0714*.5];
dottedquarter = [0:delta:0.8036*.5];
quarter = [0:delta:0.5357*.5];
eighth = [0:delta:0.26785*.5];

%Notes used
quarter_g = sin(4*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(4*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(4*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(4*pi*(2^(1/3)*440)*eighth);
half_c = sin(4*pi*(2^(1/4)*440)*half);
half_g = sin(4*pi*(2^(-1/6)*440)*half);

%Note sequence
high_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(high_melody, 1/delta)
wavwrite(high_melody, 1/delta, 32, 'higher.wav');
pause(5)

%PART 2
[beatles, fs, bits] = wavread('Beatles.wav');
sound(beatles, fs, bits)
pause(30)
%"number 9" over and over
reverse = flipud(beatles);
sound(reverse, fs, bits)
wavwrite(reverse, fs, 32, 'reverse.wav');
pause(30)
%sounds to me like "let me on the money", but I've read in the past people
%think it says "turn me on dead man"

Media:regular.wav
Media:fast.wav
Media:higher1.wav
Media:reverse.wav

Alumni Liaison

Have a piece of advice for Purdue students? Share it through Rhea!

Alumni Liaison