public final class HarmonyUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkSanity(SongContext songContext)
Checks the sanity of the song's harmony.
|
static void |
dumpChords(SongContext songContext)
Dumps all chords and their lengths in ticks.
|
static int |
getChordSectionCount(SongContext songContext)
Returns the total number of chord sections.
|
static int |
getChordSectionNumber(SongContext songContext,
int tick)
Returns the number of the chord section of the given tick (counted from 0) or -1 if the tick is negative or at or beyond the end of the song.
|
static List<Integer> |
getChordSectionStartTicks(SongContext songContext)
Returns a list of start ticks for all chord sections, in ascending order.
|
static String |
getChordSectionString(SongContext songContext,
int tick)
Returns a string specifying the chord section that starts at the specified tick, which is a comma-separated list of chords and tick lengths.
|
static int |
getChordSectionTick(SongContext songContext,
int chordSection)
Returns the first tick of the given chord section number (starting from 0) or -1 if the chord section number is negative or beyond the end of
the song.
|
static int |
getDistinctChordSectionCount(SongContext songContext)
Returns the number of distinct chord sections.
|
static int[] |
getMinMaxSegmentLengths(SongContext songContext,
ActivityVector av)
Returns the minimum and the maximum length of all activity segments of the given ActivityVector as well as the minimum and maximum length of
all pauses between activity segments, all counted in chord sections.
|
public static int getChordSectionCount(SongContext songContext)
songContext
- the song contextpublic static String getChordSectionString(SongContext songContext, int tick)
songContext
- the song contexttick
- the starting tickpublic static int getChordSectionNumber(SongContext songContext, int tick)
songContext
- the song contexttick
- the tickpublic static int getChordSectionTick(SongContext songContext, int chordSection)
songContext
- the song contextchordSection
- the number of the chord sectionpublic static int getDistinctChordSectionCount(SongContext songContext)
songContext
- the song contextpublic static List<Integer> getChordSectionStartTicks(SongContext songContext)
songContext
- the song contextpublic static int[] getMinMaxSegmentLengths(SongContext songContext, ActivityVector av)
songContext
- the song contextav
- the ActivityVectorpublic static void dumpChords(SongContext songContext)
songContext
- the song contextpublic static void checkSanity(SongContext songContext)
songContext
- the song context