musiccreator
Class ChordArray

java.lang.Object
  extended by musiccreator.ChordArray
All Implemented Interfaces:
MidiOutputable, MusicXmlOutputable

public class ChordArray
extends java.lang.Object
implements MusicXmlOutputable, MidiOutputable

Implements the ChordArray class, which is the actual array of chords in a song. This array is modeless; i.e., it has no key.


Constructor Summary
ChordArray()
          Creates a new instance of ChordArray
 
Method Summary
 void AddChord(Chord c)
          Adds a new chord to the end of the ChordArray
 void clear()
          Clears the song from memory.
 Chord getChord(int index)
          Get the chord at 'index'
 void outputToConsole()
          Outputs the chordarray to the console for debugging.
 void outputToMidi(javax.sound.midi.Track track)
          Outputs the song to a midi track specified by "track"
 void outputToMusicXml(java.io.PrintWriter out)
          Outputs the chordarray to MusicXML format
 void setTempo(int tempo)
          Set the tempo of the song in beats per minute
 void setTimeSignature(TimeSignature inTs)
          Set the time-signature of the ChordArray, used by OutputToMusicXML to know the number of beats per measure.
 int Size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChordArray

public ChordArray()
Creates a new instance of ChordArray

Method Detail

getChord

public Chord getChord(int index)
Get the chord at 'index'

Parameters:
index - the array index to find the chord
Returns:
the Chord at 'index'

AddChord

public void AddChord(Chord c)
Adds a new chord to the end of the ChordArray

Parameters:
c - the chord to add

Size

public int Size()
Returns:
Number of notes in the ChordArray.

setTimeSignature

public void setTimeSignature(TimeSignature inTs)
Set the time-signature of the ChordArray, used by OutputToMusicXML to know the number of beats per measure.

Parameters:
inTs - Time Signature to set

outputToConsole

public void outputToConsole()
Outputs the chordarray to the console for debugging.


outputToMusicXml

public void outputToMusicXml(java.io.PrintWriter out)
Outputs the chordarray to MusicXML format

Specified by:
outputToMusicXml in interface MusicXmlOutputable

clear

public void clear()
Clears the song from memory.


setTempo

public void setTempo(int tempo)
Set the tempo of the song in beats per minute

Parameters:
tempo -

outputToMidi

public void outputToMidi(javax.sound.midi.Track track)
Outputs the song to a midi track specified by "track"

Specified by:
outputToMidi in interface MidiOutputable
Parameters:
track -