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 Intervalsas(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 IntervalscreateIntervalsFromNotes(java.lang.String noteString)static IntervalscreateIntervalsFromNotes(Pattern pattern)static IntervalscreateIntervalsFromNotes(Note[] notes)booleanequals(java.lang.Object o)static intgetHalfsteps(java.lang.String wholeNumberDegree)java.util.List<Note>getNotes()java.lang.StringgetNthInterval(int n)PatterngetPattern()Returns a patternbooleanhas(java.lang.String note)Returns true if this interval contains the provided note in any octave.booleanhas(Note note)Returns true if this interval contains the provided note in any octave.inthashCode()Intervalsrotate(int n)Rotates an interval string by the given value.IntervalssetRoot(java.lang.String root)IntervalssetRoot(Note root)intsize()int[]toHalfstepArray()java.lang.StringtoString()
-
-
-
Method Detail
-
setRoot
public Intervals setRoot(java.lang.String root)
-
getPattern
public Pattern getPattern()
Description copied from interface:PatternProducerReturns a pattern- Specified by:
getPatternin interfacePatternProducer
-
getNotes
public java.util.List<Note> getNotes()
- Specified by:
getNotesin 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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
createIntervalsFromNotes
public static Intervals createIntervalsFromNotes(java.lang.String noteString)
-
-