Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
peak_fall_smooth.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2023 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
19#ifndef __AUDIO_PEAK_FALL_SMOOTH_H__
20#define __AUDIO_PEAK_FALL_SMOOTH_H__
21
22typedef struct PeakFallSmooth
23{
24 float history;
25 float value;
26 float coeff;
28
30peak_fall_smooth_new (void);
31
32void
33peak_fall_smooth_calculate_coeff (
34 PeakFallSmooth * self,
35 const float frequency,
36 const float sample_rate);
37
38void
39peak_fall_smooth_set_value (PeakFallSmooth * self, const float val);
40
41float
42peak_fall_smooth_get_smoothed_value (PeakFallSmooth * self);
43
44void
45peak_fall_smooth_free (PeakFallSmooth * self);
46
47#endif