Class Score_hkn.Expansion
- Enclosing class:
- Score_hkn
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.
-
Field Summary
Modifier and TypeFieldDescriptionMain result of expansion: a list of expanded RelWert per Vox.protected boolean
Flag that the expanded values are valid.Temporary set of Tps before which one additional tp must be synthesized for the expansion of a Haken.Temporary set of Tps before which an additional tp must be synthesized, or indeterminstically before its successor.All time points taking part in this Expansion.Temporary set of Tps before which two additional tp-s must be synthesized for the expansion of a Haken.All voices taking part in this expansion, as given finally on constrcution. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
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
Put one segement of a DoppelHakenvoid
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 ofRelWert
values by copying these from the K-voice input and translating allHaken
andDoppelHaken
into these.protected void
flushPendingDoppelHaken
(List<RelWert> result, int length, @Opt Event doppelhaken, boolean forceOverlap, boolean mayOverlap) Expand the last recognizedDoppelHaken
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.
-
Field Details
-
tps
All time points taking part in this Expansion. The list is a subset of all Tps occuring in the tscore, as given byScore_hkn.tp2rat
. Synthesized new Tp-s are entered there and here. -
voices
All voices taking part in this expansion, as given finally on constrcution. (No null is contained) -
expanded
Main result of expansion: a list of expanded RelWert per Vox. Those lists run all in parallel (same index = same event) and in parallel withtps
. -
isExpanded
protected boolean isExpandedFlag that the expanded values are valid. -
oneMore
Temporary set of Tps before which one additional tp must be synthesized for the expansion of a Haken. -
twoMore
Temporary set of Tps before which two additional tp-s must be synthesized for the expansion of a Haken. -
oneMoreOrNext
Temporary set of Tps before which an additional tp must be synthesized, or indeterminstically before its successor.
-
-
Constructor Details
-
Expansion
Gives the set of voices, the data and time points of which shall be considered. For convenience of the calle, the set may contain the value null which will be removed. -
Expansion
Gives the set of voices, the data and time points of which shall be considered. For convenience of the calle, the set may contain the value null which will be removed.
-
-
Method Details
-
dump
Auxiliary print of all voices and their values, for debugging and demonstration. -
makeTps
Instert additional synthetic time points as needed for the expansion of a Haken. The time points are inserted in the network of TDivision, (which is global to the underlying t-score) and in the local listtps
.
Every new time point gets its rational value (inScore_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.)
- Parameters:
it
- is an output parameter used for changing the listtps
. It is theListIterator
contolled byIterators.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 byListIterator.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.
-
expand
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. (Pauses contained in a voice are ignored.)- First collect all tps appearing in any event in any voice.
- Then synthesize additional time points for hook expansion, if necessary.
The final sequence of Tps will be contained in
tps
. - Finally expand the haken and doppelhaken in the K-voices into sequences of RelWert,
which will be contained in
expanded
.
isExpanded
.- Throws:
IllegalStateException
- if called twice.
-
collectTps
Collect all Tps of all events of the given voice into one set. -
collectAdditionalTpRequirements
Collect all requirements of additional Tps into global output registers. (The actual generation of these time points is done after all voices have benn asked.) The necessity is calculated by the distance to the preceding Haken, measures in (currently exisitng) time points. Examples of K-tps and K-events for the necessity to synthesize time points: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 byScore_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!-) -
expandHaken
Returns a list ofRelWert
values by copying these from the K-voice input and translating allHaken
andDoppelHaken
into these. Input is a list ofTp
(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 byScore_hkn.event2forceOverlap_end
.- Parameters:
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 ofRelWert.M
of the approriate length is returned.
-
flushPendingHaken
protected void flushPendingHaken(List<RelWert> result, int length, @Opt @Opt Event haken, boolean forceOverlap) Expand the last recognizedHaken
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.- Parameters:
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.
-
flushPendingDoppelHaken
protected void flushPendingDoppelHaken(List<RelWert> result, int length, @Opt @Opt Event doppelhaken, boolean forceOverlap, boolean mayOverlap) Expand the last recognizedDoppelHaken
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 M
No 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)- Parameters:
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.
-
dhPut
Put one segement of a DoppelHaken- Parameters:
result
- where to add.v
- the value to add.c
- number of positions to add, maybe == null.
-