Package org.jfugue.tools
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 TypeMethodDescriptiondouble
comparePatterns
(Pattern p1, Pattern p2) Parses two patterns to find average difference of all statsGetsStats
object containing note duration N, Average (mean - min), SD, and Range.int[]
Gets general statistics (Number of notes, number of rests, number of measures)GetsStats
object containing harmonics N, Average (mean - min), SD, and Range.GetsStats
object containing pitch interval N, Average (mean - min), SD, and Range.GetsStats
object containing inter-onset-interval(IOI) N, Average (mean - min), SD, and Range.GetsStats
object containing pitch N, Average (mean - min), SD, and Range.GetsStats
object containing rest duration N, Average (mean - min), SD, and Range.int
Gets number of syncopations.void
parsePattern
(File midiFile, Boolean clear) Parses MIDI file to calculate statistics for all descriptorsvoid
parsePattern
(Pattern pattern, Boolean clear) Parses JFuguePattern
to calculate statistics for all descriptors.
toString()
-
Constructor Details
-
GetPatternStats
public GetPatternStats()
-
-
Method Details
-
parsePattern
Parses JFuguePattern
to calculate statistics for all descriptors.
- Parameters:
pattern
- The JFuge Pattern to be parsed.clear
- True to clear previous data, false to add to previous data
-
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:
IOException
InvalidMidiDataException
-
comparePatterns
Parses two patterns to find average difference of all stats- Parameters:
Pattern
- Pattern 1 to be parsedPattern
- Pattern 2 to be parsed- Returns:
- The average difference between patterns
-
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
GetsStats
object containing pitch N, Average (mean - min), SD, and Range.- Returns:
Stats
object for pitch
-
getDurationStats
GetsStats
object containing note duration N, Average (mean - min), SD, and Range.- Returns:
Stats
object for note duration
-
getRestStats
GetsStats
object containing rest duration N, Average (mean - min), SD, and Range. Only silences greater than a 16th note are evaluated.- Returns:
Stats
object for rest duration
-
getIntervalStats
GetsStats
object containing pitch interval N, Average (mean - min), SD, and Range. Intervals are in half-steps.- Returns:
Stats
object for pitch interval
-
getIOIStats
GetsStats
object 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:
Stats
object 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:
Stats
object for rhythm
-
getHarmonicStats
GetsStats
object 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:
Stats
object for harmonics
-
toString
-