Package org.jfugue.theory
Class Intervals
- java.lang.Object
-
- org.jfugue.theory.Intervals
-
- All Implemented Interfaces:
NoteProducer
,PatternProducer
public class Intervals extends java.lang.Object implements PatternProducer, NoteProducer
-
-
Constructor Summary
Constructors Constructor Description Intervals(java.lang.String intervalPattern)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Intervals
as(java.lang.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.static Intervals
createIntervalsFromNotes(java.lang.String noteString)
static Intervals
createIntervalsFromNotes(Pattern pattern)
static Intervals
createIntervalsFromNotes(Note[] notes)
boolean
equals(java.lang.Object o)
static int
getHalfsteps(java.lang.String wholeNumberDegree)
java.util.List<Note>
getNotes()
java.lang.String
getNthInterval(int n)
Pattern
getPattern()
Returns a patternboolean
has(java.lang.String note)
Returns true if this interval contains the provided note in any octave.boolean
has(Note note)
Returns true if this interval contains the provided note in any octave.int
hashCode()
Intervals
rotate(int n)
Rotates an interval string by the given value.Intervals
setRoot(java.lang.String root)
Intervals
setRoot(Note root)
int
size()
int[]
toHalfstepArray()
java.lang.String
toString()
-
-
-
Method Detail
-
setRoot
public Intervals setRoot(java.lang.String root)
-
getPattern
public Pattern getPattern()
Description copied from interface:PatternProducer
Returns a pattern- Specified by:
getPattern
in interfacePatternProducer
-
getNotes
public java.util.List<Note> getNotes()
- Specified by:
getNotes
in interfaceNoteProducer
-
getNthInterval
public java.lang.String getNthInterval(int n)
-
size
public int size()
-
getHalfsteps
public static int getHalfsteps(java.lang.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(java.lang.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(java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
createIntervalsFromNotes
public static Intervals createIntervalsFromNotes(java.lang.String noteString)
-
-