Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
onset_detector.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <vector>
6
9
10namespace pulp::audio {
11
13
15 OnsetDetectionMethod method = OnsetDetectionMethod::EnergyFlux;
16 // SpectralFlux and HighFrequencyContent use the existing radix-2 FFT,
17 // so `frame_size` must be a power of two for those methods.
18 std::uint32_t frame_size = 1024;
19 std::uint32_t hop_size = 256;
20 std::uint32_t adaptive_window_frames = 8;
21 std::uint64_t min_spacing_frames = 1024;
23 double min_confidence = 0.05;
24 std::size_t max_markers = 1024;
25};
26
28 std::uint64_t frame = 0;
29 double confidence = 0.0;
30 OnsetDetectionMethod method = OnsetDetectionMethod::EnergyFlux;
31};
32
34 bool ok = false;
35 std::uint64_t analyzed_frames = 0;
36 std::vector<OnsetMarker> markers;
37};
38
40 public:
41 // Off-real-time/background analysis. Package-backed analyzers should
42 // produce OnsetMarker data for SlicePointAnalyzer rather than entering
43 // core/audio as package-specific APIs.
45 const OnsetDetectionConfig& config = {}) const;
46};
47
48} // namespace pulp::audio
Non-owning view over multi-channel audio sample data.
Definition buffer.hpp:30
Definition onset_detector.hpp:39
OnsetDetectionResult detect(BufferView< const float > source, const OnsetDetectionConfig &config={}) const
Definition analyzer_provider.hpp:12
signal::OnsetDetectionMethod OnsetDetectionMethod
Definition onset_detector.hpp:12
OnsetDetectionMethod
Definition analysis_frontends.hpp:17
Definition onset_detector.hpp:14
std::uint32_t frame_size
Definition onset_detector.hpp:18
std::size_t max_markers
Definition onset_detector.hpp:24
double min_confidence
Definition onset_detector.hpp:23
double threshold_multiplier
Definition onset_detector.hpp:22
std::uint64_t min_spacing_frames
Definition onset_detector.hpp:21
std::uint32_t adaptive_window_frames
Definition onset_detector.hpp:20
OnsetDetectionMethod method
Definition onset_detector.hpp:15
std::uint32_t hop_size
Definition onset_detector.hpp:19
Definition onset_detector.hpp:33
std::uint64_t analyzed_frames
Definition onset_detector.hpp:35
bool ok
Definition onset_detector.hpp:34
std::vector< OnsetMarker > markers
Definition onset_detector.hpp:36
Definition onset_detector.hpp:27
std::uint64_t frame
Definition onset_detector.hpp:28
double confidence
Definition onset_detector.hpp:29
OnsetDetectionMethod method
Definition onset_detector.hpp:30