jm.music.tools

## Class PhraseAnalysis

- java.lang.Object
- - jm.music.tools.PhraseAnalysis

-     public final class PhraseAnalysis
      extends java.lang.Object

  Provides class methods which return statistics about a `Phrase` or `Note` array. For each statistic there are two methods, accepting either a Phrase or a Note array as a parameter.

  This class also provides the constants used when generating those statistics.

  The methods are grouped under the following categories:

  1. Bulk Statistics:
     Methods that call multiple other methods, and return their statistics in one group. They never generate any new statistics themselves; every value in the group can be accessed individually using the other methods in this class. The method `getAllStatistics` is the only bulk statistic; it returns all the feature statistics.
  2. Feature Statistics:
     Methods that return double values in the range of 0 to 1. Usually these take the form of a percentage measuring the degree to which the feature is present, compared with the maximum value possible for the feature.
     Many feature statistics rely on the accessory statistics to generate values used in their calculations.
  3. Accessory Statistics:
     Methods that return more direct statistics, such as the number of distinct pitches in a melody. These are generally more useful than the feature statistics. All of the accessory statistics are used by at least one of the feature statistics.

The bulk statistics include:

- `getAllStatistics(jm.music.data.Phrase, double, int, int[])`

The feature statistics include:

- `noteDensity(jm.music.data.Phrase, double)`
- `pitchVariety(jm.music.data.Phrase)`
- `rhythmicVariety(jm.music.data.Phrase)`
- `climaxStrength(jm.music.data.Phrase)`
- `restDensity(jm.music.data.Phrase, double)`
- `tonalDeviation(jm.music.data.Phrase, double, int, int[])`
- `keyCenteredness(jm.music.data.Phrase, double, int)`
- `pitchRangePerSpan(jm.music.data.Phrase)`
- `rhythmRangePerSpan(jm.music.data.Phrase)`
- `repeatedPitchDensity(jm.music.data.Phrase)`
- `repeatedRhythmicValueDensity(jm.music.data.Phrase)`
- `melodicDirectionStability(jm.music.data.Phrase)`
- `overallPitchDirection(jm.music.data.Phrase)`
- `movementByStep(jm.music.data.Phrase, int, int[])`
- `dissonance(jm.music.data.Phrase)`
- `leapCompensation(jm.music.data.Phrase)`
- `syncopation(jm.music.data.Phrase)`
- `repeatedPitchPatterns(jm.music.data.Phrase, int)`
- `repeatedRhythmPatterns(jm.music.data.Phrase, int)`
- `climaxPosition(jm.music.data.Phrase)`
- `climaxTonality(jm.music.data.Phrase, int, int[])`

The accessory statistics include:

- Everything else.

For clarification, here are definitions of terms used in the method descriptions.

Note

Unless otherwise specified the term 'note' or 'notes' do not include rests. This does not apply to the JMusic object Note, which will always be capitalised.

Quantum duration

For a quantised melody, all rhythm values in the melody must be multiples of the quantum duration. A note which has a rhythm value four times the quantum duration can be described as being four quanta long.

Since:
  jMusic November 2000 Release
