|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbodhidharma.midi_parsing.MIDIIntermediateRepresentations
public class MIDIIntermediateRepresentations
Part of the Bodhidharma automatic music classification project. Objects of this class take in the path of a MIDI file when they are constructed and automatically parse the file. The fields are then filled with a number of different representations of the MIDI file and statistics about it. These fields can then be accessed by Feature objects in order to derive their values, so they don't have to access the MIDI file itself.
Important Notes:
- Patches are numbered one unit lower here than in their General MIDI patch names, so remember to raise by one when processing.
- Channesl are numbered 1 lower here than in real MIDI, so check for channel 9 when actually looking for channel 10.
- The data starts at tick 0.
- MIDI files that use SMPTE time encoding are not compatible with this software.
Feature
,
Sequence
,
Track
,
MidiEvent
,
MidiMessage
,
MetaMessage
,
ShortMessage
Field Summary | |
---|---|
double[] |
basic_pitch_histogram
A normalized histogram with bins corresponding to MIDI pitches (0 to 127). |
int[][] |
channel_statistics
A table with rows (first indice) corresponding to channels and the following column designations: |
boolean[][] |
channel_tick_map
A table with rows (first indice) corresponding to MIDI ticks in the MIDI file. |
double[] |
fifths_pitch_histogram
A normalized histogram with bins corresponding to MIDI pitch classes (0 to 11). |
double[] |
melodic_histogram
A normalized histogram with bins corresponding to melodic intervals measured in number of semi-tones. |
java.util.LinkedList[] |
melody_list
An array of lists of all melodic intervals occuring in each channel. |
java.lang.Object[] |
meta_data
A listing of meta information. |
int[] |
non_pitched_instrumentation_frequencies
An array whose indice corresponds to patches from the MIDI Percussion Key Map. |
boolean[][] |
note_beginnings_map
A table with rows corresponding to MIDI ticks and columns corresponding to MIDI channels. |
java.util.LinkedList |
note_durations
A list of the durations of all notes in seconds. |
int[][] |
note_loudnesses
Gives the loudnesses of all notes. |
java.util.LinkedList |
pitch_bends_list
A list of lists of pitch bends associated with notes. |
double[] |
pitch_class_histogram
A normalized histogram with bins corresponding to MIDI pitch classes (0 to 11). |
int[][] |
pitched_instrumentation_frequencies
A table with rows (first indice) corresponding to General MIDI pitched patch numbers. |
boolean[][] |
pitched_instrumentation_tick_map
A table with rows (first indice) corresponding to MIDI ticks in the MIDI file. |
int |
recording_length
The length in seconds of the recording |
double[] |
rhythmic_histogram
A normalized histogram with bins corresponding to beats per minute. |
double[][] |
rhythmic_histogram_table
Table with rows (first indice) corresponding to the bins of rhythmic_histogram. |
double[] |
seconds_per_tick
An array with an entry for each tick. |
int |
total_number_notes
The total number of Note Ons in the recording. |
int |
total_number_pitched_notes
The total number of Note Ons in the recording that were played using a General MIDI pitched instrument. |
int |
total_number_unpitched_notes
The total number of Note Ons in the recording that were played using a General MIDI Percussion Key Map instrument. |
double[][] |
volumes
A table with rows (first indice) corresponding to MIDI ticks in the MIDI file. |
Constructor Summary | |
---|---|
MIDIIntermediateRepresentations(java.lang.String midi_file_path)
Parses the given MIDI file and fills the fields with the appropriate values extracted from this file. |
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.Object[] meta_data
Indice 0: Quality stored as an Integer. 0 indicates major, 1 indicates minor and 0 indicates that no key signature is given. NOTE: assumes only one key signature metamessage and considers only the first.
Indice 1: LinkedList of all time signature numerators in the order that they appeared (as Integers).
Indice 2: LinkedList of all time signature denominators in the order that they appeared (as Integers).
Indice 3: Integer storing the initial tempo in beats per minute.
public int[][] pitched_instrumentation_frequencies
public boolean[][] pitched_instrumentation_tick_map
public int[] non_pitched_instrumentation_frequencies
NOTE: values for all 128 note values were collected here, although perhaps only notes 35 to 81 should be used. This is because some recordings actually use these other values, even though they should not. These other values simply duplicate the allowed values.
public int total_number_notes
public int total_number_pitched_notes
public int total_number_unpitched_notes
NOTE: values for all 128 note values were collected here, although perhaps only notes 35 to 81 should be used. This is because some recordings actually use these other values, even though they should not. These other values simply duplicate the allowed values.
public int recording_length
public boolean[][] channel_tick_map
NOTE: this includes channel 10, even though it is understood that channel 10 notes are played using percussion patches, not pitch patches.
public int[][] channel_statistics
Column 0: total number of Note Ons on given channel
Column 1: total amount of time in seconds that one or more notes were sounding on given channel
Column 2: average loudness (velocity scaled by channel volume (still falls between 0 and 127)) of notes on given channel
Column 3: average melodic leap on given channel in semitones (includes accross rests and ignores direction) (will give erroneous values if there is more than one melody per channel or if a channel is polyphonic)
Column 4: lowest MIDI pitch on given channel (value of 1000 means no pithces on given channel)
Column 5: highest MIDI pitch on given channel (value of -1000 means no pithces on given channel)
Column 6: average MIDI pitch on given channel (value of 0 means no pithces on given channel)
NOTE: this includes channel 10, even though it is understood that channel 10 notes are played using percussion patches, not pitch patches.
public double[] rhythmic_histogram
All bins below 40 BPM are set to 0 because autocorrelation was not performed at these lags. This omission is because the results are too noisy. These measurements were taken without consideration of tempo change messages, in order to emphasize the metrical notation of the recording.
public double[][] rhythmic_histogram_table
Entries are set to the frequency of the corresponding bin of rhythmic_histogram if the frequency is high enough to meet the column's requirements and to 0 otherwise.
This table was processed so that only peaks were included, which is to say that entries for bins that are adjacent to bins with higher frequencies are set to 0.
public java.util.LinkedList note_durations
public boolean[][] note_beginnings_map
A final column (column 16) was added whose entry was set to true if at least one Note On occurred on any channel at the corresponding MIDI tick, and to false otherwise.
public int[][] note_loudnesses
public double[] basic_pitch_histogram
public double[] pitch_class_histogram
public double[] fifths_pitch_histogram
public java.util.LinkedList pitch_bends_list
public double[] melodic_histogram
public java.util.LinkedList[] melody_list
public double[] seconds_per_tick
public double[][] volumes
NOTE: the default is set to 1.0, which corresponds to a controller value of 127.
Constructor Detail |
---|
public MIDIIntermediateRepresentations(java.lang.String midi_file_path) throws java.lang.Exception
Throws exceptions if an error is encountered when parsing the file. These exceptions contain informative information about the error.
midi_file_path
- Path of MIDI file to parse.
java.lang.Exception
- Informative exceptions are thrown if problems are encountered during parsing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |