Class Generate_1

java.lang.Object
eu.bandm.music.applications.feldproj.Generate_1

public class Generate_1 extends Object
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).

  • Field Details

    • partName

      public static final String partName
      The name of the generated part.
      See Also:
    • msgr

      final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr
      The drain for all messages.
    • msgCount

      final MessageCounter msgCount
      To abort the generation after severe errors
    • modifiers

      public static final Modifiers modifiers
      Modifiers controlling the parsing process.
    • numericName2tpTop

      public final SortedMap<Integer,TpTop> numericName2tpTop
      Maps bar numbers / measure numbers to tscore top-level time points, as parsed by the input.
    • tpTop2numericName

      protected final Map<TpTop,Integer> tpTop2numericName
      Inverse of numericName2tpTop.
    • firstTp

      protected TpTop 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

      protected TpTop 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 lastViertel
      The very last time point of the input score, in 1/4 notes.
    • maxValues

      protected final Map<Event,Integer> maxValues
      Interpolated input curve, for every 1/4 time point one value.
    • minValues

      protected final Map<Event,Integer> minValues
      Interpolated input curve, for every 1/4 time point one value.
    • parse_barNumber

      public static final Translet.Parser<Integer> parse_barNumber
      Parser for measure numbers.
    • parse_values

      protected final Translet.Parser<?> parse_values
      Parser for the value curve "int? "/" int?".
    • inPart

      final Part inPart
      The first(=only) part of the input score
    • random

      final RandomStructs random
      Source of all random values.
    • agents

      final List<Generate_1.Agent> agents
      Representatives of all input and output voices.
    • startPoints

      final Set<Integer> startPoints
      Start points (measured in 1/4 notes) of all "U" events, to prevent simultaneous starts.
    • outScore

      The generated result
    • viertel2tp

      final Map<Integer,Tp> 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_page
      To be inserted into the output score.
      See Also:
    • interstaff_gap

      public static final String 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 input Part 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 in inPart and generates an Generate_1.Agent for every input voice.
    • get_tp

      Tp get_tp(int viertel)
      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

      TpTop get_top(int ganze)
      Get a TpTop for the time point value given in whole notes..
    • fillInterpolations

      void fillInterpolations(Vox voice, Map<Event,Integer> src, Map<Integer,Integer> interpol)
      Translate the input events (per whole notes) into the interpolated curves (per 1/5 note).
    • generate

      @Opt @Opt FeldmanProjection_n generate(long randomSeed)
      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 invokng Generate_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 invokes update() and generate(long). The resulting outScore is taken from outScore.
    • fromFile

      @Opt public static @Opt FeldmanProjection_n fromFile(File inputfile, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, long seed)