Package eu.bandm.music.entities
Class FunctionalPitchModOctave
java.lang.Object
eu.bandm.tscore.base.Entity<FunctionalPitchModOctave>
eu.bandm.music.entities.PitchModOctave<FunctionalPitchModOctave>
eu.bandm.music.entities.FunctionalPitchModOctave
- All Implemented Interfaces:
- PitchIndication,- Translet.Parseable<FunctionalPitchModOctave>,- Comparable<FunctionalPitchModOctave>
public class FunctionalPitchModOctave
extends PitchModOctave<FunctionalPitchModOctave>
implements PitchIndication, Comparable<FunctionalPitchModOctave>
A pitch class mod octave which combines a "natural" note name 
  [German "Stammton"],
  given as an instance of 
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.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final AccidentalThe alteration, normally only in the range -2 to 2.(package private) static Map<WhiteKeyModOctave, List<FunctionalPitchModOctave>> Holds all functional pitches by the white key they are derived fromstatic final FunctionalPitchModOctavestatic final EntityCatalog<FunctionalPitchModOctave> Catalog for all named functional pitches.protected final WhiteKeyModOctaveThe white key / "natural" pitch from which this functional pitch is derived.Fields inherited from class eu.bandm.tscore.base.Entitydocumentations
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFunctionalPitchModOctave(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).protectedFunctionalPitchModOctave(WhiteKeyModOctave wk, Accidental alt, EntityCatalog<FunctionalPitchModOctave> catalog, @Opt String lang, @Opt String name) Full constructor, setting all Parameters.
- 
Method SummaryModifier and TypeMethodDescriptionprotected static Translet.Parser<FunctionalPitchModOctave> _x_upperInitialParser(String lang, boolean upper) Deliver a parser with lower or upper initial characters, in the given language only.intTechnically required, to make "TreeMaps" etc.Return the accidental.intReturn the distance from c in fifth.intReturn the distance from c in half tones.Return the natural key from which this pitch class is derived.lowerInitialParser(String lang) Deliver a parser with lower initial characters, in the given language.minus(FunctionalPitchModOctave other) The interval we have to transpose upward some pitch of the given parameter pitch class to get to the nearest pitch of this pitch class.toString()Get any name, preferable in theEntityCatalog.SYMBOLIClanguage, as defined inMuLi.get(String...).upperInitialParser(String lang) Deliver a parser with upper initial characters, in the given language.static FunctionalPitchModOctavevalueOf(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 FunctionalPitchModOctavevalueOf(WhiteKeyModOctave wk, int alt) Deliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental.static FunctionalPitchModOctavevalueOf(WhiteKeyModOctave wk, Accidental alt) Deliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental.Methods inherited from class eu.bandm.tscore.base.EntityaddName, dump, dump, getCatalog, getDocumentation, getDocumentation, getDocumentations, getName, getNames, getParser, getParser, getSpecific, setDocumentation, toString
- 
Field Details- 
naturalThe white key / "natural" pitch from which this functional pitch is derived.
- 
alterationThe alteration, normally only in the range -2 to 2.
- 
catalogCatalog for all named functional pitches. There is no name for e.g. "c###"
- 
byWhiteKeysHolds all functional pitches by the white key they are derived from
- 
c
 
- 
- 
Constructor Details- 
FunctionalPitchModOctaveprotected 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).- See Also:
 
- 
FunctionalPitchModOctaveprotected FunctionalPitchModOctave(WhiteKeyModOctave wk, Accidental alt, EntityCatalog<FunctionalPitchModOctave> catalog, @Opt @Opt String lang, @Opt @Opt String name) Full constructor, setting all Parameters. If name==null, this is a synthetic pitch class with more than two chromatic shifts ("f triple sharp" / "fisisis") which will not be adressable by a name but only by "valueOf()".- Parameters:
- wk- the white key from which this pitch is derived.
- alt- the accidental to apply, may by Accidental.natural
- catalog- where to store this new Entity
- lang- language of the given name
- name- given name
 
 
- 
- 
Method Details- 
get_naturalReturn the natural key from which this pitch class is derived.
- 
get_accidentalReturn the accidental. Will be Accidental.natural if no shift by accidental applies.
- 
compareToTechnically required, to make "TreeMaps" etc. Semantically not very sensible, because very different comparison orders are sensible.- Specified by:
- compareToin interface- Comparable<FunctionalPitchModOctave>
 
- 
get_halfTonesFromCpublic int get_halfTonesFromC()Return the distance from c in half tones. This is a rather arbitrary measure, and is valid only modulo 12.
- 
get_fifthsFromCpublic int get_fifthsFromC()Return the distance from c in fifth. This is a precise measure and not subject to any modulo.
- 
minusThe interval we have to transpose upward some pitch of the given parameter pitch class to get to the nearest pitch of this pitch class.
- 
lowerInitialParserDeliver a parser with lower initial characters, in the given language.
- 
upperInitialParserDeliver a parser with upper initial characters, in the given language.
- 
_x_upperInitialParserprotected static Translet.Parser<FunctionalPitchModOctave> _x_upperInitialParser(String lang, boolean upper) Deliver a parser with lower or upper initial characters, in the given language only. If no name in the language is given, the item is excluded. FIXME currently without warning !?! with a warning.
- 
toStringDescription copied from class:EntityGet any name, preferable in theEntityCatalog.SYMBOLIClanguage, as defined inMuLi.get(String...). If this fails, get built-inObject.toString()conversion result.- Overrides:
- toStringin class- Entity<FunctionalPitchModOctave>
 
- 
valueOfDeliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental. If no such instance exists, a new one (synthetic and adressable only by a "valueOf()" method) is created and cached.- Parameters:
- wk- the white key by its distance from c (from 0 to 6)
- alt- the alteration, given numerically.
 
- 
valueOfDeliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental. If no such instance exists, a new one (synthetic and adressable only by a "valueOf()" method) is created and cached.- Parameters:
- wk- the white key, given as an object.
- alt- the alteration, given as an object.
 
- 
valueOfDeliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental.- Parameters:
- wk- the white key given as an object.
- alt- the alteration, given numerically.
 
 
-