Generate an accompaniement for a given melody
|
Backend for a Hidden Markov Model object, templated over the observation type. More...
#include <Markov.hpp>
Classes | |
class | State |
Public Member Functions | |
std::vector< std::pair < ChordProgression, Score > > | getBestProgressions (Melody M, unsigned n=1) const |
Return a list of chord progressions with scores. More... | |
unsigned | getMaxProgressionsNbr () const |
void | saveToFile (const std::string &fname) const |
Save the class to a given file. More... | |
void | learn (Database &db, const std::string &style) |
void | learn_unsupervised (Database &db, const std::string &style) |
Protected Member Functions | |
void | forwardProcedure (const std::vector< Obs > &o) |
void | backwardProcedure (const std::vector< Obs > &o) |
void | updateProcedure (const std::vector< Obs > &o) |
void | generateObsSet (const std::vector< Data > &entries) |
Additional Inherited Members | |
Public Types inherited from HMM | |
using | Proba = double |
Return a list of chord progressions with scores. More... | |
using | ObsId = unsigned |
using | StateId = unsigned |
using | Score = double |
Backend for a Hidden Markov Model object, templated over the observation type.
The parameter of the template correspond to the Observation type. We can imagine several ways to describe these, for example with meta datas rather than plain music description
|
virtual |
Return a list of chord progressions with scores.
Scores are non negative. It is guaranted that at least one progression has a score different than 0.
M | Observed melody from which we want to generate chords |
n | Number of chord progressions wanted (n > 0 ) |
std::domain_error | If the number of chords requested is higher than what can be generated, an exception is thrown |
Implements HMM.
|
virtual |
Return the maximal number of distinct progressions that can be generated
Implements HMM.
|
virtual |