public class Ornament extends Entity<Ornament> implements Cloneable
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:
Modifier and Type | Field and Description |
---|---|
static int[] |
mainNote
Can be used as the main part to simply hold the main note.
|
static int[] |
nothing
Can be used to make pre or post part not executing.
|
int[] |
post
Sequence of pitch distances for the post part of the ornament
|
int[] |
pre
Sequence of pitch distances for the pre part of the ornament
|
int[] |
rep
Sequence of pitch distances for the main repeated part of the ornament
|
catalog, documentations
Modifier | Constructor and Description |
---|---|
protected |
Ornament(EntityCatalog<Ornament> c,
Map<String,String> map,
int[] pre,
int[] rep,
int[] post)
Only construtor.
|
Modifier and Type | Method and Description |
---|---|
protected List<Integer> |
doExpand(int r) |
void |
dump(PrintStream ps)
Debugging method to display this entity.
|
@Opt List<Integer> |
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.
|
addName, dump, getCatalog, getDocumentation, getDocumentation, getDocumentations, getName, getName, getNames, getParser, getParser, setDocumentation, toString
public final int[] pre
public final int[] rep
public final int[] post
public static final int[] mainNote
public static final int[] nothing
protected Ornament(EntityCatalog<Ornament> c, Map<String,String> map, int[] pre, int[] rep, int[] post)
c
- the catalog is here a collection of ornamentsmap
- the name of the ornament in different langugagespre
- the sequence of integers describing the pre partmain
- the sequence of integers describing the main partpost
- the sequence of integers describing the post partpublic void dump(PrintStream ps)
Entity
EntityCatalog.dump(PrintStream)
public int[] repetitionLimits(Rational noteDuration, Rational minDuration, Rational maxDuration)
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.@Opt public @Opt List<Integer> expand(Rational noteDuration, Rational minDuration, Rational maxDuration, @Opt @Opt List<Integer> factors)
pre
, 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.
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.