Assigned Date: Thursday, Mar. 29, 2006
Due Date: Friday, Apr. 14, 2006
Due Time: 11:55pm
Last modified on April 13, 2006, at 11:10 AM (see updates)
This assignment focuses on Linked Lists.
You are expected to work in isolation (without access to any resources other than the class textbook, class notes, and the instructor).
Write a program to manipulate MIDI files.
To do so you will use classes from jMusic. jMusic is an API for sound and music applications in Java.
First you need to set up jMusic on your computer.
Your program should be implemented using BlueJ. Create a project called,
Music. In that project create the following classes and methods:
public Song()-- initializes internal data structure
public void readMIDI(String fileName)-- inputs a MIDI file
public void writeMIDI(String fileName)-- outputs a MIDI file
public void setSong(Score score)-- converts a jMusic Score to a song
public Score getScore()-- converts song to a jMusic Score
public void addNote(ExtendedNote note)-- adds a note to the song
public void echo(double delay, int repeat)-- adds echo effect to song
public void reverb(int depth)-- adds reverb effect to song
public String toString()-- returns String representation of song
MusicMaker– the system driver
public static void main(String args)- declares necessary instances of classes and uses their methods to make some demo music.
You should use a linked list of notes to store the song.
This linked list should utilize class
Node (given in class).
info field of class
Node should be of class
ExtendedNote (to be provided).
Hint: To build your list, extract jMusic
Note's from the input MIDI file, and store them in increasing order of start time within
To find the
Note objects, you need to get the
Part objectss of the
Score, then get the
Phrase objects within each
Part, then get the
Note objects within each
Phrase, and finally wrap each
Note within an
ExtendedNote. Start time is found within each
public void play()-- plays song (Hint: use jMusic's Play class)
public void view()-- displays song (Hint: use jMusic's View class)
public void removeNote(ExtendedNote note)-- removes the first occurrance of
public Score randomScore(int numNotes)-- returns a Score of
numNotesnotes with random pitch, rhythm value, and start time.
Song effects (methods).
Demonstate your effects through
MusicMaker. For each effect, it should create (at least) one meaningfully named
.mid file. These files should be stored in the current directory (i.e., no "hardwired" path names).
MusicMaker should generate all demos at once (i.e., no editing required by instructor/grader).
Readme.txt document your extra work. No bonus if you omit this part!
Focus on functional cohesion, i.e., a method should implement only one bit of functionality. The smaller, the better.
Your methods should be fully documented via javadoc.
.jarfile is correct, by using the '
jar xvf file.jar' command, where
file.jaris your archive. Your
.jarfile should contain:
Readme.txt(see Widget for a sample).
In other words, I should be able to unzip your submission and run it without modifications or additions.
.jarfile to email@example.com, by the due date and time.
.midfiles demoing your effects. For example, attach
xis a descriptive name of the music stored in the MIDI file (e.g.,