% William Schmidt
% ECE 301 HW1


%Define note frequencies
Eb = 311.13;
F = 349.23;
G = 392;
Ab = 415.30;
Bb = 466.16;
C = 523.25;
Db = 554.37;
B = 493.66;

rest = 0;

%Define notes and tempo
samples = 20000;
bps = 60/120;
q = bps;
h = 2*q;
dq = 1.5*q;
e = .5*q;

notes = [Eb, F G Ab Bb C C Db Db Db Ab Bb B C];
beats = [h q q dq e q q q e e q e e h]


%Full tempo
for i= 1:length(notes)
    t = 0:1/samples:beats(i);
    y = sin(2*pi*notes(i)*t);
    sound(y,samples);
end


%half tempo
for i= 1:length(notes)
    t = 0:1/samples:.5*beats(i);
    y = sin(2*pi*notes(i)*t);
    sound(y,samples);
end

%up an octave
for i= 1:length(notes)
    t = 0:1/samples:beats(i);
    y = sin(4*pi*notes(i)*t);
    sound(y,samples);
end


    

Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett