uk.org.toot.music.tonality
Class Chord

java.lang.Object
  extended by uk.org.toot.music.tonality.Chord

public class Chord
extends java.lang.Object

An immutable Chord. No mutators.


Nested Class Summary
static class Chord.AbstractProgression
           
static class Chord.CountdownProgression
           
static class Chord.I_bIII_bVI_bII_TurnAround
           
static class Chord.ii_V7_I_I_Progression
           
static class Chord.PitchedVoicing
          A PitchedVoicing is an aggregation of a Voicing and a root pitch.
static interface Chord.Progression
          A Progression is a list of chords, each with their offset to a nominal root.
static class Chord.RelativeVoicing
           
static class Chord.Voicing
          A Chord.Voicing is an aggregation of a theoretical root position (i.e uninverted) Chord with all voicing information such as missing intervals and (one day) octave transpositions of present intervals.
 
Constructor Summary
Chord(java.lang.String aSymbol, java.lang.String aSpelling, java.lang.String aName)
           
 
Method Summary
 int[] getIntervals()
          Get the intervals
 java.lang.String getName()
          Get the name.
 int getPoly()
          Get the polyphony
 java.lang.String getSpelling()
          Get the spelling.
 java.lang.String getSymbol()
          Get the symbol.
 boolean matchesChordMode(int[] chordMode)
          Return whether every interval of this chord is contained within the chordMode
 boolean matchesIntervals(int[] someIntervals)
          Return true if someIntervals exactly matches our intervals.
 int[] missingIntervals(int[] someIntervals, int missing)
          Returns an array of missing interval indices if someIntervals matches our intervals with exactly missing intervals missing.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chord

public Chord(java.lang.String aSymbol,
             java.lang.String aSpelling,
             java.lang.String aName)
Method Detail

getSymbol

public java.lang.String getSymbol()
Get the symbol.

Returns:
the symbol e.g. "maj7"

getSpelling

public java.lang.String getSpelling()
Get the spelling.

Returns:
the spelling e.g. "1 3 5 7"

getName

public java.lang.String getName()
Get the name.

Returns:
the name e.g. "major seventh"

getIntervals

public int[] getIntervals()
Get the intervals

Returns:
the array of ints representing the intervals

getPoly

public int getPoly()
Get the polyphony

Returns:
the number of intervals (including UNISON)

matchesIntervals

public boolean matchesIntervals(int[] someIntervals)
Return true if someIntervals exactly matches our intervals.

Parameters:
someIntervals - the intervals to match to our intervals
Returns:
boolean true if exact match, false otherwise

missingIntervals

public int[] missingIntervals(int[] someIntervals,
                              int missing)
Returns an array of missing interval indices if someIntervals matches our intervals with exactly missing intervals missing. missing should equal 0, 1 or 2. returns null if not that exact number of missing intervals

Returns:
int[] the array of missing interval indices or null if no match

matchesChordMode

public boolean matchesChordMode(int[] chordMode)
Return whether every interval of this chord is contained within the chordMode

Parameters:
chordMode - the chord mode to match
Returns:
true if every interval of this Chord matches the chord mode

toString

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


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.