1 #ifndef INNERMETRICANALYSIS_378_1372
2 #define INNERMETRICANALYSIS_378_1372
12 namespace InnerMetricAnalysis
17 typedef unsigned long Time;
79 template <
typename TimeIter>
92 template <
typename TimeIter>
93 void setData(TimeIter begin, TimeIter end)
95 addReserve(std::distance(begin,end));
96 std::for_each (begin, end, [
this](
Time t){this->addOne(t);});
113 std::vector<Time>
getGrid()
const;
119 std::vector<Meter>
getMeters(
int l=-1)
const;
151 std::vector<TimeWeight>
163 std::vector<TimeWeight>
166 ComputerDetail *detail;
168 void addReserve(
size_t n);
176 #endif // INNERMETRICANALYSIS_378_1372
Time period
Interval between onsets.
Definition: InnerMetricAnalysis.hpp:40
std::vector< Weight > getMetricWeights1(int p=2, int l=-1) const
Get the metric weights for all onsets.
std::vector< TimeWeight > getSymOutWeights2(double d=1.0, int p=2, int l=-1) const
Get the symmetric dieout weights on the grid.
Meter(Time s, Time p, int r)
Initialization with start, period and repeats.
Definition: InnerMetricAnalysis.hpp:46
std::vector< TimeWeight > getSpectralWeights2(int p=2, int l=-1) const
Get the spectral weights on the grid.
std::vector< Weight > getSpectralWeights1(int p=2, int l=-1) const
Get the spectral weights for the grid.
std::vector< Time > getGrid() const
Returns the grid.
std::vector< Meter > getMeters(int l=-1) const
Return the meters associated with these onsets.
unsigned long Weight
Definition: InnerMetricAnalysis.hpp:21
void setData(TimeIter begin, TimeIter end)
Set the note onsets.
Definition: InnerMetricAnalysis.hpp:93
Time getMinPeriod() const
Get the grid interval period.
std::vector< Time > getOnsets() const
Returns the onsets as set with setData.
Meter()
Default initialization (undefined meter)
Definition: InnerMetricAnalysis.hpp:44
std::vector< Weight > getDieoutWeights1(double d=1.0, int p=2, int l=-1) const
Get the dieout weights for the grid.
Time start
First onset.
Definition: InnerMetricAnalysis.hpp:38
Computer(TimeIter begin, TimeIter end)
Constructor taking note onsets.
Definition: InnerMetricAnalysis.hpp:80
Time time
The onset time.
Definition: InnerMetricAnalysis.hpp:26
unsigned long Time
Definition: InnerMetricAnalysis.hpp:17
A class for performing Inner Metric Analysis computations.
Definition: InnerMetricAnalysis.hpp:64
std::vector< TimeWeight > getMetricWeights2(int p=2, int l=-1) const
Get the metric weights and onsets.
Struct that contains an onset and a weight.
Definition: InnerMetricAnalysis.hpp:24
A meter is a number of onsets at a regular interval.
Definition: InnerMetricAnalysis.hpp:36
TimeWeight(Time t, Weight w)
Constructor taking onset time and weight.
Definition: InnerMetricAnalysis.hpp:30
std::vector< TimeWeight > getDieoutWeights2(double d=1.0, int p=2, int l=-1) const
Get the dieout weights on the grid.
Computer()
Default constructor.
Definition: InnerMetricAnalysis.hpp:69
int repeats
The number of onsets.
Definition: InnerMetricAnalysis.hpp:42
std::vector< Weight > getSymOutWeights1(double d=1.0, int p=2, int l=-1) const
Get the symmetric dieout weights on the grid.
Weight weight
The weight of the onset.
Definition: InnerMetricAnalysis.hpp:28