Class Generate_1
java.lang.Object
eu.bandm.music.applications.feldproj.Generate_1
Generate a Feldman-type score according to the control value curves given in a
tscore object.
The generated voices have the same name as the input voices.
The input events are pairs of a lower and an upper limit. They may only appear
at TpTops, which correspond to measure bars in the output voice.
Between these values a linear interpolation happens.
Whenever an output event shall start, a random value between these interpolated
limits decides which kind to generate.
The output events are FeldmanProjection_n
events, i.e. aligned to quarters.
Input and output voices share the same TpTop line, and TDivisions are inserted for the
output whenever nevessary (by Generate_1.Agent.write_to_score()
.
Usage: Call fromStream(InputStream, String, MessageReceiver,long)
.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
Contains registers dedicated to one single voice. -
Field Summary
Modifier and TypeFieldDescription(package private) final List<Generate_1.Agent>
Representatives of all input and output voices.protected TpTop
The very first time point of the score.(package private) final Part
The first(=only) part of the input scorestatic final String
To be inserted into the output score.(package private) int
protected TpTop
The very last time point of the input score.protected int
The very last time point of the input score, in 1/4 notes.Interpolated input curve, for every 1/4 time point one value.static final int
To be inserted into the output score.Interpolated input curve, for every 1/4 time point one value.static final Modifiers
Modifiers controlling the parsing process.(package private) final MessageCounter
To abort the generation after severe errors(package private) final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
The drain for all messages.Maps bar numbers / measure numbers to tscore top-level time points, as parsed by the input.(package private) FeldmanProjection_n
The generated resultstatic final Translet.Parser<Integer>
Parser for measure numbers.protected final Translet.Parser<?>
Parser for the value curve "int? "/" int?
".static final String
The name of the generated part.(package private) final RandomStructs
Source of all random values.Start points (measured in 1/4 notes) of all "U" events, to prevent simultaneous starts.Inverse ofnumericName2tpTop
.Maps time points measured in 1/4 notes to tscore time points. -
Constructor Summary
ConstructorDescriptionGenerate_1
(Part part, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Construct an instance for one particular inputPart
of a tscore input source. -
Method Summary
Modifier and TypeMethodDescription(package private) void
Translate the input events (per whole notes) into the interpolated curves (per 1/5 note).static @Opt FeldmanProjection_n
fromFile
(File inputfile, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, long seed) static @Opt FeldmanProjection_n
fromStream
(InputStream inputstream, String sourceIndication, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, long seed) Reads the tscore source data for the meta data and returns the synthetic outScore derived from it.(package private) @Opt FeldmanProjection_n
generate
(long randomSeed) Generates the output score.(package private) TpTop
get_top
(int ganze) Get a TpTop for the time point value given in whole notes..(package private) Tp
get_tp
(int viertel) Get a Tp for the time point value given in 1/4 notes..void
update()
Analyses the parsed raw data ininPart
and generates anGenerate_1.Agent
for every input voice.protected void
First step of interpreting syntactic to semantic contents: Parse the TpTop text in the input tscore to bar numbers, constructing an ordered sequence of TpTops:
-
Field Details
-
partName
The name of the generated part.- See Also:
-
msgr
The drain for all messages. -
msgCount
To abort the generation after severe errors -
modifiers
Modifiers controlling the parsing process. -
numericName2tpTop
Maps bar numbers / measure numbers to tscore top-level time points, as parsed by the input. -
tpTop2numericName
Inverse ofnumericName2tpTop
. -
firstTp
The very first time point of the score. Must carry an event with both values min and max. (Must be of type "TpTop" due to the syntax of the general tscore format.) -
lastTp
The very last time point of the input score. This must carry an event with both values min and max. It marks the last time point where in the result an event may begin. (Must be of type "TpTop" due to the syntax of the general tscore format.) -
lastViertel
protected int lastViertelThe very last time point of the input score, in 1/4 notes. -
maxValues
Interpolated input curve, for every 1/4 time point one value. -
minValues
Interpolated input curve, for every 1/4 time point one value. -
parse_barNumber
Parser for measure numbers. -
parse_values
Parser for the value curve "int? "/" int?
". -
inPart
The first(=only) part of the input score -
random
Source of all random values. -
agents
Representatives of all input and output voices. -
startPoints
Start points (measured in 1/4 notes) of all "U" events, to prevent simultaneous starts. -
outScore
FeldmanProjection_n outScoreThe generated result -
viertel2tp
Maps time points measured in 1/4 notes to tscore time points. -
lastEnd
int lastEnd -
measures_per_page
public static final int measures_per_pageTo be inserted into the output score.- See Also:
-
interstaff_gap
To be inserted into the output score.- See Also:
-
-
Constructor Details
-
Generate_1
public Generate_1(Part part, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Construct an instance for one particular inputPart
of a tscore input source.
-
-
Method Details
-
update_topTps
protected void update_topTps()First step of interpreting syntactic to semantic contents: Parse the TpTop text in the input tscore to bar numbers, constructing an ordered sequence of TpTops: -
update
public void update()Analyses the parsed raw data ininPart
and generates anGenerate_1.Agent
for every input voice. -
get_tp
Get a Tp for the time point value given in 1/4 notes.. Create a new TpTop for all multiples of 4, and generate sub-divisions by 4 for the others. -
get_top
Get a TpTop for the time point value given in whole notes.. -
fillInterpolations
Translate the input events (per whole notes) into the interpolated curves (per 1/5 note). -
generate
Generates the output score. First the input data is checked for completeness and the interpolatons are calculated for each agent. Then the lower three agens and the upper three agents are processed separately: For every time point (measured in 1/4 notes)Generate_1.Agent.generate(int)
is called. Then the result object is generated, all agent data is translated to voice data by invokngGenerate_1.Agent.write_to_score()
. Finally some global "timeless" parameters are stored to the result. -
fromStream
@Opt public static @Opt FeldmanProjection_n fromStream(InputStream inputstream, String sourceIndication, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, long seed) Reads the tscore source data for the meta data and returns the synthetic outScore derived from it. This code creats an instance and invokesupdate()
andgenerate(long)
. The resulting outScore is taken fromoutScore
. -
fromFile
@Opt public static @Opt FeldmanProjection_n fromFile(File inputfile, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, long seed)
-