uk.org.toot.music.tonality
Class Interval

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

public class Interval
extends java.lang.Object

This class provides static methods to simplify the handling of intervals (which are just ints). An interval is the number of semitones between two pitches and is fundamental to the definition of Scales and Chords. Symbolic constants are provided for intervals of up to one octave.

Author:
st

Field Summary
static int AUGMENTED_FIFTH
           
static int AUGMENTED_FOURTH
           
static int DIMINISHED_FIFTH
           
static int DIMINISHED_SEVENTH
           
static int MAJOR_SECOND
           
static int MAJOR_SEVENTH
           
static int MAJOR_SIXTH
           
static int MAJOR_THIRD
           
static int MINOR_SECOND
           
static int MINOR_SEVENTH
           
static int MINOR_SIXTH
           
static int MINOR_THIRD
           
static int OCTAVE
           
static int PERFECT_FIFTH
           
static int PERFECT_FOURTH
           
static int UNISON
           
 
Method Summary
static int classValue(int interval)
          Return the interval class for an interval.
static java.lang.String name(int interval)
          Return the traditional name for an interval.
static java.lang.String spell(int interval)
          Return a jazz type representation of an interval of up to two octaves.
static java.lang.String spell(int[] intervals)
          Return a jazz type representation of an array of intervals of up to two octaves.
static int spelt(java.lang.String s)
          Return an interval of up to two octaves corresponding to the jazz type spelling.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNISON

public static final int UNISON
See Also:
Constant Field Values

MINOR_SECOND

public static final int MINOR_SECOND
See Also:
Constant Field Values

MAJOR_SECOND

public static final int MAJOR_SECOND
See Also:
Constant Field Values

MINOR_THIRD

public static final int MINOR_THIRD
See Also:
Constant Field Values

MAJOR_THIRD

public static final int MAJOR_THIRD
See Also:
Constant Field Values

PERFECT_FOURTH

public static final int PERFECT_FOURTH
See Also:
Constant Field Values

AUGMENTED_FOURTH

public static final int AUGMENTED_FOURTH
See Also:
Constant Field Values

DIMINISHED_FIFTH

public static final int DIMINISHED_FIFTH
See Also:
Constant Field Values

PERFECT_FIFTH

public static final int PERFECT_FIFTH
See Also:
Constant Field Values

AUGMENTED_FIFTH

public static final int AUGMENTED_FIFTH
See Also:
Constant Field Values

MINOR_SIXTH

public static final int MINOR_SIXTH
See Also:
Constant Field Values

MAJOR_SIXTH

public static final int MAJOR_SIXTH
See Also:
Constant Field Values

DIMINISHED_SEVENTH

public static final int DIMINISHED_SEVENTH
See Also:
Constant Field Values

MINOR_SEVENTH

public static final int MINOR_SEVENTH
See Also:
Constant Field Values

MAJOR_SEVENTH

public static final int MAJOR_SEVENTH
See Also:
Constant Field Values

OCTAVE

public static final int OCTAVE
See Also:
Constant Field Values
Method Detail

classValue

public static int classValue(int interval)
Return the interval class for an interval.

Parameters:
interval - the interval
Returns:
the interval class

name

public static java.lang.String name(int interval)
Return the traditional name for an interval.

Parameters:
interval -
Returns:
the traditional name from Unison to Octave.

spell

public static java.lang.String spell(int interval)
Return a jazz type representation of an interval of up to two octaves. This is typically used to spell chord intervals which are up to two octaves using tertiary construction.

Parameters:
interval -
Returns:
the 'jazz' spelling of the interval

spell

public static java.lang.String spell(int[] intervals)
Return a jazz type representation of an array of intervals of up to two octaves.

Parameters:
intervals - the array of intervals
Returns:
the jazz spelling of the the intervals

spelt

public static int spelt(java.lang.String s)
Return an interval of up to two octaves corresponding to the jazz type spelling.

Parameters:
s - the spelling
Returns:
the interval


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