Beatmup
|
Signal dynamics meter. More...
#include <signal.h>
Public Types | |
enum class | MeasuringMode { preciseUsingSamples , approximateUsingLookup , preciseUsingLookupAndSamples } |
Specifies how to compute signal dynamics (minima and maxima in a given period of time) More... | |
Public Member Functions | |
Meter (Signal &signal, dtime time, MeasuringMode mode=MeasuringMode::approximateUsingLookup) | |
Constructs a new meter. More... | |
template<typename sample > | |
void | measure (dtime len, int resolution, sample min[], sample max[]) |
Measures signal dynamics in a given period of time. More... | |
void | setMode (MeasuringMode newMode) |
template<> | |
void | measure (dtime len, int resolution, sample16 min[], sample16 max[]) |
Public Member Functions inherited from Beatmup::Audio::Signal::Pointer | |
Pointer (Signal &signal, dtime time, bool writing) | |
virtual void | releaseBuffer () |
unsigned char | getChannelCount () const |
Static Public Member Functions | |
static void | prepareSignal (Signal &signal, bool runTask=true) |
Precomputes the dynamics lookup all over the signal, where needed. More... | |
Private Member Functions | |
template<typename sample > | |
void | measureInFragments (dtime len, int resolution, sample *min, sample *max) |
Measures signal dynamics in a given period of time. More... | |
Static Private Member Functions | |
static void | prepare (Signal &signal, int skipOnStart=0, int numSteps=1) |
Private Attributes | |
MeasuringMode | mode |
|
strong |
Specifies how to compute signal dynamics (minima and maxima in a given period of time)
Definition at line 76 of file signal.h.
Signal::Meter::Meter | ( | Signal & | signal, |
dtime | time, | ||
MeasuringMode | mode = MeasuringMode::approximateUsingLookup |
||
) |
Constructs a new meter.
signal | The signal to measure |
time | Initial time to start measurements from |
mode | Algorithm used to measure the signal dynamics |
Definition at line 197 of file signal.cpp.
|
private |
Measures signal dynamics in a given period of time.
Deals with the fragmentation. The sample type must be coherent to the actual sample format of the signal.
len | Period length in samples |
resolution | Number of output points |
min | Channelwise multiplexed magnitude minima, (resolution) points per channel |
max | Channelwise multiplexed magnitude maxima, (resolution) points per channel |
Definition at line 227 of file signal.cpp.
|
staticprivate |
Definition at line 183 of file signal.cpp.
|
static |
Precomputes the dynamics lookup all over the signal, where needed.
signal | The signal to process |
runTask | If true , a task will be run in the context of the signal allowing to process it in parallel; otherwise the computation is done directly in the calling thread |
Definition at line 202 of file signal.cpp.
void Beatmup::Audio::Signal::Meter::measure | ( | dtime | len, |
int | resolution, | ||
sample | min[], | ||
sample | max[] | ||
) |
Measures signal dynamics in a given period of time.
len | Period length in samples |
resolution | Number of output points |
min | Channelwise multiplexed magnitude minima, (resolution) points per channel |
max | Channelwise multiplexed magnitude maxima, (resolution) points per channel |
|
inline |
void Beatmup::Audio::Signal::Meter::measure | ( | dtime | len, |
int | resolution, | ||
sample16 | min[], | ||
sample16 | max[] | ||
) |
Definition at line 273 of file signal.cpp.
|
private |