|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
Names the beats that open a bar, from a signal and its beats. More...
#include <DownbeatEstimator.h>
Classes | |
| struct | Result |
| What estimate() returns. More... | |
Static Public Member Functions | |
| static Result | estimate (std::span< const T > mono, double sampleRate, std::span< const int64_t > beatSamples, int beatsPerBar=0) |
| Estimates the bar length and the first beat of the bars. | |
Static Public Attributes | |
| static constexpr int | kMinBeats = 8 |
| Fewest beats estimate() reads: two bars of four. | |
| static constexpr int | kMaxBeatsPerBar = 8 |
| Longest bar a caller may ask for, in beats. | |
Names the beats that open a bar, from a signal and its beats.
Role: offline analysis readout. It reads const audio and returns a value.
| T | Sample type (float or double). |
Definition at line 115 of file DownbeatEstimator.h.
|
inlinestatic |
Estimates the bar length and the first beat of the bars.
The bars are taken as equal in length from the first beat to the last: a piece that changes its time signature, or drops a beat, gets the bar line that fits most of it.
| mono | Mono samples of the whole signal. Samples that are not finite read as zero. |
| sampleRate | Sample rate in Hz. |
| beatSamples | The beats, as sample positions inside the signal, strictly ascending. |
| beatsPerBar | Beats in a bar, 2 to kMaxBeatsPerBar, or 0 to have it estimated (as 3 or 4). |
Definition at line 157 of file DownbeatEstimator.h.
|
staticconstexpr |
Longest bar a caller may ask for, in beats.
Definition at line 134 of file DownbeatEstimator.h.
|
staticconstexpr |
Fewest beats estimate() reads: two bars of four.
Definition at line 132 of file DownbeatEstimator.h.