public class Score_hkn.Expansion extends Object
RelWert
.
ADDITIONAL Tps may be synthesized, if necessary. All Tps are found in tps
.
The corresponding expanded data is expanded
.
For convenience of the calling code, which realizes the specific interpretation of a bundle of voices for different parameters, a voice reference==null may be included, which means that no voice has been assigned to a particular parameter. This will be excluded before any procesing.
Usage: Create an instance (giving all voices to take part)
and call expand()
.
The subsequent application-specific evaluations work exclusively on
tps
and expanded
, which run in parallel.
Modifier and Type | Field and Description |
---|---|
Map<Vox,List<RelWert>> |
expanded
Main result of expansion: a list of expanded RelWert per Vox.
|
protected boolean |
isExpanded
Flag that the expanded values are valid.
|
(package private) Set<Tp> |
oneMore
Temporary set of Tps before which one additional tp must be synthesized
for the expansion of a Haken.
|
(package private) Set<Tp> |
oneMoreOrNext
Temporary set of Tps before which an additional tp must be synthesized,
or indeterminstically before its successor.
|
List<Tp> |
tps
All time points taking part in this Expansion.
|
(package private) Set<Tp> |
twoMore
Temporary set of Tps before which two additional tp-s must be synthesized
for the expansion of a Haken.
|
Set<Vox> |
voices
All voices taking part in this expansion, as given finally on constrcution.
|
Constructor and Description |
---|
Expansion(Set<Vox> voices)
Gives the set of voices, the data and time points of which shall be considered.
|
Expansion(Vox... voices)
Gives the set of voices, the data and time points of which shall be considered.
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectAdditionalTpRequirements(Vox v)
Collect all requirements of additional Tps into global output registers.
|
protected void |
collectTps(Set<Tp> res,
Vox v)
Collect all Tps of all events of the given voice into one set.
|
protected void |
dhPut(List<RelWert> result,
RelWert v,
int c)
Put one segement of a DoppelHaken
|
void |
dump(PrintStream os)
Auxiliary print of all voices and their values, for debugging and demonstration.
|
protected void |
expand()
Translates sybolic input voices (="K-Voices", containing RelWert, Haken and
Doppelhaken references as their events) to sequences of RelWert,
for a set of K-voices which together define one instrument.
|
protected void |
expandHaken(Vox v,
List<RelWert> result)
Returns a list of
RelWert values by copying these from the K-voice
input and translating all Haken and DoppelHaken into these. |
protected void |
flushPendingDoppelHaken(List<RelWert> result,
int length,
@Opt Event doppelhaken,
boolean forceOverlap,
boolean mayOverlap)
Expand the last recognized
DoppelHaken to a sequence of single "O/M/U"
RelWert events,
Fills the time from its start up to "currentPos", because the
next haken/event (or the end of input) is reached in the K-voice (=symbolic input voice). |
protected void |
flushPendingHaken(List<RelWert> result,
int length,
@Opt Event haken,
boolean forceOverlap)
|
protected void |
makeTps(ListIterator<Tp> it,
Tp tp0,
Tp tp1,
int cnt)
Instert additional synthetic time points as needed for the expansion
of a Haken.
|
public final List<Tp> tps
Score_hkn.tp2rat
.
Synthesized new Tp-s are entered there and here.public final Set<Vox> voices
public final Map<Vox,List<RelWert>> expanded
tps
.protected boolean isExpanded
Set<Tp> oneMore
Set<Tp> twoMore
public Expansion(Set<Vox> voices)
public void dump(PrintStream os)
protected void makeTps(ListIterator<Tp> it, Tp tp0, Tp tp1, int cnt)
tps
.
Score_hkn.tp2rat
, which always
matters only w.r.t. the sequential order.
ATTENTION: Tps created here are NOT related to Tps in other, parallel K-voices, even of the same configuration. (This will not do any harm as long as they will be evaluated K-voice by K-voice, when generating the V-voices.)
it
- is an output parameter used for changing the list tps
.
It is the ListIterator
contolled by Util.Pairwise
and
currently (on entering this method) points to the successor of the later item "tp1".
It is used for inserting in to the underlying list of time points by
ListIterator.add(Object)
, but reset to its entering value when returing.tp0
- after which the synthetic tp-s shall be entered.tp1
- on call time: the successor of tp0 = the node before which the
synthetic tp-s shall be entered.cnt
- number by which the interval tp1-tp0 shall be divided,
i.e. one larger than the number of new synthetic nodes.protected void expand()
tps
.
expanded
.
isExpanded
.IllegalStateException
- if called twice.protected void collectTps(Set<Tp> res, Vox v)
protected void collectAdditionalTpRequirements(Vox v)
0 1 2 3 M M M M OM O => dist>=3 => nothing required. OM M => dist=2 and overlap => nothing required. OM O => dist=2 and no overlap => require 1 additional before pos 1 OR or 1 additional before pos 2, NOT DETERMIN! OM M => dist=1 and overlap => require 1 additional before pos 1 OM O => dist=1 and no overlap => require 2 additional before pos 1 OM 'MU => dto., overlap explicitly forbidden.Has only any effect if distance from a Haken to its successor K-event is <=2. In this case "overlapping" is considered true, if the values permit and not forbidden by
Score_hkn.event2noOverlap_start
.
Attention: Currently only Haken, not
DoppelHaken
do cause additional Timepoints
to be synthesized. (The degree of freedom with overlapping DoppelHaken can become
so large that humans cannot control the consequences anymore!-)
protected void expandHaken(Vox v, List<RelWert> result)
RelWert
values by copying these from the K-voice
input and translating all Haken
and DoppelHaken
into these.
Input is a list of Tp
(time points) which are all time points which have
to be filled, i.e. after additionally required Tps have been synthesized.
The expansion process will generate overlaps iff it is necessary by missing space
or explicitly requested by event2forceOverlap_end
.v
- the voice to expand. For convenience of the calling code, which realizes
the specific interpretation of a bundle of voices for different parameters,
a value v==null means that no voice has been assigned to a particular parameter
and a sequence of RelWert.M
of the approriate length is returned.protected void flushPendingHaken(List<RelWert> result, int length, @Opt @Opt Event haken, boolean forceOverlap)
Haken
to a sequence of single "O/M/U"
RelWert
events,
Fills the time from its start up to "currentPos", because the
next haken/event (or the end of input) is reached in the K-voice (=symbolic input voice).
An overlap is only done when forced by explicit K-Input (reflected in parameter
"forceOverlap") or if space is <3.result
- the list of RelWert, grown exaxtly to the start point of the Haken to expand.length
- the number of tp to realize this Hakenhaken
- the event which carries this haken info (for getting location and form
of Haken)forceOverlap
- if overlap requested explicitly by the tscore input.protected void flushPendingDoppelHaken(List<RelWert> result, int length, @Opt @Opt Event doppelhaken, boolean forceOverlap, boolean mayOverlap)
DoppelHaken
to a sequence of single "O/M/U"
RelWert
events,
Fills the time from its start up to "currentPos", because the
next haken/event (or the end of input) is reached in the K-voice (=symbolic input voice).
0 1 2 3 4 5 6 MUM M overlap M O U O M MUM 'M no overlap M O U O M M MUUM M overlap M O U U O M MUUM 'M no overlap M O U U O M MNo additional space has been synthesized (as for Haken), but parallel K-voices must provide the required space. An overlap is forced by explicit notation in the K-voice input or can be caused by lack of space (NOT IMPLEMENTED FIXME)
result
- where to put the expansion RelWertlength
- how many Tp-s will be filled by the expansiondoppelhaken
- the Event, for getting Location and form of DoppelHakenforceOverlap
- whether the K-voice input contains the operator "tilde" for
the end of the DoppelHaken, as in "MOM~".mayOverlap
- whether the DoppelHaken ends with the same RelWert as its successor
begins.