Performs bpm and key detection continuously.
More...
#include "SuperpoweredAnalyzer.h"
|
float | bpm |
| Current beats per minute. More...
|
|
int | keyIndex |
| The dominant key (chord) of the music. 0..11 are major keys from A to G#, 12..23 are minor keys from A to G#. -1: unknown. Check the static constants in this header for musical, Camelot and Open Key notations. More...
|
|
unsigned int | samplerate |
| Sample rate in Hz. More...
|
|
bool | silence |
| If true, bpm and key detection is paused, because the analyzer detects a longer silence period (more than 1 seconds of digital silence or 8 seconds below -48 decibels). If false, bpm and key detection is under progress. More...
|
|
Performs bpm and key detection continuously.
The update frequency is 2 seconds.
- Warning
- High memory usage! This class allocates 320 * samplerate bytes. Example: 48000 Hz * 320 = 15 MB
◆ LiveAnalyzer() [1/2]
Superpowered::LiveAnalyzer::LiveAnalyzer |
( |
unsigned int |
samplerate | ) |
|
Constructor.
- Parameters
-
samplerate | The initial sample rate in Hz. |
◆ ~LiveAnalyzer()
Superpowered::LiveAnalyzer::~LiveAnalyzer |
( |
| ) |
|
◆ LiveAnalyzer() [2/2]
Superpowered::LiveAnalyzer::LiveAnalyzer |
( |
const LiveAnalyzer & |
| ) |
|
|
private |
◆ operator=()
◆ process()
void Superpowered::LiveAnalyzer::process |
( |
float * |
input, |
|
|
unsigned int |
numberOfFrames |
|
) |
| |
Processes some audio.
This method can be used in a real-time audio thread.
- Parameters
-
input | Pointer to floating point numbers. 32-bit interleaved stereo input. |
numberOfFrames | Number of frames to process. |
◆ bpm
float Superpowered::LiveAnalyzer::bpm |
Current beats per minute.
If the current result is too far from the reality you can do three things:
- Set bpm to zero. This forces the analyzer to "forget" the last bpm and may find the correct value within 10 seconds.
- Set bpm to an estimated value. This forces the analyzer to "forget" the last bpm and use your estimate instead. It may find the correct value within 4 seconds.
- Set bpm to a negative value. This will "hard reset" the analyzer and so it will start fresh.
◆ internals
liveAnalyzerInternals* Superpowered::LiveAnalyzer::internals |
|
private |
◆ keyIndex
int Superpowered::LiveAnalyzer::keyIndex |
The dominant key (chord) of the music. 0..11 are major keys from A to G#, 12..23 are minor keys from A to G#. -1: unknown. Check the static constants in this header for musical, Camelot and Open Key notations.
◆ samplerate
unsigned int Superpowered::LiveAnalyzer::samplerate |
◆ silence
bool Superpowered::LiveAnalyzer::silence |
If true, bpm and key detection is paused, because the analyzer detects a longer silence period (more than 1 seconds of digital silence or 8 seconds below -48 decibels). If false, bpm and key detection is under progress.
The documentation for this class was generated from the following file:
- latest/Superpowered/SuperpoweredAnalyzer.h