jazz.core
Class Chord

java.lang.Object
  |
  +--jazz.core.Chord
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChordChange

public class Chord
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.util.Vector pitches
           
static int QUAL_EXT_ELEVENTH_REG
           
static int QUAL_EXT_ELEVENTH_SHARP
           
static int QUAL_EXT_NINTH_FLAT
           
static int QUAL_EXT_NINTH_REG
           
static int QUAL_EXT_NINTH_SHARP
           
static int QUAL_EXT_THIRTEENTH_FLAT
           
static int QUAL_EXT_THIRTEENTH_REG
           
static int QUAL_EXT_UNKNOWN
           
static int QUAL_FIFTH_AUG
           
static int QUAL_FIFTH_DIM
           
static int QUAL_FIFTH_REG
           
static int QUAL_FIFTH_UNKNOWN
           
static int QUAL_GEN_DOM_SEVENTH
           
static int QUAL_GEN_MAJ_SEVENTH
           
static int QUAL_GEN_MIN_MAJ_SEVENTH
           
static int QUAL_GEN_MIN_SEVENTH
           
static int QUAL_GEN_UNKNOWN
           
 
Constructor Summary
Chord()
           
Chord(Chord c)
           
Chord(Chord c, int root)
           
Chord(Chord c, Pitch root)
           
 
Method Summary
 int addChordPitch(ChordPitch cp)
          Add a pitch to a given chord in the appropriate place
 ChordPitch chordPitchAt(int i)
          Return the pitch at a given index in the chord Note that the first 4 pitches are the 1, 3, 5, 7 (in that order)
 java.lang.Object clone()
           
 int findDissonanceOf(int pitchNumber)
          Find the dissonance of a given pitch
 int getExtensions()
          Return a bit vector of extensions
 java.lang.String getFullName()
          Get the full name of the chord as a string Functionally, the full name is (root + general quality + extensions)
 int getFullQuality()
          Return the full quality of a chord
 int getGeneralQuality()
          Return a bit vector indicating major / minor / dominant quality and type of fifth
 ChordPitch getRoot()
          Return the root (the first pitch) for a given chord
 int halfStepsFromRoot(ChordPitch cp)
           
 int halfStepsFromRoot(int pitchNumber)
           
 int halfStepsFromRoot(Pitch p)
          Return the number of half steps (between 0 and 11) between a pitch and the root of the chord
static java.lang.String qualityToString(int quality)
          Return a String for a given chord quality
 void remChordPitch(int pitchNum)
          Remove a chord from a pitch.
 int size()
          Return the number of pitches currently in the chord
 java.lang.String toString()
           
 void transpose(int halfSteps)
          Transpose a chord by a given number of half steps
 void transpose(Pitch pitch)
          Transpose a chord to have a new pitch as it's root
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUAL_GEN_UNKNOWN

public static int QUAL_GEN_UNKNOWN

QUAL_GEN_MAJ_SEVENTH

public static int QUAL_GEN_MAJ_SEVENTH

QUAL_GEN_DOM_SEVENTH

public static int QUAL_GEN_DOM_SEVENTH

QUAL_GEN_MIN_SEVENTH

public static int QUAL_GEN_MIN_SEVENTH

QUAL_GEN_MIN_MAJ_SEVENTH

public static int QUAL_GEN_MIN_MAJ_SEVENTH

QUAL_FIFTH_REG

public static int QUAL_FIFTH_REG

QUAL_FIFTH_AUG

public static int QUAL_FIFTH_AUG

QUAL_FIFTH_DIM

public static int QUAL_FIFTH_DIM

QUAL_FIFTH_UNKNOWN

public static int QUAL_FIFTH_UNKNOWN

QUAL_EXT_NINTH_REG

public static int QUAL_EXT_NINTH_REG

QUAL_EXT_NINTH_FLAT

public static int QUAL_EXT_NINTH_FLAT

QUAL_EXT_NINTH_SHARP

public static int QUAL_EXT_NINTH_SHARP

QUAL_EXT_ELEVENTH_REG

public static int QUAL_EXT_ELEVENTH_REG

QUAL_EXT_ELEVENTH_SHARP

public static int QUAL_EXT_ELEVENTH_SHARP

QUAL_EXT_THIRTEENTH_REG

public static int QUAL_EXT_THIRTEENTH_REG

QUAL_EXT_THIRTEENTH_FLAT

public static int QUAL_EXT_THIRTEENTH_FLAT

QUAL_EXT_UNKNOWN

public static int QUAL_EXT_UNKNOWN

pitches

protected java.util.Vector pitches
Constructor Detail

Chord

public Chord()

Chord

public Chord(Chord c)

Chord

public Chord(Chord c,
             int root)

Chord

public Chord(Chord c,
             Pitch root)
Method Detail

size

public int size()
Return the number of pitches currently in the chord

chordPitchAt

public ChordPitch chordPitchAt(int i)
Return the pitch at a given index in the chord Note that the first 4 pitches are the 1, 3, 5, 7 (in that order)

getRoot

public ChordPitch getRoot()
Return the root (the first pitch) for a given chord

transpose

public void transpose(Pitch pitch)
Transpose a chord to have a new pitch as it's root

transpose

public void transpose(int halfSteps)
Transpose a chord by a given number of half steps

getGeneralQuality

public int getGeneralQuality()
Return a bit vector indicating major / minor / dominant quality and type of fifth

getExtensions

public int getExtensions()
Return a bit vector of extensions

getFullQuality

public int getFullQuality()
Return the full quality of a chord

getFullName

public java.lang.String getFullName()
Get the full name of the chord as a string Functionally, the full name is (root + general quality + extensions)

remChordPitch

public void remChordPitch(int pitchNum)
Remove a chord from a pitch. Note: we can only remove extensions.

addChordPitch

public int addChordPitch(ChordPitch cp)
Add a pitch to a given chord in the appropriate place

findDissonanceOf

public int findDissonanceOf(int pitchNumber)
Find the dissonance of a given pitch

halfStepsFromRoot

public int halfStepsFromRoot(Pitch p)
Return the number of half steps (between 0 and 11) between a pitch and the root of the chord

halfStepsFromRoot

public int halfStepsFromRoot(ChordPitch cp)

halfStepsFromRoot

public int halfStepsFromRoot(int pitchNumber)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

qualityToString

public static java.lang.String qualityToString(int quality)
Return a String for a given chord quality