Class MidiInterpretation2
java.lang.Object
eu.bandm.music.applications.feldproj.MidiInterpretation2
Translate a Feldman-Projection-n score model into a midi score for playing.
  It can be chosen among four different composition principles. 
  
Usage:
- cosntruct an instance
-  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)
-  invoke generate()
-  get the midi result as the vaue of sequence.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classRepresents one score voice during the translateion process.static enumThe possible methods for pitch selection
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected List<MidiInterpretation2.Agent> List of all event-generating agents (i.e.(package private) PcSetKeeps track of the last used pc set for repetition minimization of all pitch select methods (except "free").(package private) final MidiInterpretation2.MethodSelects the method for pitch selection(package private) final MessageReceiver<SimpleMessage<?>> Receiver for error messagesprotected intPanorama position for the next added voice.(package private) final PcSetThe overall set of allowed pitch classesprotected final RandomStructsCentral source of random numbersprotected final FeldmanProjection_nThe data to translateprotected final SequenceComplete midi result.final intFor calculation the midi timingfinal RationalFor calculation the midi timing.
- 
Constructor SummaryConstructorsConstructorDescriptionMidiInterpretation2(FeldmanProjection_n score, MessageReceiver<SimpleMessage<?>> msg, PcSet pcSet, Long randomSeed, MidiInterpretation2.Method method) Only constructor
- 
Method SummaryModifier and TypeMethodDescription(package private) voidGenerate the page turning events into a dedicated track.voidaddVoice(Vox vox, MidiInstrument mi, boolean samePos) voidaddVoice(Vox vox, MidiInstrument mi, @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.(package private) BitSetCalculate the set of midi keys allowed according to the minimal and maximal midi key and the set of allowed pitch classes.(package private) voidemitEvent(MidiInterpretation2.Agent a, Event event, int pitch) Fundamental aux method to generate one midi event for one key.voidgenerate()Service Access Point: perform the data generation.(package private) voidAll voices are composed a priori and repetition minimizing is applied to all voices together, stepping through the time points.(package private) PcSetgenerateEvents(MidiInterpretation2.Agent agent, Event event) Fundamental event generatsion, used by the three strategies with repetition ban.(package private) voidEach event makes a free selection from the pitches from the correspoding key set, as determined by the score date (which register and whether harmonics)(package private) voidSimulates 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.(package private) voidgenerateImpro_group(List<MidiInterpretation2.Agent> agentSet) Improvistiaon of a sub-group of instruments.(package private) voidEach 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 ofcurrentPcsand register.(package private) intInquire score data.(package private) BitSetgetPool(MidiInterpretation2.Agent a, Event event) Inquire score and local data.(package private) intgetRegister(Event event) Inquire score data.
- 
Field Details- 
scoreThe data to translate
- 
msgReceiver for error messages
- 
pcSetThe overall set of allowed pitch classes
- 
randomStructsCentral source of random numbers
- 
methodSelects the method for pitch selection
- 
ticksPerQuarterpublic final int ticksPerQuarterFor calculation the midi timing- See Also:
 
- 
ticksPerWholeFor calculation the midi timing. One vertical separator in Feldman's notation is read as one 4/4 measure.
- 
sequenceComplete midi result.
- 
agentsList of all event-generating agents (i.e. voices)
- 
nextPositionprotected int nextPositionPanorama position for the next added voice.
- 
currentPcsPcSet currentPcsKeeps track of the last used pc set for repetition minimization of all pitch select methods (except "free").
 
- 
- 
Constructor Details- 
MidiInterpretation2public MidiInterpretation2(FeldmanProjection_n score, MessageReceiver<SimpleMessage<?>> msg, PcSet pcSet, Long randomSeed, MidiInterpretation2.Method method) Only constructor- Parameters:
- score- the data to translate (the voices to include must be passed separately in the intended sequential order via- addVoice(eu.bandm.tscore.model.Vox, eu.bandm.music.applications.feldproj.MidiInstrument, boolean).)
- msg- for error messages
- pcSet- overall set of allowed pitch classes
- randomSeed- start point for all necessary random operations
- method- selects the method for pitch selection
 
 
- 
- 
Method Details- 
addVoice
- 
addVoicepublic 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.
 
- 
generatepublic void generate()Service Access Point: perform the data generation. Is called after all voices have been added. The result can be retrieved fromsequence. 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 selectedmethod. Finally the turn points are added in a dedicated track byaddTimeCodes().
- 
getMultiInquire score data.- Returns:
- chordsize as stored in score, or 1 as default.
 
- 
getRegisterInquire score data.- Returns:
- encoded register 0 = low, 1 = middle, 2 = high as stored in score.
 
- 
getPoolInquire 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.
 
- 
generateFreeEach event makes a free selection from the pitches from the correspoding key set, as determined by the score date (which register and whether harmonics)
- 
generateInstrEach 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 ofcurrentPcsand register.
- 
generateCompvoid generateComp()All voices are composed a priori and repetition minimizing is applied to all voices together, stepping through the time points.
- 
generateImprovoid 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 nameGenerate_1.partName. (The second study uses the method "one pitch only"; the third "instrument" with dodecaphonic series.)
- 
generateImpro_groupImprovistiaon of a sub-group of instruments.- See Also:
 
- 
generateEventsFundamental 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 topcSet. The invoker can detect this from the return value. The MIDI events are stored in theMidiInterpretation2.Agent.trackof the Agent by callingemitEvent(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!
 
- 
emitEventFundamental aux method to generate one midi event for one key. Is called fromgenerateFree(Agent)andgenerateEvents(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 theMidiInstrument- 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
 
- 
addTimeCodesvoid 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.
- 
combineCalculate 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 ofKeyboard.- Parameters:
- classes- allowed pitch classes
- min- midi key number, is INCLUSIVE
- max- midi key number, is INCLUSIVE
- Returns:
- a set of midi key numbers
 
 
-