public class MTreeSpec extends MTree_<MTreeSpec>
MTree
, as constructed by a user.
The fields defining the duration values need not be completely filled, but
must be free of conflicts and allow un-ambiguous completion.MTreeSpec
and then calls
MTree.install(MTreeSpec,MTree.Parameters)
to expand it to an MTree
.Modifier and Type | Field and Description |
---|---|
protected static Function3<Integer,Integer,MTreeSpec,MTreeSpec> |
packDivTree |
protected static BiFunction<Integer,MTreeSpec,MTreeSpec> |
packMul |
protected static Function<Integer,MTreeSpec> |
packSimple |
protected static Translet.Parser<MTreeSpec> |
parser_alt |
protected static Translet.Parser<MTreeSpec> |
parser_concat |
static Translet.Parser<MTreeSpec> |
parser_summand |
protected static Translet.Recursive<MTreeSpec> |
parser_summand_recursive |
static Translet.Parser<MTreeSpec> |
parser_timed |
alternative, duration, end, equidist, explicitDuration, implicit, initialized, parent, position, start, subs
Constructor and Description |
---|
MTreeSpec(int num,
int den,
MTreeSpec... args)
Create one node with arg nodes as sub-nodes, and an explicit duration.
|
MTreeSpec(List<MTreeSpec> args)
Create one node with arg nodes as sub-nodes.
|
MTreeSpec(MTreeSpec... args)
Create one node with arg nodes as sub-nodes.
|
MTreeSpec(Rational rat,
List<MTreeSpec> args)
Create one node with arg nodes as sub-nodes, and an explicit duration.
|
MTreeSpec(Rational rat,
MTreeSpec... args)
Create one node with arg nodes as sub-nodes, and an explicit duration.
|
Modifier and Type | Method and Description |
---|---|
MTreeSpec |
initialize()
|
MTreeSpec |
initialize(Modifiers.Reaction redundantDuration)
Delivers an initialized, ready to use new copy of the given MTreeSpec.
|
static @Opt MTreeSpec |
parseAndInitialize(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg,
String s)
Create one top node and all described sub nodes by parsing a specification text.
|
static Translet.Parser<MTreeSpec> |
parser() |
protected MTreeSpec |
self()
Necessary to avoid "unchecked cast" warning when returning "this" instance
in the parameterized superclass
MTree_ . |
addAlternative, calcStartEnd, compoundName, constantRationalMeasureDuration, copyTimeValues, dump, dump, dump, durationName, get_alternative, get_duration, get_end, get_explicitDuration, get_implicit, get_initialized, get_parent, get_position, get_size_binary, get_size, get_start, get_subs, getFollowing, getFollowingSibling, getPrecedingSibling, getTopNode, is_equi_binary, isFollowingSiblingOf, propagateDown_alt, propagateDown, propagateUp, toString
protected static BiFunction<Integer,MTreeSpec,MTreeSpec> packMul
protected static final Translet.Recursive<MTreeSpec> parser_summand_recursive
protected static final Translet.Parser<MTreeSpec> parser_concat
protected static final Translet.Parser<MTreeSpec> parser_alt
public static Translet.Parser<MTreeSpec> parser_timed
public static Translet.Parser<MTreeSpec> parser_summand
public MTreeSpec(List<MTreeSpec> args)
public MTreeSpec(MTreeSpec... args)
public MTreeSpec(Rational rat, List<MTreeSpec> args)
public MTreeSpec(int num, int den, MTreeSpec... args)
protected MTreeSpec self()
MTree_
.public MTreeSpec initialize(Modifiers.Reaction redundantDuration)
MTree_.duration
fields are set.
The durations of the children of such a node are calculated by equidistant
division.
The duration of a node where all childern have a duration is by summing them up.
After all durations have been set, the start positions are defined by summing up
the preceding siblings.
The user is free to define durations at very different positions of a fresh
MTreeSpec, before calling the method. This may result in inconsistencies,
which are signalled as exceptions.
Esp. when tuplets shall be combined, durations must be inserted explicitly.
new MTreeSpec(new MTreeSpec (3,4, new MTreeSpec(), new MTreeSpec(), new MTreeSpec()), new MTreeSpec (2,4, new MTreeSpec(), new MTreeSpec(), new MTreeSpec()) ):... defines a measure with three(3) quarter notes (1/4) in its first part, and three(3) quarter triplets(1/6) in its second part.
p=dp p=dp p=? / \ \ / \ \ / \ \ x=? y=? z=? x=dx y=? z=dz x=dx y=dy z=dz
redundantDuration
- how to react when the duration of a particular node is
defined by more than one(>1) sources to the same value.public MTreeSpec initialize()
@Opt public static @Opt MTreeSpec parseAndInitialize(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s)
public static Translet.Parser<MTreeSpec> parser()