Class Intervals

java.lang.Object
org.jfugue.theory.Intervals
All Implemented Interfaces:
NoteProducer, PatternProducer

public class Intervals extends Object implements PatternProducer, NoteProducer
  • Constructor Details

    • Intervals

      public Intervals(String intervalPattern)
  • Method Details

    • setRoot

      public Intervals setRoot(String root)
    • setRoot

      public Intervals setRoot(Note root)
    • getPattern

      public Pattern getPattern()
      Description copied from interface: PatternProducer
      Returns a pattern
      Specified by:
      getPattern in interface PatternProducer
    • getNotes

      public List<Note> getNotes()
      Specified by:
      getNotes in interface NoteProducer
    • getNthInterval

      public String getNthInterval(int n)
    • size

      public int size()
    • getHalfsteps

      public static int getHalfsteps(String wholeNumberDegree)
    • toHalfstepArray

      public int[] toHalfstepArray()
    • rotate

      public Intervals rotate(int n)
      Rotates an interval string by the given value. For example, with an Interval like "1 3 5" and rotate(1), this would return "3 5 1" (not "5 1 3").
    • has

      public boolean has(String note)
      Returns true if this interval contains the provided note in any octave. Requires that the interval has a root; the octave of the root or the provided values are ignored.
    • has

      public boolean has(Note note)
      Returns true if this interval contains the provided note in any octave. Requires that the interval has a root; the octave of the root or the provided values are ignored.
    • as

      public Intervals as(String asSequence)
      Accepts a string of replacement values, like $1 $2 $2, which will be populated with the 1st, 2nd, and 2nd intervals when getPattern() is called.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • createIntervalsFromNotes

      public static Intervals createIntervalsFromNotes(Pattern pattern)
    • createIntervalsFromNotes

      public static Intervals createIntervalsFromNotes(String noteString)
    • createIntervalsFromNotes

      public static Intervals createIntervalsFromNotes(Note[] notes)