7#include "maiacore/score.h"
17 std::vector<std::string> _directoriesPaths;
18 std::vector<Score> _scores;
24 void loadCollectionFiles();
30 typedef std::tuple<std::string, std::string, std::string, std::string, int, int, std::string, std::string, std::vector<std::string>,
31 std::vector<float>, std::vector<float>, float, float,
float> ExtendedMelodyPatternRow;
32 typedef std::vector<ExtendedMelodyPatternRow> ExtendedMelodyPatternTable;
38 typedef std::tuple<int, std::string, std::string, std::string, std::string, int, int, std::string, std::string, std::vector<std::string>,
39 std::vector<float>, std::vector<float>, float, float,
float> ExtendedMultiMelodyPatternRow;
40 typedef std::vector<ExtendedMultiMelodyPatternRow> ExtendedMultiMelodyPatternTable;
89 void addScore(
const std::vector<std::string>& filePaths);
152 const std::vector<Note>& melodyPattern,
const float totalIntervalsSimilarityThreshold = 0.5f,
153 const float totalRhythmSimilarityThreshold = 0.5f,
154 const std::function<std::vector<float>(
const std::vector<Note>&,
const std::vector<Note>&)>& intervalsSimilarityCallback =
nullptr,
155 const std::function<std::vector<float>(
const std::vector<Note>&,
const std::vector<Note>&)>& rhythmSimilarityCallback =
nullptr,
156 const std::function<
float(
const std::vector<float>&)>& totalIntervalSimilarityCallback =
nullptr,
157 const std::function<
float(
const std::vector<float>&)>& totalRhythmSimilarityCallback =
nullptr,
158 const std::function<
float(
float,
float)>& totalSimilarityCallback =
nullptr)
const;
174 const std::vector<std::vector<Note>>& melodyPatterns,
const float totalIntervalsSimilarityThreshold = 0.5f,
175 const float totalRhythmSimilarityThreshold = 0.5f,
176 const std::function<std::vector<float>(
const std::vector<Note>&,
const std::vector<Note>&)>& intervalsSimilarityCallback =
nullptr,
177 const std::function<std::vector<float>(
const std::vector<Note>&,
const std::vector<Note>&)>& rhythmSimilarityCallback =
nullptr,
178 const std::function<
float(
const std::vector<float>&)>& totalIntervalSimilarityCallback =
nullptr,
179 const std::function<
float(
const std::vector<float>&)>& totalRhythmSimilarityCallback =
nullptr,
180 const std::function<
float(
float,
float)>& totalSimilarityCallback =
nullptr)
const;
Represents a collection of musical scores, supporting batch analysis and management.
Definition: score_collection.h:15
void addScore(const std::string &filePath)
Loads a Score from a file path and adds it to the collection.
ScoreCollection operator+(const ScoreCollection &other) const
Merges two ScoreCollections using the + operator.
Definition: score_collection.h:187
const std::vector< Score > & getScores() const
Returns a const reference to the vector of Score objects.
void addScore(const Score &score)
Adds a Score object to the collection.
ScoreCollection(const std::string &directoryPath={})
Constructs a ScoreCollection from a single directory path.
void addDirectory(const std::string &directoryPath)
Adds a directory path to the collection (does not reload files automatically).
bool isEmpty() const
Returns true if the collection contains no scores.
void clear()
Removes all scores from the collection.
std::vector< std::string > getDirectoriesPaths() const
Returns the list of directory paths associated with the collection.
std::vector< ExtendedMultiMelodyPatternTable > findMelodyPattern(const std::vector< std::vector< Note > > &melodyPatterns, const float totalIntervalsSimilarityThreshold=0.5f, const float totalRhythmSimilarityThreshold=0.5f, const std::function< std::vector< float >(const std::vector< Note > &, const std::vector< Note > &)> &intervalsSimilarityCallback=nullptr, const std::function< std::vector< float >(const std::vector< Note > &, const std::vector< Note > &)> &rhythmSimilarityCallback=nullptr, const std::function< float(const std::vector< float > &)> &totalIntervalSimilarityCallback=nullptr, const std::function< float(const std::vector< float > &)> &totalRhythmSimilarityCallback=nullptr, const std::function< float(float, float)> &totalSimilarityCallback=nullptr) const
Searches for multiple melodic patterns in all scores, returning extended results for each pattern.
ScoreCollection(const std::vector< std::string > &directoriesPaths={})
Constructs a ScoreCollection from multiple directory paths.
ExtendedMelodyPatternTable findMelodyPattern(const std::vector< Note > &melodyPattern, const float totalIntervalsSimilarityThreshold=0.5f, const float totalRhythmSimilarityThreshold=0.5f, const std::function< std::vector< float >(const std::vector< Note > &, const std::vector< Note > &)> &intervalsSimilarityCallback=nullptr, const std::function< std::vector< float >(const std::vector< Note > &, const std::vector< Note > &)> &rhythmSimilarityCallback=nullptr, const std::function< float(const std::vector< float > &)> &totalIntervalSimilarityCallback=nullptr, const std::function< float(const std::vector< float > &)> &totalRhythmSimilarityCallback=nullptr, const std::function< float(float, float)> &totalSimilarityCallback=nullptr) const
Searches for a melodic pattern in all scores, returning extended results.
void setDirectoriesPaths(const std::vector< std::string > &directoriesPaths)
Sets the list of directory paths and reloads the collection.
void removeScore(const int scoreIdx)
Removes a score from the collection by its index.
void addScore(const std::vector< std::string > &filePaths)
Loads multiple Scores from file paths and adds them to the collection.
void merge(const ScoreCollection &other)
Merges another ScoreCollection into this one, combining directories and scores.
std::vector< Score > & getScores()
Returns a reference to the vector of Score objects (modifiable).
int getNumDirectories() const
Returns the number of directories in the collection.
int getNumScores() const
Returns the number of scores in the collection.
Represents a complete musical score, including metadata, parts, measures, and notes.
Definition: score.h:25