public class FunctionalPitchModOctave extends PitchModOctave<FunctionalPitchModOctave> implements PitchIndication, Comparable<FunctionalPitchModOctave>
WhiteKeyModOctave
,
with an alteration (normally in the range -2 to +2).
These instances are in many cases the fundamental means for speficying pitch
inputs, e.g. by parsing source texts. They can be accessed by very different
names in different (human) languages.
Named instances are pre-constructed in the conventional range, from zero to two
accidentals, but this is not a limit for the construction of accidentals and
functional pitches.
Currently only the German language names are supported.
Many languages do not have dedicated names, but append some representation of the accidental
to the name of the white key, like "c#" or "c sharp" in English.Modifier and Type | Field and Description |
---|---|
protected Accidental |
alteration
The alteration, normally only in the range -2 to 2.
|
(package private) static Map<WhiteKeyModOctave,List<FunctionalPitchModOctave>> |
byWhiteKeys
Holds all functional pitches by the white key they are derived from
|
static EntityCatalog<FunctionalPitchModOctave> |
catalog
Catalog for all named functional pitches.
|
protected WhiteKeyModOctave |
natural
The white key / "natural" pitch from which this functional pitch is derived.
|
documentations
Modifier | Constructor and Description |
---|---|
protected |
FunctionalPitchModOctave(WhiteKeyModOctave wk,
Accidental alt,
EntityCatalog<FunctionalPitchModOctave> catalog,
@Opt String lang,
@Opt String name)
Full constructor, setting all Parameters.
|
protected |
FunctionalPitchModOctave(WhiteKeyModOctave wk,
int alt,
EntityCatalog<FunctionalPitchModOctave> catalog,
String lang,
String name)
Auxilliary constructor, accidental shift given directly by integer value
(normally in the range -2..+2).
|
Modifier and Type | Method and Description |
---|---|
protected static Translet.Parser<FunctionalPitchModOctave> |
_x_upperInitialParser(String lang,
boolean upper)
Deliver a parser with lower or upper initial characters, in the given language.
|
int |
compareTo(FunctionalPitchModOctave other)
Technically required, to make "TreeMaps" etc.
|
Accidental |
get_accidental()
Return the accidental.
|
int |
get_fifthsFromC()
Return the distance from c in fifth.
|
int |
get_halfTonesFromC()
Return the distance from c in half tones.
|
WhiteKeyModOctave |
get_natural()
Return the natural key from which this pitch class is derived.
|
static Translet.Parser<FunctionalPitchModOctave> |
lowerInitialParser(String lang)
Deliver a parser with lower initial characters, in the given language.
|
String |
toString() |
static Translet.Parser<FunctionalPitchModOctave> |
upperInitialParser(String lang)
Deliver a parser with upper initial characters, in the given language.
|
static FunctionalPitchModOctave |
valueOf(int wk,
int alt)
Deliver the functional pitch class derived from the given white key mod octave
and the given chromatic shift by accidental.
|
static FunctionalPitchModOctave |
valueOf(WhiteKeyModOctave wk,
Accidental alt)
Deliver the functional pitch class derived from the given white key mod octave
and the given chromatic shift by accidental.
|
static FunctionalPitchModOctave |
valueOf(WhiteKeyModOctave wk,
int alt)
Deliver the functional pitch class derived from the given white key mod octave
and the given chromatic shift by accidental.
|
addName, dump, dump, getCatalog, getDocumentation, getDocumentation, getDocumentations, getName, getName, getNames, getParser, getParser, setDocumentation, toString
protected final WhiteKeyModOctave natural
protected final Accidental alteration
public static final EntityCatalog<FunctionalPitchModOctave> catalog
static Map<WhiteKeyModOctave,List<FunctionalPitchModOctave>> byWhiteKeys
protected FunctionalPitchModOctave(WhiteKeyModOctave wk, int alt, EntityCatalog<FunctionalPitchModOctave> catalog, String lang, String name)
protected FunctionalPitchModOctave(WhiteKeyModOctave wk, Accidental alt, EntityCatalog<FunctionalPitchModOctave> catalog, @Opt @Opt String lang, @Opt @Opt String name)
wk
- the white key from which this pitch is derived.alt
- the accidental to apply, may by Accidental.naturalcatalog
- where to store this new Entitylang
- language of the given namename
- given namepublic WhiteKeyModOctave get_natural()
public Accidental get_accidental()
public int compareTo(FunctionalPitchModOctave other)
compareTo
in interface Comparable<FunctionalPitchModOctave>
public int get_halfTonesFromC()
public int get_fifthsFromC()
public static Translet.Parser<FunctionalPitchModOctave> lowerInitialParser(String lang)
public static Translet.Parser<FunctionalPitchModOctave> upperInitialParser(String lang)
protected static Translet.Parser<FunctionalPitchModOctave> _x_upperInitialParser(String lang, boolean upper)
public static FunctionalPitchModOctave valueOf(int wk, int alt)
wk
- the white key by its distance from c (from 0 to 6)alt
- the alteration, given numerically.public static FunctionalPitchModOctave valueOf(WhiteKeyModOctave wk, Accidental alt)
wk
- the white key, given as an object.alt
- the alteration, given as an object.public static FunctionalPitchModOctave valueOf(WhiteKeyModOctave wk, int alt)
wk
- the white key given as an object.alt
- the alteration, given numerically.