Generate an accompaniement for a given melody
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Observation.hpp
Go to the documentation of this file.
1 
9 #ifndef OBSERVATION_HPP_INCLUDED
10 #define OBSERVATION_HPP_INCLUDED
11 #include "Markov.hpp"
12 #include "Music.hpp"
13 #include <iostream>
14 
15 
16 
17 
18 class ObsMeasure : private Measure
19 {
20 public:
25  ObsMeasure(const Measure & M);
31  ObsMeasure();
32 
33  friend std::ostream & operator<<(std::ostream& os, const ObsMeasure &m);
34 
44  HMM::ObsId getClosestObs(const std::vector<ObsMeasure> &m);
45 
46  const static int TypeID = 0;
47 
48 
49 };
50 
51 
52 
53 
59 class ObsPresenceStats : private Measure
60 {
61 public:
66  ObsPresenceStats(const Measure & M,double grain);
67 
68 
69  friend std::ostream & operator<<(std::ostream& os, const ObsPresenceStats &m);
70 
71  bool operator==(const ObsPresenceStats& o) const __attribute__((pure));
72 
82  HMM::ObsId getClosestObs(const std::vector<ObsPresenceStats> &m) const __attribute__((pure));
83 
84  const static int TypeID = 1;
85 
86 protected:
87 
94  double distanceFrom(const ObsPresenceStats &other) const __attribute__((pure));
95 
96 
97 private:
98  std::vector<double> m_stats;
99  double m_grain;
100 
101 
102 };
103 
104 
105 #endif
HMM::ObsId getClosestObs(const std::vector< ObsMeasure > &m)
Compute the closest observation.
static const int TypeID
Mandatory id of the class (must be unique amongst Observation classes)
Definition: Observation.hpp:84
Definition: Observation.hpp:18
An observation class based on statitistics of presence of the notes. We compute a the percentage each...
Definition: Observation.hpp:59
This file defines all the data structures related to music objects.
This file describes the data structures used to represent a hidden Markov model (HMM) ...
static const int TypeID
Mandatory id of the class (must be unique amongst Observation classes)
Definition: Observation.hpp:46
ObsPresenceStats(const Measure &M, double grain)
Construction from a measure.
Describe a musical bar.
Definition: Music.hpp:312
ObsMeasure()
Default constructor.
double distanceFrom(const ObsPresenceStats &other) const __attribute__((pure))
Compute distance from other observation.
HMM::ObsId getClosestObs(const std::vector< ObsPresenceStats > &m) const __attribute__((pure))
Compute the closest observation.