Package org.jjazz.harmony.api
Class StandardScaleInstance
java.lang.Object
org.jjazz.harmony.api.StandardScaleInstance
- All Implemented Interfaces:
Serializable
A standard scale (e.g. Mixolydian) with a start note (e.g. Eb).
This is an immutable class.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Equals if same scale object and same relative pitch for start notes.Try to fit d to this scale.static Degree
fitDegree
(Degree d, StandardScaleInstance... ssis) Call fitDegree(d) on each of the StandardScaleInstance and return the first non-null result.getNotes()
Get the notes that make the scale.Get the relative pitches of the notes that make the scale.getScale()
getTransposed
(int semitons) Return a copy transposed by t semitons.int
hashCode()
toString()
-
Constructor Details
-
StandardScaleInstance
-
-
Method Details
-
getScale
-
getStartNote
-
getTransposed
Return a copy transposed by t semitons.- Parameters:
semitons
-- Returns:
-
getNotes
Get the notes that make the scale.- Returns:
-
getRelativePitches
Get the relative pitches of the notes that make the scale.- Returns:
- An unmodifiable list.
-
fitDegree
Try to fit d to this scale.1/ If d.getPitch() is part of this scale return the corresponding degree
Ex: d=NINTH_SHARP and scale=DORIAN, return THIRD_MINOR (same pitch)
2/ If 1/ dit not work, try to see a derived degree match
Ex: d=FIFTH and scale=ALTERED, return FIFTH_FLAT
- Parameters:
d
-- Returns:
- A matching degree which belongs to this scale, or null.
-
equals
Equals if same scale object and same relative pitch for start notes. -
hashCode
public int hashCode() -
toNoteString
-
toString
-
fitDegree
Call fitDegree(d) on each of the StandardScaleInstance and return the first non-null result.- Parameters:
d
-ssis
-- Returns:
- Can be null.
-