Class SimilarityMatcher

    • Constructor Detail

      • SimilarityMatcher

        public SimilarityMatcher()
        SimilarityMatcher.
      • SimilarityMatcher

        public SimilarityMatcher​(float threshold)
        SimilarityMatcher.
        Parameters:
        threshold - threshold
    • 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 in sourceSongs that best match the templates according to the provided rules.
        Parameters:
        sourceSongs - collection of song to search in
        syncBPM - sync bpm
        playMatchesAtSyncTempo - matched songs are meant to be played at the same tempo as the template song
        scoreRules - rules that govern the matching process
        templates - 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 song
        sourceList - source list
        syncBPM - sync BPM
        playMatchesAtSyncTempo - sorted songs are meant to be played at the same tempo as the syncBPM
        ruleSet - score rules
        Returns:
        sorted list