See Also:
  `Phrase`, `Note`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BIG_JUMP_INTERVAL` Integer defining the smallest interval, measured in semitones, that constitutes a 'big jump'.
    `static int` | `FEATURE_COUNT` Integer constant describing the number of statistical features returned by the `getAllStatistics` methods.
    `static java.lang.String[]` | `featureNames` Array of Strings giving the identifier number and descriptive name of each feature as returned by the `getAllStatistics` methods.
    `static int` | `INTERVAL_WITH_REST` Used by the `pitchIntervals(jm.music.data.Phrase)` method to indicate an interval with one or more rests between its notes.
    `static int[]` | `MAJOR_SCALE` Integer array containing the pitches representing a major scale.
    `static int` | `MAX_DISTINCT_RHYTHMS` Integer defining the maximum number of distinct rhythm values that can appear in the melody.
    `static int` | `MAX_PITCH_RANGE` Integer constant describing the maximum pitch range that a reasonable melody can span, measured in semitones.
    `static double` | `MAX_RHYTHM_RANGE` Double constant describing the maximum rhythm range that a reasonable could utilise.
    `static int[]` | `MINOR_SCALE` Integer array containing the pitches representing a minor scale.
    `static double` | `NOTELIST_EXCEPTION_CONSTANT`
    `static java.lang.String` | `NOTELIST_EXCEPTION_STRING`
    `static int[]` | `PRIMARY_NOTES` Integer array containing the pitches that represent primary pitches.
    `static double` | `QUANTISATION_EXCEPTION_CONSTANT`
    `static java.lang.String` | `QUANTISATION_EXCEPTION_STRING`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `bigJumpCount(Note[] noteArray)` Returns the number of big jumps in the specified Note array.
    `static int` | `bigJumpCount(Phrase phrase)` Returns the number of big jumps in the specified Phrase.
    `static int` | `bigJumpFollowedByStepBackCount(Note[] noteArray)` Returns the number of big jumps followed by a step back in the specified Note array.
    `static int` | `bigJumpFollowedByStepBackCount(Phrase phrase)` Returns the number of big jumps followed by a step back in the specified Phrase.
    `static double` | `climaxPosition(Note[] noteArray)` Returns a double representing where the climax of the melody starts.
    `static double` | `climaxPosition(Phrase phrase)` Returns a double representing where the climax of the melody starts.
    `static double` | `climaxStrength(Note[] noteArray)` Returns a double expressing the inverse of the count of the number of notes sharing the highest pitch in the specified Note array.
    `static double` | `climaxStrength(Phrase phrase)` Returns a double expressing the inverse of the count of the number of notes sharing the highest pitch in the specified Phrase.
    `static double` | `climaxTonality(Note[] noteArray, int tonic, int[] scale)` Returns a double rating the tonality of the specified Note array.
    `static double` | `climaxTonality(Phrase phrase, int tonic, int[] scale)` Returns a double rating the tonality of the specified Phrase.
    `static int` | `consecutiveIdenticalPitches(Note[] noteArray)` Returns the count of intervals whose size is 0 semitones in the specified Note array.
    `static int` | `consecutiveIdenticalPitches(Phrase phrase)` Returns the count of intervals whose size is 0 semitones in the specified Phrase.
    `static int` | `consecutiveIdenticalRhythms(Note[] noteArray)` Returns the count of intervals between notes of the same rhythm value in the specified Note array.
    `static int` | `consecutiveIdenticalRhythms(Phrase phrase)` Returns the count of intervals between Notes of the same rhythm value in the specified Phrase.
    `static double` | `dissonance(Note[] noteArray)` Returns a double expressing the average dissonance rating of all intervals in the specified Note array.
    `static double` | `dissonance(Phrase phrase)` Returns a double expressing the average dissonance rating of all intervals in the specified Phrase.
    `static int` | `distinctPitchCount(Note[] noteArray)` Returns the number of pitches that appear at least once in a specified `Note` array.
    `static int` | `distinctPitchCount(Phrase phrase)` Returns the number of pitches that appear at least once in a specified `Phrase`.
    `static int` | `distinctRhythmCount(Note[] noteArray)` Returns the number of rhythms that appear at least once in a specified `Note` array.
    `static int` | `distinctRhythmCount(Phrase phrase)` Returns the number of rhythms that appear at least once in a specified `Phrase`.
    `static java.util.Hashtable` | `getAllStatistics(Note[] noteList, double duration, int tonic, int[] scale)` Returns a `Hashtable` containing all the feature statistics.
    `static java.util.Hashtable` | `getAllStatistics(Phrase phrase, double duration, int tonic, int[] scale)` Returns a `Hashtable` containing all the feature statistics.
    `static double[]` | `getAllStatisticsAsDoubles(Note[] noteArray, double duration, int tonic, int[] scale)`
    `static double[]` | `getAllStatisticsAsDoubles(Phrase phrase, double duration, int tonic, int[] scale)`
    `static java.lang.String[]` | `getAllStatisticsAsStrings(Note[] noteArray, double duration, int tonic, int[] scale)`
    `static java.lang.String[]` | `getAllStatisticsAsStrings(Phrase phrase, double duration, int tonic, int[] scale)`
    `static int` | `intervalCount(Note[] noteArray)` Returns a count of the number of note to next note intervals in the specified Phrase.
    `static int` | `intervalCount(Phrase phrase)` Returns a count of the number of note to next note intervals in the specified Phrase.
    `static int` | `intervalSemitoneCount(Note[] noteArray)` Returns the sum of the absolute sizes of all intervals in the specified Note array.
    `static int` | `intervalSemitoneCount(Phrase phrase)` Returns the sum of the absolute sizes of all intervals in the specified Phrase.
    `static boolean` | `isQuantised(Note[] noteArray, double duration)` Tests an array of `Notes` to see if they are quantised.
    `static boolean` | `isQuantised(Phrase phrase, double duration)` Tests whether a `Phrase` is quantised.
    `static boolean` | `isScale(Note note, int tonic, int[] scale)`
    `static double` | `keyCenteredness(Note[] noteArray, double duration, int tonic)` Returns a double expressing the total duration of all primary notes, over the length of the melody.
    `static double` | `keyCenteredness(Phrase phrase, double duration, int tonic)` Returns a double expressing the total duration of all primary notes, over the length of the melody.
    `static double` | `leapCompensation(Note[] noteArray)` Returns a double expressing the ratio of 'large leaps' that are not followed by an interval in the opposite direction that is no greater than the leap in the specified Note array.
    `static double` | `leapCompensation(Phrase phrase)` Returns a double expressing the ratio of 'large leaps' that are not followed by an interval in the opposite direction that is no greater than the leap in the specified Phrase.
    `static double` | `melodicDirectionStability(Note[] noteArray)` Returns a double expressing the ratio between the number of consecutive pitch steps in the same direction and the total number of steps in the specified Note array.
    `static double` | `melodicDirectionStability(Phrase phrase)` Returns a double expressing the ratio between the number of consecutive pitch steps in the same direction and the total number of steps in the specified Phrase.
    `static double` | `movementByStep(Note[] noteArray, int tonic, int[] scale)` Returns a double expressing the ratio between the number of pitch movements by diatonic step over the total number of steps in the specified Note array.
    `static double` | `movementByStep(Phrase phrase, int tonic, int[] scale)` Returns a double expressing the ratio between the number of pitch movements by diatonic step over the total number of steps in the specified Phrase.
    `static int` | `nonScaleQuantumCount(Note[] noteArray, double duration, int tonic, int[] scale)` Returns the count of the quanta taken up by non-scale notes in the specified Note array.
    `static int` | `nonScaleQuantumCount(Phrase phrase, double duration, int tonic, int[] scale)` Returns the count of the quanta taken up by non-scale notes in the specified Phrase.
    `static int` | `noteCount(Note[] noteArray)` Returns the number of notes in a specified `Note` array.
    `static int` | `noteCount(Phrase phrase)` Returns the number of notes in a specified `Phrase`.
    `static double` | `noteDensity(Note[] noteArray, double duration)` Returns a double expressing the the number of notes per quanta in a `Note` array.
    `static double` | `noteDensity(Phrase phrase, double duration)` Returns a double expressing the the number of notes per quanta in a `Phrase`.
    `static double` | `overallPitchDirection(Note[] noteArray)` Returns a double expressing the ratio between the sum of rising intervals over the sum of all intervals in the specified Note array.
    `static double` | `overallPitchDirection(Phrase phrase)` Returns a double expressing the ratio between the sum of rising intervals over the sum of all intervals in the specified Phrase.
    `static int[]` | `pitchIntervals(Note[] noteArray)` Returns an array of integers describing the size of intervals between the notes in the specified `Note` array.
    `static int[]` | `pitchIntervals(Phrase phrase)` Returns an array of integers describing the size of intervals between the notes in the specified `Phrase`.
    `static int` | `pitchPatternCount(Note[] noteArray, int chunkSize)` Returns the number of 'pitch interval' patterns of size `chunksize` in the specified Note array.
    `static int` | `pitchPatternCount(Phrase phrase, int chunkSize)` Returns the number of 'pitch interval' patterns of size `chunksize` in the specified Phrase.
    `static int` | `pitchRange(Note[] noteArray)` Returns the difference between the highest and lowest pitches in the specified `Note` array.
    `static int` | `pitchRange(Phrase phrase)` Returns the difference between the highest and lowest pitches in the specified `Phrase`.
    `static double` | `pitchRangePerSpan(Note[] noteArray)` Returns a double expressing the ratio between the pitch range of the specified Note array and `MAX_PITCH_RANGE`.
    `static double` | `pitchRangePerSpan(Phrase phrase)` Returns a double expressing the ratio between the pitch range of the specified phrase and `MAX_PITCH_RANGE`.
    `static int` | `pitchToDegree(int pitch, int tonic)`
    `static double` | `pitchVariety(Note[] noteArray)` Returns a double expressing the ratio between the number of distinct pitches and the total number of notes in the specified `Note` array.
    `static double` | `pitchVariety(Phrase phrase)` Returns a double expressing the number of distinct pitches per note in the `Phrase`.
    `static int` | `primaryQuantumCount(Note[] noteArray, double duration, int tonic)` Returns the count of the quanta taken up by 'primary notes' in the specified Note array.
    `static int` | `primaryQuantumCount(Phrase phrase, double duration, int tonic)` Returns the count of the quanta taken up by 'primary notes' in the specified Phrase.
    `static int` | `quantumCount(Note[] noteArray, double duration)` Returns the number of quanta in a specified `Note` array.
    `static int` | `quantumCount(Phrase phrase, double duration)` Returns the number of quanta in a specified `Phrase`.
    `static int` | `removeRestMarker(int interval)` Removes the rest marker, if any, from integer which conform to the values returned by `pitchIntervals(jm.music.data.Phrase)`.
    `static double` | `repeatedPitchDensity(Note[] noteArray)` Returns a double expressing the ratio between the count of consecutive notes of the same pitch and the count of all note to next note intervals in the specified Note array.
    `static double` | `repeatedPitchDensity(Phrase phrase)` Returns a double expressing the ratio between the count of consecutive notes of the same pitch and the count of all note to next note intervals in the specified Phrase.
    `static double` | `repeatedPitchPatterns(Note[] noteArray, int chunkSize)` Returns a double expressing the number of repetitions of pitch interval patterns of a specified size, compared to the total possible number of patterns in the specified Note array.
    `static double` | `repeatedPitchPatterns(Phrase phrase, int chunkSize)` Returns a double expressing the number of repetitions of pitch interval patterns of a specified size, compared to the total possible number of patterns in the specified Phrase.
    `static double` | `repeatedRhythmicValueDensity(Note[] noteArray)` Returns a double expressing the ratio between the count of consecutive notes of the same rhythm value and the count of all note to next note intervals in the specified Note array.
    `static double` | `repeatedRhythmicValueDensity(Phrase phrase)` Returns a double expressing the ratio between the count of consecutive notes of the same rhythm value and the count of all note to next note intervals in the specified Phrase.
    `static double` | `repeatedRhythmPatterns(Note[] noteArray, int chunkSize)` Returns a double expressing the number of repetitions of rhythm interval patterns of a specified size, compared to the total possible number of patterns in the specified Note array.
    `static double` | `repeatedRhythmPatterns(Phrase phrase, int chunkSize)` Returns a double expressing the number of repetitions of rhythm interval patterns of a specified size, compared to the total possible number of patterns in the specified Phrase.
    `static double` | `restDensity(Note[] noteArray, double duration)` Returns a double expressing the ratio between the number of rest quanta and the number of quanta in a Note array.
    `static double` | `restDensity(Phrase phrase, double duration)` Returns a double expressing the ratio between the number of rest quanta and the number of quanta in a Phrase.
    `static int` | `restQuantumCount(Note[] noteArray, double duration)` Returns the number of silent quanta in the specified `Note` array.
    `static int` | `restQuantumCount(Phrase phrase, double duration)` Returns the number of silent quanta in the specified `Phrase`.
    `static double` | `rhythmicVariety(Note[] noteArray)` Returns a double expressing the ratio between the number of distinct rhythms and the total number of notes in the specified `Note` array.
    `static double` | `rhythmicVariety(Phrase phrase)` Returns a double expressing the number of distinct rhythm Values used over the maximum possible rhythmic values.
    `static double[]` | `rhythmIntervals(Note[] noteArray)` Returns an array of doubles describing the change in rhythm value in intervals in the specified `Note` array.
    `static double[]` | `rhythmIntervals(Phrase phrase)` Returns an array of doubles describing the change in rhythm value in intervals in the specified `Phrase`.
    `static int` | `rhythmPatternCount(Note[] noteArray, int chunkSize)` Returns the number of 'rhythm interval' patterns of size `chunksize` in the specified Note array.
    `static int` | `rhythmPatternCount(Phrase phrase, int chunksize)` Returns the number of 'rhythm interval' patterns of size `chunksize` in the specified Phrase.
    `static double` | `rhythmRange(Note[] noteArray)` Returns the value of the longest rhythm value, divided by the shortest in the specified Note array.
    `static double` | `rhythmRange(Phrase phrase)` Returns the value of the longest rhythm value, divided by the shortest in the specified Phrase.
    `static double` | `rhythmRangePerSpan(Note[] noteArray)` Returns a double expressing the ratio between the rhythm range of the specified Note array and `MAX_RHYTHM_RANGE`.
    `static double` | `rhythmRangePerSpan(Phrase phrase)` Returns a double expressing the ratio between the rhythm range of the specified phrase and `MAX_RHYTHM_RANGE`.
    `static double` | `rhythmValueCount(Note[] noteArray)` Returns the sum of all rhythm values in the specified Note array.
    `static double` | `rhythmValueCount(Phrase phrase)` Returns the sum of all rhythm values in the specified Phrase.
    `static int` | `risingSemitoneCount(Note[] noteArray)` Returns the sum of the sizes of all rising intervals in the specified Note array.
    `static int` | `risingSemitoneCount(Phrase phrase)` Returns the sum of the sizes of all rising intervals in the specified Phrase.
    `static int` | `sameDirectionIntervalCount(Note[] noteArray)` Returns the count of consecutive intevals in the same direction, in the specified Note array.
    `static int` | `sameDirectionIntervalCount(Phrase phrase)` Returns the count of consecutive intevals in the same direction, in the specified Phrase.
    `static int` | `stepIntervalCount(Note[] noteArray, int tonic, int[] scale)` Returns a count of all the step intervals in the specified Note array.
    `static int` | `stepIntervalCount(Phrase phrase, int tonic, int[] scale)` Returns a count of all the step intervals in the specified Phrase.
    `static double` | `syncopation(Note[] noteArray)` Returns a double expressing the ratio of the number of notes which start off the beat and have a rhythm value of a beat of more, compared to the total number of beats less one in the specified Note array.
    `static double` | `syncopation(Phrase phrase)` Returns a double expressing the ratio of the number of notes which start on the beat and have a rhythm value of a beat of more, compared to the total number of beats in the specified Phrase.
    `static double` | `tonalDeviation(Note[] noteArray, double duration, int tonic, int[] scale)` Returns a double expressing the total duration of all non-scale notes, over the length of the melody.
    `static double` | `tonalDeviation(Phrase phrase, double duration, int tonic, int[] scale)` Returns a double expressing the total duration of all non-scale notes, over the length of the melody.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### featureNames

          public static final java.lang.String[] featureNames

      Array of Strings giving the identifier number and descriptive name of each feature as returned by the `getAllStatistics` methods.

    - #### NOTELIST_EXCEPTION_STRING

          public static final java.lang.String NOTELIST_EXCEPTION_STRING

      See Also:
        Constant Field Values

    - #### QUANTISATION_EXCEPTION_STRING

          public static final java.lang.String QUANTISATION_EXCEPTION_STRING

      See Also:
        Constant Field Values

    - #### NOTELIST_EXCEPTION_CONSTANT

          public static final double NOTELIST_EXCEPTION_CONSTANT

      See Also:
        Constant Field Values

    - #### QUANTISATION_EXCEPTION_CONSTANT

          public static final double QUANTISATION_EXCEPTION_CONSTANT

      See Also:
        Constant Field Values

    - #### FEATURE_COUNT

          public static final int FEATURE_COUNT

      Integer constant describing the number of statistical features returned by the `getAllStatistics` methods.
      See Also:
        Constant Field Values

    - #### MAX_PITCH_RANGE

          public static final int MAX_PITCH_RANGE

      Integer constant describing the maximum pitch range that a reasonable melody can span, measured in semitones. This maximum is not an actual maximum, but a value determined by those developing these methods as suitably large enough that it would be a maximum for a reasonable melody.

      Within this class, this constant is only used by the `pitchRangePerSpan` method.

      As such, this constant provides little benefit except to implementations that use the `pitchRangePerSpan` method.

      See Also:
        Constant Field Values

    - #### MAX_RHYTHM_RANGE

          public static final double MAX_RHYTHM_RANGE

      Double constant describing the maximum rhythm range that a reasonable could utilise. This measure is equal to the longest reasonable rhythm value divided by the shortest. This maximum is not an actual maximum, but a value determined by those developing these methods as suitably large enough suitably large enough that it would be a maximum for a reasonable melody.

      Within this class, this constant is only used by the `rhythmRangePerSpan` method.

      As such, this constant provides little benefit except to implementations that use the `rhythmRangePerSpan` method.

      See Also:
        Constant Field Values

    - #### MAJOR_SCALE

          public static final int[] MAJOR_SCALE

      Integer array containing the pitches representing a major scale. These pitches are relative to the tonic, are measured in semitones, and are limited to one octave. For instance, the dominant is represented by the value 7, as it is 7 semitones above the tonic.

      Many methods of this class require a scale of this form as parameters. It is suggested that either this constant or the `MINOR_SCALE` constant be passed to these methods, depending on the key of the melody to be analysed.

    - #### MINOR_SCALE

          public static final int[] MINOR_SCALE

      Integer array containing the pitches representing a minor scale. These pitches are relative to the tonic, are measured in semitones, and are limited to one octave. For instance, the dominant is represented by the value 7, as it is 7 semitones above the tonic.

      Many methods of this class require a scale of this form as parameters. It is suggested that either this constant or the `MAJOR_SCALE` constant be passed to these methods, depending on the key of the melody to be analysed.

    - #### PRIMARY_NOTES

          public static final int[] PRIMARY_NOTES

      Integer array containing the pitches that represent primary pitches. A primary pitch is a pitch that is considered in strong accord to the tonic, such as the tonic itself and the dominant. These pitches are relative to the tonic, measured in semitones, and limited to one octave.

      This constant is used by the `primaryQuantumCount` and `climaxTonality` methods.

    - #### BIG_JUMP_INTERVAL

          public static final int BIG_JUMP_INTERVAL

      Integer defining the smallest interval, measured in semitones, that constitutes a 'big jump'. A 'big jump' is an interval that is generally considered extreme or uncommon and hence requires a step back to compensate musically. This constant is used by the `leapCompensation`, `bigJumpFollowedByStepBackCount`, and `bigJumpCount` methods.
      See Also:
        Constant Field Values

    - #### MAX_DISTINCT_RHYTHMS

          public static final int MAX_DISTINCT_RHYTHMS

      Integer defining the maximum number of distinct rhythm values that can appear in the melody. This constant is only used by the `rhythmicVariety` method.
      See Also:
        Constant Field Values

    - #### INTERVAL_WITH_REST

          public static final int INTERVAL_WITH_REST

      Used by the `pitchIntervals(jm.music.data.Phrase)` method to indicate an interval with one or more rests between its notes. That method indicates a interval with a rest by adding this constant to the size of the interval. This constant is guaranteed to be large enough not to cause any conflicts between the value for extremely large rising intervals without rests, and extremely large lowering intervals with rests.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getAllStatisticsAsStrings

          public static java.lang.String[] getAllStatisticsAsStrings(Phrase phrase,
                                                     double duration,
                                                     int tonic,
                                                     int[] scale)

    - #### getAllStatisticsAsStrings

          public static java.lang.String[] getAllStatisticsAsStrings(Note[] noteArray,
                                                     double duration,
                                                     int tonic,
                                                     int[] scale)

    - #### getAllStatisticsAsDoubles

          public static double[] getAllStatisticsAsDoubles(Phrase phrase,
                                           double duration,
                                           int tonic,
                                           int[] scale)

    - #### getAllStatisticsAsDoubles

          public static double[] getAllStatisticsAsDoubles(Note[] noteArray,
                                           double duration,
                                           int tonic,
                                           int[] scale)

    - #### getAllStatistics

          public static java.util.Hashtable getAllStatistics(Phrase phrase,
                                             double duration,
                                             int tonic,
                                             int[] scale)

      Returns a `Hashtable` containing all the feature statistics.

      The keys of the hashtable contain a String describing the feature along with a numeric identification code for that feature.

      The values are Strings representing the value returned by that feature: either the double returned, or a description of the exception thrown.

      Parameters:
        `phrase` - the Phrase to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        hashtable whose keys contain a String describing the feature statistics, and whose corresponding values are the doubles returned by each statistic converted to a String.

    - #### getAllStatistics

          public static java.util.Hashtable getAllStatistics(Note[] noteList,
                                             double duration,
                                             int tonic,
                                             int[] scale)

      Returns a `Hashtable` containing all the feature statistics.

      The keys of the hashtable contain a String describing the feature along with a numeric identification code for that feature.

      The values are Strings representing the value returned by that feature: either the double returned, or a description of the exception thrown.

      Parameters:
        `noteList` - the Note array to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        hashtable whose keys contain a String describing the feature statistics, and whose corresponding values are the doubles returned by each statistic converted to a String.

    - #### noteDensity

          public static double noteDensity(Phrase phrase,
                           double duration)
                                    throws NoteListException,
                                           QuantisationException

      Returns a double expressing the the number of notes per quanta in a `Phrase`. The number of notes exludes rests.
      Parameters:
        `phrase` - Phrase whose notes are to be counted
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        double describing the fraction of notes per quantum in the Phrase
      Throws:
        `NoteListException` - if the number of quantum in the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### noteDensity

          public static double noteDensity(Note[] noteArray,
                           double duration)
                                    throws NoteListException,
                                           QuantisationException

      Returns a double expressing the the number of notes per quanta in a `Note` array. The number of notes exludes rests.
      Parameters:
        `noteArray` - array of Notes to be examined
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        double describing the fraction of notes per quantum in the Note array
      Throws:
        `NoteListException` - if the number of quantum in the Note array is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### pitchVariety

          public static double pitchVariety(Phrase phrase)
                                     throws NoteListException

      Returns a double expressing the number of distinct pitches per note in the `Phrase`.
      Parameters:
        `phrase` - Phrase whose pitches are to be counted
      Returns:
        double describing the fraction of distinct pitches per note in the Phrase
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### pitchVariety

          public static double pitchVariety(Note[] noteArray)
                                     throws NoteListException

      Returns a double expressing the ratio between the number of distinct pitches and the total number of notes in the specified `Note` array.
      Parameters:
        `noteArray` - array of Notes to be examined
      Returns:
        double describing the fraction of distinct pitches per note in the Note array
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### rhythmicVariety

          public static double rhythmicVariety(Phrase phrase)

      Returns a double expressing the number of distinct rhythm Values used over the maximum possible rhythmic values. The maximum is set in the constant `MAX_DISTINCT_RHYTHMS`.
      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        double describing the fraction of distinct pitches per note in the Phrase

    - #### rhythmicVariety

          public static double rhythmicVariety(Note[] noteArray)

      Returns a double expressing the ratio between the number of distinct rhythms and the total number of notes in the specified `Note` array.
      Parameters:
        `noteArray` - array of Note objects to be examined
      Returns:
        double describing the fraction of distinct pitches per note in the Note array

    - #### climaxStrength

          public static double climaxStrength(Phrase phrase)
                                       throws NoteListException

      Returns a double expressing the inverse of the count of the number of notes sharing the highest pitch in the specified Phrase.
      Parameters:
        `Phrase` - Phrase to be examined
      Returns:
        double describing the climatic strength.
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### climaxStrength

          public static double climaxStrength(Note[] noteArray)
                                       throws NoteListException

      Returns a double expressing the inverse of the count of the number of notes sharing the highest pitch in the specified Note array.
      Parameters:
        `noteArray` - Note array to be examined
      Returns:
        double describing the climatic strength.
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### restDensity

          public static double restDensity(Phrase phrase,
                           double duration)
                                    throws NoteListException,
                                           QuantisationException

      Returns a double expressing the ratio between the number of rest quanta and the number of quanta in a Phrase. That is, the percentage of the time taken up by rests.
      Parameters:
        `phrase` - Phrase to be examined
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        double describing the fraction of silent quanta per quantum in the Phrase
      Throws:
        `NoteListException` - if the length of the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### restDensity

          public static double restDensity(Note[] noteArray,
                           double duration)
                                    throws NoteListException,
                                           QuantisationException

      Returns a double expressing the ratio between the number of rest quanta and the number of quanta in a Note array. That is, the percentage of the time taken up by rests.
      Parameters:
        `noteArray` - array of Note objects to be examined
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        double describing the fraction of silent quanta per quantum in the Note array
      Throws:
        `NoteListException` - if the length of the melody is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### tonalDeviation

          public static double tonalDeviation(Phrase phrase,
                              double duration,
                              int tonic,
                              int[] scale)
                                       throws NoteListException,
                                              QuantisationException

      Returns a double expressing the total duration of all non-scale notes, over the length of the melody.
      Parameters:
        `phrase` - Phrase to be examined
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the fraction of non-scale quanta per quantum in the Phrase
      Throws:
        `NoteListException` - if the number of quanta in the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### tonalDeviation

          public static double tonalDeviation(Note[] noteArray,
                              double duration,
                              int tonic,
                              int[] scale)
                                       throws NoteListException,
                                              QuantisationException

      Returns a double expressing the total duration of all non-scale notes, over the length of the melody.
      Parameters:
        `noteArray` - array of Note objects to be examined
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the fraction of non-scale quanta per quantum in the Note array
      Throws:
        `NoteListException` - if the number of quanta in the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### keyCenteredness

          public static double keyCenteredness(Phrase phrase,
                               double duration,
                               int tonic)
                                        throws QuantisationException,
                                               NoteListException

      Returns a double expressing the total duration of all primary notes, over the length of the melody. Primary notes are either tonic or dominant.
      Parameters:
        `phrase` - Phrase to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
      Returns:
        double describing the fraction of primary quanta per quantum in the melody
      Throws:
        `NoteListException` - if the number of quanta in the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### keyCenteredness

          public static double keyCenteredness(Note[] noteArray,
                               double duration,
                               int tonic)
                                        throws QuantisationException,
                                               NoteListException

      Returns a double expressing the total duration of all primary notes, over the length of the melody. Primary notes are either tonic or dominant.
      Parameters:
        `noteArray` - array of Notes to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
      Returns:
        double describing the fraction of primary quanta per quantum in the melody
      Throws:
        `NoteListException` - if the number of quanta in the Phrase is zero
        `QuantisationException` - if the notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### pitchRangePerSpan

          public static double pitchRangePerSpan(Phrase phrase)
                                          throws NoteListException

      Returns a double expressing the ratio between the pitch range of the specified phrase and `MAX_PITCH_RANGE`. If the range of the melody is larger than this constant, this method will return 1 instead.

      `MAX_PITCH_RANGE` is an arbitrary value that was useful for the developers of this method. If this arbitrary constant means nothing to your implementation consider using the `pitchRange` method instead.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double descring the pitch range per `MAX_PITCH_RANGE`
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### pitchRangePerSpan

          public static double pitchRangePerSpan(Note[] noteArray)
                                          throws NoteListException

      Returns a double expressing the ratio between the pitch range of the specified Note array and `MAX_PITCH_RANGE`. If the range of the melody is larger than this constant, this method will return 1 instead.

      `MAX_PITCH_RANGE` is an arbitrary value that was useful for the developers of this method. If this arbitrary constant means nothing to your implementation consider using the `pitchRange` method instead.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double descring the pitch range per `MAX_PITCH_RANGE`
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### rhythmRangePerSpan

          public static double rhythmRangePerSpan(Phrase phrase)
                                           throws NoteListException

      Returns a double expressing the ratio between the rhythm range of the specified phrase and `MAX_RHYTHM_RANGE`. The range of the melody is equal to the longest rhythm value divided by the shortest. If the range of the melody is larger than this constant, this method will return 1 instead.

      `MAX_RHYTHM_RANGE` is an arbitrary value that was useful for the developers of this method. If this arbitrary constant means nothing to your implementation consider using the `rhythmRange` method instead.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double descring the rhythm range per `MAX_RHYTHM_RANGE`
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### rhythmRangePerSpan

          public static double rhythmRangePerSpan(Note[] noteArray)
                                           throws NoteListException

      Returns a double expressing the ratio between the rhythm range of the specified Note array and `MAX_RHYTHM_RANGE`. The range of the melody is equal to the longest rhythm value divided by the shortest. If the range of the melody is larger than this constant, this method will return 1 instead.

      `MAX_RHYTHM_RANGE` is an arbitrary value that was useful for the developers of this method. If this arbitrary constant means nothing to your implementation consider using the `rhythmRange` method instead.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double descring the pitch range per `MAX_RHYTHM_RANGE`
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### repeatedPitchDensity

          public static double repeatedPitchDensity(Phrase phrase)
                                             throws NoteListException

      Returns a double expressing the ratio between the count of consecutive notes of the same pitch and the count of all note to next note intervals in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the repeated pitches per interval
      Throws:
        `NoteListException` - if there are less than two notes in the Phrase

    - #### repeatedPitchDensity

          public static double repeatedPitchDensity(Note[] noteArray)
                                             throws NoteListException

      Returns a double expressing the ratio between the count of consecutive notes of the same pitch and the count of all note to next note intervals in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the repeated pitches per interval
      Throws:
        `NoteListException` - if there are less than two notes in the Note array

    - #### repeatedRhythmicValueDensity

          public static double repeatedRhythmicValueDensity(Phrase phrase)
                                                     throws NoteListException

      Returns a double expressing the ratio between the count of consecutive notes of the same rhythm value and the count of all note to next note intervals in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the repeated rhythm values per interval
      Throws:
        `NoteListException` - if there are less than two notes in the Phrase

    - #### repeatedRhythmicValueDensity

          public static double repeatedRhythmicValueDensity(Note[] noteArray)
                                                     throws NoteListException

      Returns a double expressing the ratio between the count of consecutive notes of the same rhythm value and the count of all note to next note intervals in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the repeated rhythm values per interval
      Throws:
        `NoteListException` - if there are less than two notes in the Note array

    - #### melodicDirectionStability

          public static double melodicDirectionStability(Phrase phrase)
                                                  throws NoteListException

      Returns a double expressing the ratio between the number of consecutive pitch steps in the same direction and the total number of steps in the specified Phrase. This checks the degree of melodic contour variation. The feature measures pitch intervals, which means that three notes (two intervals) are required to measure a pattern.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing melodic direction stability
      Throws:
        `NoteListException` - if there are less than three notes in the Phrase

    - #### melodicDirectionStability

          public static double melodicDirectionStability(Note[] noteArray)
                                                  throws NoteListException

      Returns a double expressing the ratio between the number of consecutive pitch steps in the same direction and the total number of steps in the specified Note array. This checks the degree of melodic contour variation. The feature measures pitch intervals, which means that three notes (two intervals) are required to measure a pattern.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the melodic direction stability
      Throws:
        `NoteListException` - if there are less than three notes in the Note array

    - #### overallPitchDirection

          public static double overallPitchDirection(Phrase phrase)

      Returns a double expressing the ratio between the sum of rising intervals over the sum of all intervals in the specified Phrase. For instance, the sum of two 7 semitone intervals is 14 semitones.

      This feature checks the overall tendency of the melodic contour. A melody starting and finishing on the same note will score 0.5, higher indicates an overall rise, and lower scores indicate a descending contour.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the overall pitch direction

    - #### overallPitchDirection

          public static double overallPitchDirection(Note[] noteArray)

      Returns a double expressing the ratio between the sum of rising intervals over the sum of all intervals in the specified Note array. For instance, the sum of two 7 semitone intervals is 14 semitones.

      This feature checks the overall tendency of the melodic contour. A melody starting and finishing on the same note will score 0.5, higher indicates an overall rise, and lower scores indicate a descending contour.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the overall pitch direction

    - #### movementByStep

          public static double movementByStep(Phrase phrase,
                              int tonic,
                              int[] scale)
                                       throws NoteListException

      Returns a double expressing the ratio between the number of pitch movements by diatonic step over the total number of steps in the specified Phrase. This indicates the smoothness of the melody. A high score indicates a smooth melodic curve wtih few large leaps. A step interval is any diatonic interval and might be zero, one or two semitones.
      Parameters:
        `phrase` - Phrase to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the movement by step
      Throws:
        `NoteListException` - if there are less than two notes in the Phrase

    - #### movementByStep

          public static double movementByStep(Note[] noteArray,
                              int tonic,
                              int[] scale)
                                       throws NoteListException

      Returns a double expressing the ratio between the number of pitch movements by diatonic step over the total number of steps in the specified Note array. This indicates the smoothness of the melody. A high score indicates a smooth melodic curve wtih few large leaps. A step interval is any diatonic interval and might be zero, one or two semitones.
      Parameters:
        `noteArray` - Note array to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the movement by step
      Throws:
        `NoteListException` - if there are less than two notes in the Note array

    - #### dissonance

          public static double dissonance(Phrase phrase)

      Returns a double expressing the average dissonance rating of all intervals in the specified Phrase. The intervals are rated as shown by the following table:

      Intervals | Dissonance rating
      --- | ---
      0, 1, 2, 3, 4, 5, 7, 8, 9 | 0.0
      10 | 0.5
      6, 11, 13 or greater | 1.0

      If the Phrase has no intervals, it is considered to have no dissonance, and so 0 is returned.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the dissonance

    - #### dissonance

          public static double dissonance(Note[] noteArray)

      Returns a double expressing the average dissonance rating of all intervals in the specified Note array. The intervals are rated as shown by the following table:

      Intervals | Dissonance rating
      --- | ---
      0, 1, 2, 3, 4, 5, 7, 8, 9 | 0.0
      10 | 0.5
      6, 11, 13 or greater | 1.0

      If the Note array has no intervals, it is considered to have no dissonance, and so 0 is returned.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the dissonance

    - #### leapCompensation

          public static double leapCompensation(Phrase phrase)

      Returns a double expressing the ratio of 'large leaps' that are not followed by an interval in the opposite direction that is no greater than the leap in the specified Phrase. An interval is a large leap if it is equal to or greater than the constant `BIG_JUMP_INTERVAL`.

      If there are no large leaps this method return 0.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the movement by step

    - #### leapCompensation

          public static double leapCompensation(Note[] noteArray)

      Returns a double expressing the ratio of 'large leaps' that are not followed by an interval in the opposite direction that is no greater than the leap in the specified Note array. An interval is a large leap if it is equal to or greater than the constant `BIG_JUMP_INTERVAL`.

      If there are no large leaps this method return 0.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the movement by step

    - #### syncopation

          public static double syncopation(Phrase phrase)

      Returns a double expressing the ratio of the number of notes which start on the beat and have a rhythm value of a beat of more, compared to the total number of beats in the specified Phrase. In simple time a beat is considered to be crotchet in length. This feature indicates the degree to which the beat pulse of the music is weakened.
      Parameters:
        `phrase` - Phrase to be analysed.
      Returns:
        double describing the syncopation of the melody

    - #### syncopation

          public static double syncopation(Note[] noteArray)

      Returns a double expressing the ratio of the number of notes which start off the beat and have a rhythm value of a beat of more, compared to the total number of beats less one in the specified Note array. We use the number of beats less one because that is the number of opportunities for syncopation.

      In simple time a beat is considered to be crotchet in length. This feature indicates the degree to which the beat pulse of the music is weakened.

      Parameters:
        `noteArray` - Note array to be analysed.
      Returns:
        double describing the syncopation of the melody

    - #### repeatedPitchPatterns

          public static double repeatedPitchPatterns(Phrase phrase,
                                     int chunkSize)
                                              throws NoteListException

      Returns a double expressing the number of repetitions of pitch interval patterns of a specified size, compared to the total possible number of patterns in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed.
        `chunkSize` - integer describing the size of patterns to count
      Throws:
        `NoteListException` - if the melody does not have more notes than the size of the patterns searched for

    - #### repeatedPitchPatterns

          public static double repeatedPitchPatterns(Note[] noteArray,
                                     int chunkSize)
                                              throws NoteListException

      Returns a double expressing the number of repetitions of pitch interval patterns of a specified size, compared to the total possible number of patterns in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed.
        `chunkSize` - integer describing the size of patterns to count
      Throws:
        `NoteListException` - if the melody does not have more notes than the size of the patterns searched for

    - #### repeatedRhythmPatterns

          public static double repeatedRhythmPatterns(Phrase phrase,
                                      int chunkSize)
                                               throws NoteListException

      Returns a double expressing the number of repetitions of rhythm interval patterns of a specified size, compared to the total possible number of patterns in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed.
        `chunkSize` - integer describing the size of patterns to count
      Throws:
        `NoteListException` - if the melody does not have more notes than the size of the patterns searched for

    - #### repeatedRhythmPatterns

          public static double repeatedRhythmPatterns(Note[] noteArray,
                                      int chunkSize)
                                               throws NoteListException

      Returns a double expressing the number of repetitions of rhythm interval patterns of a specified size, compared to the total possible number of patterns in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed.
        `chunkSize` - integer describing the size of patterns to count
      Throws:
        `NoteListException` - if the melody does not have more notes than the size of the patterns searched for

    - #### climaxPosition

          public static double climaxPosition(Phrase phrase)
                                       throws NoteListException

      Returns a double representing where the climax of the melody starts. The value is a percentage of the complete melody. The exact formula is the sum of the rhythm values of all notes prior to the climax, divided by the sum of all the rhythm values in the melody.

      The climax is defined as the last highest note.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        double describing the position of the climax
      Throws:
        `NoteListException`

    - #### climaxPosition

          public static double climaxPosition(Note[] noteArray)
                                       throws NoteListException

      Returns a double representing where the climax of the melody starts. The value is a percentage of the complete melody. The exact formula is the sum of the rhythm values of all notes prior to the climax, divided by the sum of all the rhythm values in the melody.

      The climax is defined as the last highest note.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        double describing the position of the climax
      Throws:
        `NoteListException`

    - #### climaxTonality

          public static double climaxTonality(Phrase phrase,
                              int tonic,
                              int[] scale)
                                       throws NoteListException

      Returns a double rating the tonality of the specified Phrase. The climax is the last highest pitch, and given that pitch this method will return a value according to the table:

      Pitch | Value returned
      --- | ---
      Tonic or Dominant | 0.0
      Other scale note | 0.5
      Non-scale note | 1.0

      How the pitch rates depends on the scale of the melody. This information is passed to this method through an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `phrase` - Phrase to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### climaxTonality

          public static double climaxTonality(Note[] noteArray,
                              int tonic,
                              int[] scale)
                                       throws NoteListException

      Returns a double rating the tonality of the specified Note array. The climax is the last highest pitch, and given that pitch this method will return a value according to the table:

      Pitch | Value returned
      --- | ---
      Tonic or Dominant | 0.0
      Other scale note | 0.5
      Non-scale note | 1.0

      How the pitch rates depends on the scale of the melody. This information is passed to this method through an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `noteArray` - Note array to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### noteCount

          public static int noteCount(Phrase phrase)

      Returns the number of notes in a specified `Phrase`.
      Parameters:
        `phrase` - Phrase whose notes are to be counted
      Returns:
        integer describing the number of non-rest Notes in the Phrase

    - #### noteCount

          public static int noteCount(Note[] noteArray)

      Returns the number of notes in a specified `Note` array.
      Parameters:
        `noteArray` - Note array whose notes are to be counted
      Returns:
        integer describing the number of non-rest Notes in the Note array.

    - #### quantumCount

          public static int quantumCount(Phrase phrase,
                         double duration)
                                  throws QuantisationException

      Returns the number of quanta in a specified `Phrase`.
      Parameters:
        `phrase` - Phrase whose quanta are to be counted
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This value must be greater than 0.
      Returns:
        integer describing the length of the Phrase measured in quanta.
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of the specified quantum duration, or if quantum duration is less than or equal to zero

    - #### quantumCount

          public static int quantumCount(Note[] noteArray,
                         double duration)
                                  throws QuantisationException

      Returns the number of quanta in a specified `Note` array.
      Parameters:
        `noteArray` - Note array whose quanta are to be counted
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This value must be greater than 0.
      Returns:
        integer describing the length of the Note array measured in quanta.
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of the specified quantum duration, or if quantum duration is less than or equal to zero

    - #### distinctPitchCount

          public static int distinctPitchCount(Phrase phrase)

      Returns the number of pitches that appear at least once in a specified `Phrase`.
      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        integer describing the number of distinct pitches in the Phrase

    - #### distinctPitchCount

          public static int distinctPitchCount(Note[] noteArray)

      Returns the number of pitches that appear at least once in a specified `Note` array.
      Parameters:
        `noteArray` - array of Note objects to be examined
      Returns:
        integer describing the number of distinct pitches in the Note array

    - #### distinctRhythmCount

          public static int distinctRhythmCount(Phrase phrase)

      Returns the number of rhythms that appear at least once in a specified `Phrase`.
      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        number of distinct pitches in the Note array

    - #### distinctRhythmCount

          public static int distinctRhythmCount(Note[] noteArray)

      Returns the number of rhythms that appear at least once in a specified `Note` array.
      Parameters:
        `noteArray` - array of Note objects to be examined
      Returns:
        integer describing the number of distinct pitches in the Note array

    - #### restQuantumCount

          public static int restQuantumCount(Phrase phrase,
                             double duration)
                                      throws QuantisationException

      Returns the number of silent quanta in the specified `Phrase`. Silent quanta are quanta representing rests. Silent quanta do not include the quanta representing notes with a dynamic, or volume, of zero.
      Parameters:
        `phrase` - Phrase whose silent quanta are to be measured
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        integer describing the number of silent quanta in phrase
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### restQuantumCount

          public static int restQuantumCount(Note[] noteArray,
                             double duration)
                                      throws QuantisationException

      Returns the number of silent quanta in the specified `Note` array. Silent quanta are quanta representing rests. Silent quanta do not include the quanta representing notes with a dynamic, or volume, of zero.
      Parameters:
        `noteArray` - Note array whose silent quanta are to be measured
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
      Returns:
        integer describing the number of silent quanta in phrase
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### nonScaleQuantumCount

          public static int nonScaleQuantumCount(Phrase phrase,
                                 double duration,
                                 int tonic,
                                 int[] scale)
                                          throws QuantisationException

      Returns the count of the quanta taken up by non-scale notes in the specified Phrase.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `phrase` - Phrase to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        integer describing the number of non-scale notes in the specified Phrase
      Throws:
        `QuantisationException`

    - #### nonScaleQuantumCount

          public static int nonScaleQuantumCount(Note[] noteArray,
                                 double duration,
                                 int tonic,
                                 int[] scale)
                                          throws QuantisationException

      Returns the count of the quanta taken up by non-scale notes in the specified Note array.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `noteArray` - Note array to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        integer describing the number of non-scale notes in the specified Note array
      Throws:
        `QuantisationException`

    - #### primaryQuantumCount

          public static int primaryQuantumCount(Phrase phrase,
                                double duration,
                                int tonic)
                                         throws QuantisationException

      Returns the count of the quanta taken up by 'primary notes' in the specified Phrase. Primary notes are notes whose pitch relative to the tonic is listed in the `PRIMARY_NOTES` array.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `phrase` - Phrase to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
      Returns:
        integer describing the number of 'primary notes' in the specified Phrase
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### primaryQuantumCount

          public static int primaryQuantumCount(Note[] noteArray,
                                double duration,
                                int tonic)
                                         throws QuantisationException

      Returns the count of the quanta taken up by 'primary notes' in the specified Note array. Primary notes are notes whose pitch relative to the tonic is listed in the `PRIMARY_NOTES` array.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `noteArray` - Note array to be analysed
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0.
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
      Returns:
        integer describing the number of 'primary notes' in the specified Note array
      Throws:
        `QuantisationException` - if the Notes' rhythm values are not multiples of quantum duration, or if quantum duration is less than or equal to zero

    - #### pitchRange

          public static int pitchRange(Phrase phrase)
                                throws NoteListException

      Returns the difference between the highest and lowest pitches in the specified `Phrase`.
      Parameters:
        `phrase` - Phrase whose notes are to be examined
      Returns:
        integer describing the difference between the highest and lowest pitches
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### pitchRange

          public static int pitchRange(Note[] noteArray)
                                throws NoteListException

      Returns the difference between the highest and lowest pitches in the specified `Note` array.
      Parameters:
        `noteArray` - Note array to be examined
      Returns:
        integer describing the difference between the highest and lowest pitches
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### rhythmRange

          public static double rhythmRange(Phrase phrase)
                                    throws NoteListException

      Returns the value of the longest rhythm value, divided by the shortest in the specified Phrase.
      Parameters:
        `phrase` - Phrase whose notes are to be examined
      Returns:
        double describing the longest rhythm value, divided by the shortest
      Throws:
        `NoteListException` - if there are no notes in the Phrase

    - #### rhythmRange

          public static double rhythmRange(Note[] noteArray)
                                    throws NoteListException

      Returns the value of the longest rhythm value, divided by the shortest in the specified Note array.
      Parameters:
        `phrase` - Phrase whose notes are to be examined
      Returns:
        double describing the longest rhythm value, divided by the shortest
      Throws:
        `NoteListException` - if there are no notes in the Note array

    - #### consecutiveIdenticalPitches

          public static int consecutiveIdenticalPitches(Phrase phrase)

      Returns the count of intervals whose size is 0 semitones in the specified Phrase. If there are less than two notes in the Phrase, that is if there are no intervals, then this method returns 0.

      If there are no note to next note intervals in the melody, this method returns 0 as there are no consecutive identical pitches.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        integer describing the number of intervals with a size of 0 semitones.

    - #### consecutiveIdenticalPitches

          public static int consecutiveIdenticalPitches(Note[] noteArray)

      Returns the count of intervals whose size is 0 semitones in the specified Note array. If there are less than two notes in the Note array, that is if there are no intervals, then this method returns 0.

      If there are no note to next note intervals in the melody, this method returns 0 as there are no consecutive identical pitches.

      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        integer describing the number of intervals with a size of 0 semitones.

    - #### consecutiveIdenticalRhythms

          public static int consecutiveIdenticalRhythms(Phrase phrase)

      Returns the count of intervals between Notes of the same rhythm value in the specified Phrase. If there are less than two Notes in the Phrase, that is if there are no intervals, then this method returns 0. Whether the rhythm values match is independent of whether either is a rest, so a note and a rest with the same rhythm value would match.

      If there are no Notes in the melody, this method returns 0 as ther are no consecutve indentical rhythm values.

      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        integer describing the number of intervals with a size of 0 semitones.

    - #### consecutiveIdenticalRhythms

          public static int consecutiveIdenticalRhythms(Note[] noteArray)

      Returns the count of intervals between notes of the same rhythm value in the specified Note array. If there are less than two notes in the Note array, that is if there are no intervals, then this method returns 0.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        integer describing the number of intervals with a size of 0 semitones.

    - #### sameDirectionIntervalCount

          public static int sameDirectionIntervalCount(Phrase phrase)

      Returns the count of consecutive intevals in the same direction, in the specified Phrase. If there are less than three notes in the Phrase, that is if there are less than two consecutive intervals, this method returns 0.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        Integer describing the count of consecutive intervals in the same direction

    - #### sameDirectionIntervalCount

          public static int sameDirectionIntervalCount(Note[] noteArray)

      Returns the count of consecutive intevals in the same direction, in the specified Note array. If there are less than three notes in the Note array, that is if there are less than two consecutive intervals, this method returns 0.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        Integer describing the count of consecutive intervals in the same direction

    - #### intervalCount

          public static int intervalCount(Phrase phrase)

      Returns a count of the number of note to next note intervals in the specified Phrase. These intervals can have 0 or more rests between the notes.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        Count of intervals

    - #### intervalCount

          public static int intervalCount(Note[] noteArray)

      Returns a count of the number of note to next note intervals in the specified Phrase. These intervals can have 0 or more rests between the notes.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        Count of intervals

    - #### pitchIntervals

          public static int[] pitchIntervals(Phrase phrase)

      Returns an array of integers describing the size of intervals between the notes in the specified `Phrase`. If an interval has no rests between its notes the integer representing it is unchanged. However, if the interval has 1 or more rests between its notes the integer is increased by the value of the `INTERVAL_WITH_REST` constant.

      Given any value in the array returned you can determine if it represents an interval with 1 or more rests between its notes in the following manner. If the value is greater than the largest valid rising interval, namely (`Note.MAX_PITCH` - `Note.MIN_PITCH`), then it represents an interval with a rest. Otherwise it represents an interval without a rest.

      Given a value representing an interval with a rest, you can determine the size and direction of the interval by subtracting INTERVAL_WITH_REST from the value.

      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        array of integers describing the intervals

    - #### pitchIntervals

          public static int[] pitchIntervals(Note[] noteArray)

      Returns an array of integers describing the size of intervals between the notes in the specified `Note` array. If an interval has no rests between its notes the integer representing it is unchanged. However, if the interval has 1 or more rests between its notes the integer is increased by the value of the `INTERVAL_WITH_REST` constant.

      Given any value in the array returned you can determine if it represents an interval with 1 or more rests between its notes in the following manner. If the value is greater than the largest valid rising interval, namely (`Note.MAX_PITCH` - `Note.MIN_PITCH`), then it represents an interval with a rest. Otherwise it represents an interval without a rest.

      Given a value representing an interval with a rest, you can determine the size and direction of the interval by subtracting INTERVAL_WITH_REST from the value.

      Parameters:
        `noteArray` - Note array to be examined
      Returns:
        array of integers describing the intervals

    - #### rhythmIntervals

          public static double[] rhythmIntervals(Phrase phrase)

      Returns an array of doubles describing the change in rhythm value in intervals in the specified `Phrase`. The absolute value for any given interval is the length of the second note, divided by the rhythm value of the first. Additionally, if the first note of the interval is a rest the sign of the value is negative.

      Intervals involving any trailing rests are ignored. So the second note of the final interval is guaranteed to not be a rest.

      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        array of integers describing the intervals

    - #### rhythmIntervals

          public static double[] rhythmIntervals(Note[] noteArray)

      Returns an array of doubles describing the change in rhythm value in intervals in the specified `Note` array. The absolute value for any given interval is the length of the second note, divided by the rhythm value of the first. Additionally, if the first note of the interval is a rest the sign of the value is negative.

      Intervals involving any trailing rests are ignored. So the second note of the final interval is guaranteed to not be a rest.

      Parameters:
        `phrase` - Phrase to be examined
      Returns:
        array of integers describing the intervals

    - #### intervalSemitoneCount

          public static int intervalSemitoneCount(Phrase phrase)

      Returns the sum of the absolute sizes of all intervals in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        sum of intervals

    - #### intervalSemitoneCount

          public static int intervalSemitoneCount(Note[] noteArray)

      Returns the sum of the absolute sizes of all intervals in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        sum of intervals

    - #### risingSemitoneCount

          public static int risingSemitoneCount(Phrase phrase)

      Returns the sum of the sizes of all rising intervals in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        sum of rising intervals

    - #### risingSemitoneCount

          public static int risingSemitoneCount(Note[] noteArray)

      Returns the sum of the sizes of all rising intervals in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        sum of rising intervals

    - #### stepIntervalCount

          public static int stepIntervalCount(Phrase phrase,
                              int tonic,
                              int[] scale)

      Returns a count of all the step intervals in the specified Phrase. A step interval is an interval between two scale notes, whose difference is at most one tone.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `phrase` - Phrase to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the movement by step

    - #### stepIntervalCount

          public static int stepIntervalCount(Note[] noteArray,
                              int tonic,
                              int[] scale)

      Returns a count of all the step intervals in the specified Note array. A step interval is an interval between two scale notes, whose difference is at most one tone.

      The key signature of the melody is specified by parameters passed to this method, namely an integer describing the tonic, and a integer array describing the scale.

      Parameters:
        `noteArray` - Note array to be analysed
        `tonic` - integer representing the pitch of the tonic in semitones, ranging from 0 (C natural) to 11 (B flat).
        `scale` - array of integers describing the scale notes in the key of the melody. If the key is major use the `MAJOR_SCALE` constant of this class; if harmonic minor use `MINOR_SCALE`. Arrays representing other keys can also be created but they must fit the criteria outlined in the descriptions of those constants.
      Returns:
        double describing the movement by step

    - #### bigJumpFollowedByStepBackCount

          public static int bigJumpFollowedByStepBackCount(Phrase phrase)

      Returns the number of big jumps followed by a step back in the specified Phrase. A big jump is an interval whose absolute size is equal to or greater than `BIG_JUMP_INTERVAL`. A step back is a interval in the opposite direction whose size is at least one semitone and less than or equal to `BIG_JUMP_INTERVAL`.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        the number of big jumps

    - #### bigJumpFollowedByStepBackCount

          public static int bigJumpFollowedByStepBackCount(Note[] noteArray)

      Returns the number of big jumps followed by a step back in the specified Note array. A big jump is an interval whose absolute size is equal to or greater than `BIG_JUMP_INTERVAL`. A step back is a interval in the opposite direction whose size is at least one semitone and less than or equal to `BIG_JUMP_INTERVAL`.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        the number of big jumps

    - #### bigJumpCount

          public static int bigJumpCount(Phrase phrase)

      Returns the number of big jumps in the specified Phrase. A big jump is an interval whose absolute size is equal to or greater than `BIG_JUMP_INTERVAL`.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        the number of big jumps

    - #### bigJumpCount

          public static int bigJumpCount(Note[] noteArray)

      Returns the number of big jumps in the specified Note array. A big jump is an interval whose absolute size is equal to or greater than `BIG_JUMP_INTERVAL`.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        the number of big jumps

    - #### pitchPatternCount

          public static int pitchPatternCount(Phrase phrase,
                              int chunkSize)

      Returns the number of 'pitch interval' patterns of size `chunksize` in the specified Phrase. A 'pitch interval' is simply the difference between the pitches of the notes, however there is a distinction between intervals with no rests and intervals with one or more rests in between the two notes of the interval.
      Parameters:
        `phrase` - Phrase to be searched
        `chunksize` - The size of the pattern to search for
      Returns:
        integer describing the number of 'pitch interval' patterns

    - #### pitchPatternCount

          public static int pitchPatternCount(Note[] noteArray,
                              int chunkSize)

      Returns the number of 'pitch interval' patterns of size `chunksize` in the specified Note array. A 'pitch interval' is simply the difference between the pitches of the notes, however there is a distinction between intervals with no rests and intervals with one or more rests in between the two notes of the interval.
      Parameters:
        `noteArray` - Note array to be searched
        `chunksize` - The size of the pattern to search for
      Returns:
        integer describing the number of 'pitch interval' patterns

    - #### rhythmPatternCount

          public static int rhythmPatternCount(Phrase phrase,
                               int chunksize)

      Returns the number of 'rhythm interval' patterns of size `chunksize` in the specified Phrase. A 'rhythm interval' is calculated according to the following formula. The absolute value of the 'rhythm interval' is the length of the second note, divided by the rhythm value of the first. Additionally, if the interval has one or more rests in between the notes, the sign of the value is negative.
      Parameters:
        `phrase` - Phrase to be searched
        `chunksize` - The size of the pattern to search for
      Returns:
        integer describing the number of 'rhythm interval' patterns

    - #### rhythmPatternCount

          public static int rhythmPatternCount(Note[] noteArray,
                               int chunkSize)

      Returns the number of 'rhythm interval' patterns of size `chunksize` in the specified Note array. A 'rhythm interval' is calculated according to the following formula. The absolute value of the 'rhythm interval' is the length of the second note, divided by the rhythm value of the first. Additionally, if the interval has one or more rests in between the notes, the sign of the value is negative.
      Parameters:
        `noteArray` - Note array to be searched
        `chunksize` - The size of the pattern to search for
      Returns:
        integer describing the number of 'rhythm interval' patterns

    - #### rhythmValueCount

          public static double rhythmValueCount(Phrase phrase)

      Returns the sum of all rhythm values in the specified Phrase.
      Parameters:
        `phrase` - Phrase to be analysed
      Returns:
        integer describing the sum of all rhythm values

    - #### rhythmValueCount

          public static double rhythmValueCount(Note[] noteArray)

      Returns the sum of all rhythm values in the specified Note array.
      Parameters:
        `noteArray` - Note array to be analysed
      Returns:
        integer describing the sum of all rhythm values

    - #### removeRestMarker

          public static int removeRestMarker(int interval)

      Removes the rest marker, if any, from integer which conform to the values returned by `pitchIntervals(jm.music.data.Phrase)`.
      Parameters:
        `interval` - integer representing the interval
      Returns:
        interval with rest marker removed (if present)

    - #### isQuantised

          public static boolean isQuantised(Phrase phrase,
                            double duration)
                                     throws QuantisationException

      Tests whether a `Phrase` is quantised. If the rhythm value of any Note within the Phrase is not a multiple of `duration` then false is returned.
      Parameters:
        `phrase` - Phrase to be tested.
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0, otherwise an exception is thrown.
      Returns:
        true if length of notes are all multiples of `duration`; otherwise false
      Throws:
        `QuantisationException` - if the quantum duration is less than or equal to zero.
      See Also:
        `Note`, `Phrase`

    - #### isQuantised

          public static boolean isQuantised(Note[] noteArray,
                            double duration)
                                     throws QuantisationException

      Tests an array of `Notes` to see if they are quantised. If the rhythm value of any of those Notes is not a multiple of `duration` then false is returned.
      Parameters:
        `noteArray` - array of Notes to be tested.
        `duration` - double representing the length of a quantum, where 1 is a crotchet. This must be greater than 0, otherwise an exception is thrown.
      Returns:
        true if length of notes are all multiples of `duration`; otherwise false
      Throws:
        `QuantisationException` - if the quantum duration is less than or equal to zero.
      See Also:
        `Note`, `Phrase`

    - #### pitchToDegree

          public static int pitchToDegree(int pitch,
                          int tonic)

    - #### isScale

          public static boolean isScale(Note note,
                        int tonic,
                        int[] scale)