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 Summary
Modifier and TypeClassDescriptionprotected class
Represents one score voice during the translateion process.static enum
The possible methods for pitch selection -
Field Summary
Modifier and TypeFieldDescriptionprotected List<MidiInterpretation2.Agent>
List of all event-generating agents (i.e.(package private) PcSet
Keeps track of the last used pc set for repetition minimization of all pitch select methods (except "free").(package private) final MidiInterpretation2.Method
Selects the method for pitch selection(package private) final MessageReceiver<SimpleMessage<?>>
Receiver for error messagesprotected int
Panorama position for the next added voice.(package private) final PcSet
The overall set of allowed pitch classesprotected final RandomStructs
Central source of random numbersprotected final FeldmanProjection_n
The data to translateprotected final Sequence
Complete midi result.final int
For calculation the midi timingfinal Rational
For calculation the midi timing. -
Constructor Summary
ConstructorDescriptionMidiInterpretation2
(FeldmanProjection_n score, MessageReceiver<SimpleMessage<?>> msg, PcSet pcSet, Long randomSeed, MidiInterpretation2.Method method) Only constructor -
Method Summary
Modifier and TypeMethodDescription(package private) void
Generate the page turning events into a dedicated track.void
addVoice
(Vox vox, MidiInstrument mi, boolean samePos) void
addVoice
(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) BitSet
Calculate the set of midi keys allowed according to the minimal and maximal midi key and the set of allowed pitch classes.(package private) void
emitEvent
(MidiInterpretation2.Agent a, Event event, int pitch) Fundamental aux method to generate one midi event for one key.void
generate()
Service Access Point: perform the data generation.(package private) void
All voices are composed a priori and repetition minimizing is applied to all voices together, stepping through the time points.(package private) PcSet
generateEvents
(MidiInterpretation2.Agent agent, Event event) Fundamental event generatsion, used by the three strategies with repetition ban.(package private) void
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)(package private) void
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.(package private) void
generateImpro_group
(List<MidiInterpretation2.Agent> agentSet) Improvistiaon of a sub-group of instruments.(package private) void
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 ofcurrentPcs
and register.(package private) int
Inquire score data.(package private) BitSet
getPool
(MidiInterpretation2.Agent a, Event event) Inquire score and local data.(package private) int
getRegister
(Event event) Inquire score data.
-
Field Details
-
score
The data to translate -
msg
Receiver for error messages -
pcSet
The overall set of allowed pitch classes -
randomStructs
Central source of random numbers -
method
Selects the method for pitch selection -
ticksPerQuarter
public final int ticksPerQuarterFor calculation the midi timing- See Also:
-
ticksPerWhole
For calculation the midi timing. One vertical separator in Feldman's notation is read as one 4/4 measure. -
sequence
Complete midi result. -
agents
List of all event-generating agents (i.e. voices) -
nextPosition
protected int nextPositionPanorama position for the next added voice. -
currentPcs
PcSet currentPcsKeeps track of the last used pc set for repetition minimization of all pitch select methods (except "free").
-
-
Constructor Details
-
MidiInterpretation2
public 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 viaaddVoice(eu.bandm.tscore.model.Vox, eu.bandm.music.applications.feldproj.MidiInstrument, boolean)
.)msg
- for error messagespcSet
- overall set of allowed pitch classesrandomSeed
- start point for all necessary random operationsmethod
- selects the method for pitch selection
-
-
Method Details
-
addVoice
-
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 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()
. -
getMulti
Inquire score data.- Returns:
- chordsize as stored in score, or 1 as default.
-
getRegister
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
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
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 ofcurrentPcs
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 nameGenerate_1.partName
. (The second study uses the method "one pitch only"; the third "instrument" with dodecaphonic series.) -
generateImpro_group
Improvistiaon of a sub-group of instruments.- See Also:
-
generateEvents
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 topcSet
. The invoker can detect this from the return value. The MIDI events are stored in theMidiInterpretation2.Agent.track
of 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!
-
emitEvent
Fundamental 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 flagevent
- determines ontime and offtiem and switches between ordinario and pizzicato, all this together with global score information topitch
- 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
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 ofKeyboard
.- Parameters:
classes
- allowed pitch classesmin
- midi key number, is INCLUSIVEmax
- midi key number, is INCLUSIVE- Returns:
- a set of midi key numbers
-