Package com.tagtraum.beatunes.matchtable
Class SimilarityMatcher
- java.lang.Object
-
- com.tagtraum.beatunes.matchtable.SimilarityMatcher
-
public class SimilarityMatcher extends Object
Finds similar songs in a set of given songs according toScoreRule
s.- Author:
- Hendrik Schreiber
- See Also:
RuleBasedPrefilter
-
-
Constructor Summary
Constructors Constructor Description SimilarityMatcher()
SimilarityMatcher.SimilarityMatcher(float threshold)
SimilarityMatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AudioSong>
findMatchingSongs(Iterable<AudioSong> sourceSongs, Float syncBPM, boolean playMatchesAtSyncTempo, Collection<ScoreRule> scoreRules, AudioSong... templates)
Finds songs insourceSongs
that best match thetemplates
according to the provided rules.float
getThreshold()
void
setThreshold(float threshold)
List<AudioSong>
sort(AudioSong seed, Iterable<AudioSong> sourceList, Float syncBPM, boolean playMatchesAtSyncTempo, Collection<ScoreRule> ruleSet)
Sorts songs in chunks of x songs and then concatenates the chunks in a sorted manner.
-
-
-
Method Detail
-
getThreshold
public float getThreshold()
-
setThreshold
public void setThreshold(float threshold)
-
findMatchingSongs
public List<AudioSong> findMatchingSongs(Iterable<AudioSong> sourceSongs, Float syncBPM, boolean playMatchesAtSyncTempo, Collection<ScoreRule> scoreRules, AudioSong... templates)
Finds songs insourceSongs
that best match thetemplates
according to the provided rules.- Parameters:
sourceSongs
- collection of song to search insyncBPM
- sync bpmplayMatchesAtSyncTempo
- matched songs are meant to be played at the same tempo as the template songscoreRules
- rules that govern the matching processtemplates
- template songs to find matching songs for in order of decreasing importance- Returns:
- list of matching song, starting with the best match
-
sort
public List<AudioSong> sort(AudioSong seed, Iterable<AudioSong> sourceList, Float syncBPM, boolean playMatchesAtSyncTempo, Collection<ScoreRule> ruleSet)
Sorts songs in chunks of x songs and then concatenates the chunks in a sorted manner.- Parameters:
seed
- seed songsourceList
- source listsyncBPM
- sync BPMplayMatchesAtSyncTempo
- sorted songs are meant to be played at the same tempo as the syncBPMruleSet
- score rules- Returns:
- sorted list
-
-