Inner Metric Analysis code
 All Classes Namespaces Functions Variables Typedefs Pages
Public Member Functions | List of all members
InnerMetricAnalysis::Computer Class Reference

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< TimegetGrid () const
 Returns the grid. More...
 
std::vector< TimegetOnsets () const
 Returns the onsets as set with setData.
 
std::vector< MetergetMeters (int l=-1) const
 Return the meters associated with these onsets. More...
 
std::vector< WeightgetMetricWeights1 (int p=2, int l=-1) const
 Get the metric weights for all onsets. More...
 
std::vector< TimeWeightgetMetricWeights2 (int p=2, int l=-1) const
 Get the metric weights and onsets. More...
 
std::vector< WeightgetSpectralWeights1 (int p=2, int l=-1) const
 Get the spectral weights for the grid. More...
 
std::vector< TimeWeightgetSpectralWeights2 (int p=2, int l=-1) const
 Get the spectral weights on the grid. More...
 
std::vector< WeightgetDieoutWeights1 (double d=1.0, int p=2, int l=-1) const
 Get the dieout weights for the grid. More...
 
std::vector< TimeWeightgetDieoutWeights2 (double d=1.0, int p=2, int l=-1) const
 Get the dieout weights on the grid. More...
 
std::vector< WeightgetSymOutWeights1 (double d=1.0, int p=2, int l=-1) const
 Get the symmetric dieout weights on the grid. More...
 
std::vector< TimeWeightgetSymOutWeights2 (double d=1.0, int p=2, int l=-1) const
 Get the symmetric dieout weights on the grid. More...
 

Detailed Description

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).

Constructor & Destructor Documentation

template<typename TimeIter >
InnerMetricAnalysis::Computer::Computer ( TimeIter  begin,
TimeIter  end 
)
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.

Exceptions
NonIncreasingInputError

Member Function Documentation

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

Parameters
dThe 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).
pSee getMetricWeights1() for the meaning
lSee 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.

Parameters
lCut 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.

Parameters
pinfluences 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:

  • the gridpoints are at time t0+i*p for 0<=i<=n for some t0, p and n.
  • all onsets are part of the grid
  • the grid is minimal

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.

template<typename TimeIter >
void InnerMetricAnalysis::Computer::setData ( TimeIter  begin,
TimeIter  end 
)
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.

Exceptions
NonIncreasingInputError

The documentation for this class was generated from the following file: