Class Ornament
- All Implemented Interfaces:
Translet.Parseable<Ornament>
,Cloneable
- Direct Known Subclasses:
Ornament_JSB_klavierbuechlein
,Ornament_KdF_special
Instances of this very simple model basically are extended to sequences of fast played notes with pitches around the notated reference pitch. Only conceptually, all fast notes have the same duration which is an integral part of the notated duration of the reference note. The played pitches are n scalar steps remote from the reference, which is declared by the integers in the three sequences/arrays. The expansion works as follows:
- Determine the duration of the played notes.
- Determine how often the central segment must be repeated to fill the duration.
-
All repeated indexes are melt into one single played event, so a central segment
defined by "<0>", which is repeated as long as necessary,
simply is a long hold of the reference pitch.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int[]
Can be used as the main part to simply hold the main note.static final int[]
Can be used to make pre or post part not executing.final int[]
Sequence of pitch distances for the post part of the ornamentfinal int[]
Sequence of pitch distances for the pre part of the ornamentfinal int[]
Sequence of pitch distances for the main repeated part of the ornamentFields inherited from class eu.bandm.tscore.base.Entity
catalog, documentations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoExpand
(int r) void
dump
(PrintStream ps) Debugging method to display this entity.expand
(Rational noteDuration, Rational minDuration, Rational maxDuration, @Opt List<Integer> factors) Returns an expansion of the ornament as a list of (scale related)offsets to the central note.int[]
repetitionLimits
(Rational noteDuration, Rational minDuration, Rational maxDuration) Returns the minimal and maximal possible number of repetitions of the central "rep" segment.Methods inherited from class eu.bandm.tscore.base.Entity
addName, dump, getCatalog, getDocumentation, getDocumentation, getDocumentations, getName, getName, getNames, getParser, getParser, setDocumentation, toString, toString
-
Field Details
-
pre
public final int[] preSequence of pitch distances for the pre part of the ornament -
rep
public final int[] repSequence of pitch distances for the main repeated part of the ornament -
post
public final int[] postSequence of pitch distances for the post part of the ornament -
mainNote
public static final int[] mainNoteCan be used as the main part to simply hold the main note. -
nothing
public static final int[] nothingCan be used to make pre or post part not executing.
-
-
Constructor Details
-
Ornament
protected Ornament(EntityCatalog<Ornament> c, Map<String, String> map, int[] pre, int[] rep, int[] post) Only construtor.- Parameters:
c
- the catalog is here a collection of ornamentsmap
- the name of the ornament in different langugagespre
- the sequence of integers describing the pre partrep
- the sequence of integers describing the main part, which can be repeatedpost
- the sequence of integers describing the post part
-
-
Method Details
-
dump
Description copied from class:Entity
Debugging method to display this entity. Called byEntityCatalog.dump(PrintStream)
-
repetitionLimits
Returns the minimal and maximal possible number of repetitions of the central "rep" segment.- Parameters:
noteDuration
- the overall notated duration of the note carrying this ornament.minDuration
- the minimal duration for each played note when executing this ornament.maxDuration
- the maximal duration for each played note when executing this ornament.- Returns:
- array with minimal and maximal repetition counts
-
expand
@Opt public @Opt List<Integer> expand(Rational noteDuration, Rational minDuration, Rational maxDuration, @Opt @Opt List<Integer> factors) Returns an expansion of the ornament as a list of (scale related)offsets to the central note. (= the same encoding as inpre
, etc.)This very simple algorithm prefers the fastest found solution. Other variants are sensible, which e.g. prefer the most complex or least complex metric structure. This algorithm will fail to find a solution (return null) in many cases. A variant which allows the prolongation of one note (e.g. the very last) would generate much more hits.
- Parameters:
noteDuration
- the overall notated duration of the note carrying this ornament.minDuration
- the minimal duration for each played note when executing this ornament.maxDuration
- the maximal duration for each played note when executing this ornament.factors
- allowed division factors which may be applied to approximate the required repetition count. Eg.[9,5]
allows triplets, triplets in triplets. and 5-plets, while[15,7]
allows triplets and 5-plets, even nested, and 7-plets.
-
doExpand
-