Music in MATLAB:
A Series of Programming Challenges

ENGR 121 Introduction to Computer Tools - Spring 2008

Music Challenge
Resources
Rubric
  
Some General Resources

1
Simple Song
Introduction to Music in MATLAB
Examples:  tone1.m          song1a.m
R1
Musical Harmonies &
Musical Analysis and Synthesis in Matlab,  
Mark Peterson (University of Colorado)
  Musical Harmonies (.pdf)
  Musical Analysis and Synthesis in Matlab (.pdf)
  Web page of Resources

2
With a pseudo square wave makesquare2.m
R2

3
Eight-note player

R3

4
Subfunction: note2freq


Physics of Music Notes
Bryan Suits (Michigan Tech)
  Main Page
  Make your Own Wind Chime


5
Music Player
see previous challenges (particularly 3)
see example music text files below
R5

6
Music Distortoer
wav files
R6

7
Final Challenge
See:  General Resources in Right Column
          chordplay.m below
         Mastodon Music Muncher below (or when
           in ET 311 or  315 type M3 in MATLAB).
See handout
Frequency Chart for the Equal Tempered Scale
(adapted from B. Suits)

8





chordplay.m:   A MATLAB script that illustrates the several music issues particular related to programming chords
Mastodon Music Muncher:  A GUI program for illustrating sound generation, analysis, and processing (under development)

S. Scott Moor, Ph.D., P.E.
Department of Engineering
Indiana University Purdue University Fort Wayne


Sample .wav-files
Music Text Files
Mastodon Music Muncher (under development)

Jim Cary from “Liar, Liar”

Voice

Single Piano Note

Single Note

Electronic song

Melody

Twinkle Twinkle

Melody

Fourier Transform

Voice

Weird

Weird

Bird

Sound Recording

Circus

Song Recording

Handel

Song Recording

Jingle Bells   

Star Wars Theme

Frere Jaque

These files contain three columns the first is the note name the second is the note amplitude and the third is the notes duration in seconds. 

This GUI interface includes:
    a keyboard for generating notes,
    a player to play/graph some .wav files &
    a sound analyzer and distortorer.

Download the zip file and unpack it into your
Matlab work directory.  To run simply type M3 at the command prompt.

Return to Top