Class MidiInterpretation2

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

public class MidiInterpretation2 extends Object
Translate a Feldman-Projection-n score model into a midi score for playing. It can be chosen among four different composition principles.

Usage:

  1. cosntruct an instance
  2. invoke addVoice(eu.bandm.tscore.model.Vox, eu.bandm.music.applications.feldproj.MidiInstrument, boolean) for all voices in their intended sequential order (parnorama position from left to right)
  3. invoke generate()
  4. get the midi result as the vaue of sequence.
  • Field Details

    • score

      protected final FeldmanProjection_n score
      The data to translate
    • msg

      Receiver for error messages
    • pcSet

      final PcSet pcSet
      The overall set of allowed pitch classes
    • randomStructs

      protected final RandomStructs randomStructs
      Central source of random numbers
    • method

      Selects the method for pitch selection
    • ticksPerQuarter

      public final int ticksPerQuarter
      For calculation the midi timing
      See Also:
    • ticksPerWhole

      public final Rational ticksPerWhole
      For calculation the midi timing. One vertical separator in Feldman's notation is read as one 4/4 measure.
    • sequence

      protected final Sequence sequence
      Complete midi result.
    • agents

      protected List<MidiInterpretation2.Agent> agents
      List of all event-generating agents (i.e. voices)
    • nextPosition

      protected int nextPosition
      Panorama position for the next added voice.
    • currentPcs

      PcSet currentPcs
      Keeps track of the last used pc set for repetition minimization of all pitch select methods (except "free").
  • Constructor Details

  • Method Details

    • addVoice

      public void addVoice(Vox vox, MidiInstrument mi, boolean samePos)
    • addVoice

      public void addVoice(Vox vox, MidiInstrument mi, @Opt @Opt MidiInstrument mi_harmonic, boolean samePos)
      Add the given voice with two instrument descriptions: one for "normal" events and the other for those marked "harmonics" in the score data.
      Parameters:
      samePos - whether this voice is played by the same instrument than its predecssor, and thus sounds at the same panorama position.
    • generate

      public void generate()
      Service Access Point: perform the data generation. Is called after all voices have been added. The result can be retrieved from sequence. First the panorama positions are calculated. Then each track (one per agent) gets the initial data: general midi instrument number and panorama position. Then the noteon and noteoff events are generated according to the selected method. Finally the turn points are added in a dedicated track by addTimeCodes().
    • getMulti

      int getMulti(Event event)
      Inquire score data.
      Returns:
      chordsize as stored in score, or 1 as default.
    • getRegister

      int getRegister(Event event)
      Inquire score data.
      Returns:
      encoded register 0 = low, 1 = middle, 2 = high as stored in score.
    • getPool

      Inquire score and local data.
      Returns:
      the unmodifialbe base set (as prepared by init) of "normal" or "harnomics" midi instrment, of the current register, both determined by the score data.
    • generateFree

      void generateFree(MidiInterpretation2.Agent a)
      Each event makes a free selection from the pitches from the correspoding key set, as determined by the score date (which register and whether harmonics)
    • generateInstr

      void generateInstr(MidiInterpretation2.Agent agent)
      Each score voice (corresponds to one Agent each) generates its pitch sequence independently, repeating a pitch class (=starting a new permutation cycle) only when unavoidable due to combination of currentPcs and register.
    • generateComp

      void generateComp()
      All voices are composed a priori and repetition minimizing is applied to all voices together, stepping through the time points.
    • generateImpro

      void generateImpro()
      Simulates an improvisation where all players step synchronuosly through the time and miminize repetitions knowing only the preceding decisions of the others and the current own decision. ATTENTION: The "Drei kleine Studien nach Morton Feldman" are carried out in two independent groups (low and high instruments). The first study uses this method and is detected by the PART name Generate_1.partName. (The second study uses the method "one pitch only"; the third "instrument" with dodecaphonic series.)
    • generateImpro_group

      void generateImpro_group(List<MidiInterpretation2.Agent> agentSet)
      Improvistiaon of a sub-group of instruments.
      See Also:
    • generateEvents

      PcSet generateEvents(MidiInterpretation2.Agent agent, Event event)
      Fundamental event generatsion, used by the three strategies with repetition ban. The keys are picked by random from the set of allowed, and their classes are returned, to influence the choices at the following time point. If necessary, the agent=player starts a new cycle by resetting its local pc set to pcSet. The invoker can detect this from the return value. The MIDI events are stored in the MidiInterpretation2.Agent.track of the Agent by calling emitEvent(eu.bandm.music.applications.feldproj.MidiInterpretation2.Agent, eu.bandm.tscore.model.Event, int).
      Returns:
      all pc sets used for this event, possibly from a NEW cycle!
    • emitEvent

      void emitEvent(MidiInterpretation2.Agent a, Event event, int pitch)
      Fundamental aux method to generate one midi event for one key. Is called from generateFree(Agent) and generateEvents(eu.bandm.music.applications.feldproj.MidiInterpretation2.Agent,eu.bandm.tscore.model.Event) Pizzicato is realized by a PROGRAM_CHANGE switch to a UNIVERSAL General Midi program; "ordinario" switches back to the SPEFICIC value in the MidiInstrument
      Parameters:
      a - gives the track, the channel, and the pizzicato flag
      event - determines ontime and offtiem and switches between ordinario and pizzicato, all this together with global score information to
      pitch - the midi key
    • addTimeCodes

      void addTimeCodes()
      Generate the page turning events into a dedicated track. The "SONG_POSITION" message is used with a special format: first data byte is the page to show, second data byte is the offset (from +4 to 0) how many 1/4 notes earlier the page shall be turned:
             pg1                                         pg2     
             1        2        3        4                5         6      7      ||
             (1,0)                                       (2,0)
             (1,1)                                  (2,1)
             (1,2)                              (2,2)
             (1,3)                          (2,3)
             (1,4)                      (2,4)
        
      The receiving code filters by the second data byte equal to the selected page turn mode.
    • combine

      BitSet combine(PcSet classes, int min, int max)
      Calculate the set of midi keys allowed according to the minimal and maximal midi key and the set of allowed pitch classes. Assumes that c in the pcset and in the midi keys both is equal to 0 modulo 12! See documentation of Keyboard.
      Parameters:
      classes - allowed pitch classes
      min - midi key number, is INCLUSIVE
      max - midi key number, is INCLUSIVE
      Returns:
      a set of midi key numbers