Vital
Loading...
Searching...
No Matches
peak_meter.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "processor.h"
9
10namespace vital {
11
27 class PeakMeter : public Processor {
28 public:
30 static constexpr int kMaxRememberedPeaks = 16;
31
36 enum {
40 };
41
45 PeakMeter();
46
51 virtual Processor* clone() const override { return new PeakMeter(*this); }
52
58 void process(int num_samples) override;
59
60 protected:
63
66
69
72
73 JUCE_LEAK_DETECTOR(PeakMeter)
74 };
75} // namespace vital
A processor that computes both instantaneous peak and a "memory peak" of an incoming audio signal.
Definition peak_meter.h:27
poly_float current_square_sum_
Sum of squared samples used for RMS/level calculations.
Definition peak_meter.h:65
poly_float remembered_peak_
The highest remembered peak level over a certain period.
Definition peak_meter.h:68
static constexpr int kMaxRememberedPeaks
Maximum number of remembered peaks to consider.
Definition peak_meter.h:30
poly_int samples_since_remembered_
The number of samples since the remembered peak was updated.
Definition peak_meter.h:71
PeakMeter()
Constructs a new PeakMeter processor.
Definition peak_meter.cpp:21
virtual Processor * clone() const override
Creates a clone of this PeakMeter processor.
Definition peak_meter.h:51
poly_float current_peak_
Current instantaneous peak value.
Definition peak_meter.h:62
@ kMemoryPeak
Memory-peak output index.
Definition peak_meter.h:38
@ kLevel
Current peak output index.
Definition peak_meter.h:37
@ kNumOutputs
Number of outputs.
Definition peak_meter.h:39
void process(int num_samples) override
Processes the input audio to compute current and remembered peak levels.
Definition peak_meter.cpp:28
Base class for all signal-processing units in Vital.
Definition processor.h:212
Contains classes and functions used within the Vital synthesizer framework.
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56