musiccreator
Class Chord

java.lang.Object
  extended by musiccreator.Chord
All Implemented Interfaces:
MusicXmlOutputable

public class Chord
extends java.lang.Object
implements MusicXmlOutputable

Implements the Chord class. A Chord is one unit of a song, and consists of a Beat (which defines its rhythm), and a ChordDef (which defines the musical notes in the chord).


Constructor Summary
Chord(Beat b, ChordDef cd)
          Creates a new instance of Chord.
 
Method Summary
 int getLength()
           
 int getNote(int index)
           
 boolean isDiatonic()
          Indicates if the chord is diatonic to the key.
 void outputToConsole()
          Outputs the chord to the console for debugging.
 void outputToMusicXml(java.io.PrintWriter out)
          Outputs a chord to MusicXML
static void setKey(Key k)
          Sets the key for all chords.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chord

public Chord(Beat b,
             ChordDef cd)
Creates a new instance of Chord.

Parameters:
b - Beat size of chord
cd - Chord definition of chord
Method Detail

setKey

public static void setKey(Key k)
Sets the key for all chords.

Parameters:
k - key to set chords to

outputToConsole

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


isDiatonic

public final boolean isDiatonic()
Indicates if the chord is diatonic to the key.

Returns:
True=diatonic, false=not diatonic

outputToMusicXml

public final void outputToMusicXml(java.io.PrintWriter out)
Outputs a chord to MusicXML

Specified by:
outputToMusicXml in interface MusicXmlOutputable

getLength

public int getLength()

size

public int size()

getNote

public int getNote(int index)