Class GetPatternStats
java.lang.Object
org.jfugue.tools.GetPatternStats
Provides
Pattern and MIDI analysis of the following elements:
General descriptors, Pitch descriptors, Duration descriptors, Silence descriptors (rests),
Interval descriptors (half-steps), Inter Onset Interval (IOI), Harmonic Descriptors (Non-diatonics),
Rhythm Descriptors (Syncopations), Normality Descriptors.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecomparePatterns(Pattern p1, Pattern p2) Parses two patterns to find average difference of all statsGetsStatsobject containing note duration N, Average (mean - min), SD, and Range.int[]Gets general statistics (Number of notes, number of rests, number of measures)GetsStatsobject containing harmonics N, Average (mean - min), SD, and Range.GetsStatsobject containing pitch interval N, Average (mean - min), SD, and Range.GetsStatsobject containing inter-onset-interval(IOI) N, Average (mean - min), SD, and Range.GetsStatsobject containing pitch N, Average (mean - min), SD, and Range.GetsStatsobject containing rest duration N, Average (mean - min), SD, and Range.intGets number of syncopations.voidparsePattern(File midiFile, Boolean clear) Parses MIDI file to calculate statistics for all descriptorsvoidparsePattern(Pattern pattern, Boolean clear) Parses JFuguePatternto calculate statistics for all descriptors.toString()
-
Constructor Details
-
GetPatternStats
public GetPatternStats()
-
-
Method Details
-
parsePattern
-
parsePattern
Parses MIDI file to calculate statistics for all descriptors- Parameters:
midiFile- The MIDI file to be parsed.clear- True to clear previous data, false to add to previous data- Throws:
IOExceptionInvalidMidiDataException
-
comparePatterns
-
getGeneralStats
public int[] getGeneralStats()Gets general statistics (Number of notes, number of rests, number of measures)- Returns:
- Array index 0: N of Notes; index 1: N of rests; index 2: N of measures
-
getPitchStats
GetsStatsobject containing pitch N, Average (mean - min), SD, and Range.- Returns:
Statsobject for pitch
-
getDurationStats
GetsStatsobject containing note duration N, Average (mean - min), SD, and Range.- Returns:
Statsobject for note duration
-
getRestStats
GetsStatsobject containing rest duration N, Average (mean - min), SD, and Range. Only silences greater than a 16th note are evaluated.- Returns:
Statsobject for rest duration
-
getIntervalStats
GetsStatsobject containing pitch interval N, Average (mean - min), SD, and Range. Intervals are in half-steps.- Returns:
Statsobject for pitch interval
-
getIOIStats
GetsStatsobject containing inter-onset-interval(IOI) N, Average (mean - min), SD, and Range. Inter-onset-intervals are the number of MIDI pulses between the onset of non-rest notes.- Returns:
Statsobject for IOI
-
getRhythmStats
public int getRhythmStats()Gets number of syncopations. Syncopations are calculated as any note that begins between beats and extends beyond the next beat. ie. C5H C5W C5H - the middle note is syncopated.- Returns:
Statsobject for rhythm
-
getHarmonicStats
GetsStatsobject containing harmonics N, Average (mean - min), SD, and Range. Non-diatonic notes based off of the parsed key signature or default of Cmaj. Average is average of 0-4, as a degree of non-diatonic notes. ie. 0: ♭II, 1: ♭III (♮III for minor key), 2: ♭V, 3: ♭VI, 4: ♭VII. SD is also computed using degree of non-diatonic notes.- Returns:
Statsobject for harmonics
-
toString
-