A class for performing Inner Metric Analysis computations. More...
#include <InnerMetricAnalysis.hpp>
Public Member Functions | |
~Computer () | |
Destructor. | |
Computer () | |
Default constructor. | |
template<typename TimeIter > | |
Computer (TimeIter begin, TimeIter end) | |
Constructor taking note onsets. More... | |
template<typename TimeIter > | |
void | setData (TimeIter begin, TimeIter end) |
Set the note onsets. More... | |
Time | getMinPeriod () const |
Get the grid interval period. More... | |
std::vector< Time > | getGrid () const |
Returns the grid. More... | |
std::vector< Time > | getOnsets () const |
Returns the onsets as set with setData. | |
std::vector< Meter > | getMeters (int l=-1) const |
Return the meters associated with these onsets. More... | |
std::vector< Weight > | getMetricWeights1 (int p=2, int l=-1) const |
Get the metric weights for all onsets. More... | |
std::vector< TimeWeight > | getMetricWeights2 (int p=2, int l=-1) const |
Get the metric weights and onsets. More... | |
std::vector< Weight > | getSpectralWeights1 (int p=2, int l=-1) const |
Get the spectral weights for the grid. More... | |
std::vector< TimeWeight > | getSpectralWeights2 (int p=2, int l=-1) const |
Get the spectral weights on the grid. More... | |
std::vector< Weight > | getDieoutWeights1 (double d=1.0, int p=2, int l=-1) const |
Get the dieout weights for the grid. More... | |
std::vector< TimeWeight > | getDieoutWeights2 (double d=1.0, int p=2, int l=-1) const |
Get the dieout weights on the grid. More... | |
std::vector< Weight > | getSymOutWeights1 (double d=1.0, int p=2, int l=-1) const |
Get the symmetric dieout weights on the grid. More... | |
std::vector< TimeWeight > | getSymOutWeights2 (double d=1.0, int p=2, int l=-1) const |
Get the symmetric dieout weights on the grid. More... | |
A class for performing Inner Metric Analysis computations.
Input for inner metric analysis are note onsets (the starting time of a music note). IMA computes a weight for the notes (and possibly also for other points in time) based on recurring patterns (meters).
|
inline |
Constructor taking note onsets.
begin and end are iterators with Time as value type. They define a range of onsets. The onsets must be in increasing order.
NonIncreasingInputError |
std::vector<Weight> InnerMetricAnalysis::Computer::getDieoutWeights1 | ( | double | d = 1.0 , |
int | p = 2 , |
||
int | l = -1 |
||
) | const |
Get the dieout weights for the grid.
Parameter
d | The dieout factor. The weight of a meter dies out linearly. It takes d times the period netween the first and last onset of the meter to die out completely (reach value 0). |
p | See getMetricWeights1() for the meaning |
l | See getMeters() for the meaning. |
std::vector<TimeWeight> InnerMetricAnalysis::Computer::getDieoutWeights2 | ( | double | d = 1.0 , |
int | p = 2 , |
||
int | l = -1 |
||
) | const |
Get the dieout weights on the grid.
See getDieOutWeights1() for the meaning of the parameters.
std::vector<Time> InnerMetricAnalysis::Computer::getGrid | ( | ) | const |
Returns the grid.
See getMinPeriod() for a definition of the grid..
std::vector<Meter> InnerMetricAnalysis::Computer::getMeters | ( | int | l = -1 | ) | const |
Return the meters associated with these onsets.
l | Cut off parameter. No meters with a period larger than l will be considered. If l is negative, all periods are valid. |
std::vector<Weight> InnerMetricAnalysis::Computer::getMetricWeights1 | ( | int | p = 2 , |
int | l = -1 |
||
) | const |
Get the metric weights for all onsets.
p | influences the weight of meters as repeats^p. |
l | : see getMeters() for a description. |
std::vector<TimeWeight> InnerMetricAnalysis::Computer::getMetricWeights2 | ( | int | p = 2 , |
int | l = -1 |
||
) | const |
Get the metric weights and onsets.
See getMetricWeights1() for the meaning of the parameters.
Time InnerMetricAnalysis::Computer::getMinPeriod | ( | ) | const |
Get the grid interval period.
The grid is the regular superset of the onsets that has the following properties:
getMinPeriod() returns the p of the above formula.
std::vector<Weight> InnerMetricAnalysis::Computer::getSpectralWeights1 | ( | int | p = 2 , |
int | l = -1 |
||
) | const |
Get the spectral weights for the grid.
See getMetricWeights1() for the meaning of the parameters.
std::vector<TimeWeight> InnerMetricAnalysis::Computer::getSpectralWeights2 | ( | int | p = 2 , |
int | l = -1 |
||
) | const |
Get the spectral weights on the grid.
See getMetricWeights1() for the meaning of the parameters.
std::vector<Weight> InnerMetricAnalysis::Computer::getSymOutWeights1 | ( | double | d = 1.0 , |
int | p = 2 , |
||
int | l = -1 |
||
) | const |
Get the symmetric dieout weights on the grid.
See getDieOutWeights1() for the meaning of the parameters.
std::vector<TimeWeight> InnerMetricAnalysis::Computer::getSymOutWeights2 | ( | double | d = 1.0 , |
int | p = 2 , |
||
int | l = -1 |
||
) | const |
Get the symmetric dieout weights on the grid.
See getDieOutWeights1() for the meaning of the parameters.
|
inline |
Set the note onsets.
begin and end are iterators with Time as value type. They define a range of onsets. The onsets must be in increasing order.
NonIncreasingInputError |