Revision as of 18:03, 24 June 2009 by Mzulkifl (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

del = 0.0001;

% notes needed for the Super Mario theme song part. midA = 440; midC = midA*3/5; midE = 5/4*midC; midG = 3/2*midC; midB = 15/8*midC; lowG = midG/2; lowE = midE/2; lowA = midA/2; lowB = midB/2; sharpA = 16/15*midA; lowsharpA = sharpA/2;

%tempo t1 = 0:del:1; t2 = 0:del:0.5; t4 = 0:del:0.25; t8 = 0:del:0.125; t16 = 0:del:0.0625;

% E E E G C E G C Gl El Al Bl A# Al Emid1 = sin(2*pi*midE*t1); Emid2 = sin(2*pi*midE*t2); Emid4 = 1.1*sin(2*pi*midE*t4); Emid8 = .8*sin(2*pi*midE*t8); Emid16 = .8*sin(2*pi*midE*t16);

Gmid1 = sin(2*pi*midG*t1); Gmid2 = sin(2*pi*midG*t2); Gmid4 = sin(2*pi*midG*t4); Gmid8 = sin(2*pi*midG*t8);

Cmid = sin(2*pi*midC*t4);

Glow = sin(2*pi*lowG*t4); Elow = sin(2*pi*lowE*t4);

Blow = sin(2*pi*lowB*t4); Alow = sin(2*pi*lowA*t4); Alowsharp = sin(2*pi*lowsharpA*t4);

beat = 0*sin(2*pi*midC*t16);

song = [ Emid8 Emid4 Emid8 Gmid4 Cmid Emid8 Gmid4 Cmid Glow Elow Alow Blow Alowsharp Alow ]; sound(song,1/del)

% it's not perfect like the original Mario song (that can be found at MATLAB's website), but it's close. --Mzulkifl 23:03, 24 June 2009 (UTC)

Alumni Liaison

Questions/answers with a recent ECE grad

Ryne Rayburn