Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
peak_fall_smooth.h
1// SPDX-FileCopyrightText: © 2023-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3/*
4 * This file incorporates work covered by the following copyright and
5 * permission notices:
6 *
7 * ---
8 *
9 * SPDX-FileCopyrightText: © 2023 Patrick Desaulniers
10 * SPDX-License-Identifier: GPL-3.0-or-later
11 *
12 * ---
13 */
14
15#ifndef ZRYTHM_DSP_PEAK_FALL_SMOOTH_H
16#define ZRYTHM_DSP_PEAK_FALL_SMOOTH_H
17
18namespace zrythm::dsp
19{
20
22{
23public:
24 void calculate_coeff (float frequency, float sample_rate);
25 void set_value (float val);
26 float get_smoothed_value () const;
27
28private:
29 mutable float history_ = 0.f;
30 float value_ = 0.f;
31 float coeff_ = 0.f;
32};
33
34}; // namespace zrythm::dsp
35
36#endif