File: para_equalizer.h

package info (click to toggle)
lsp-plugins 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 91,856 kB
  • sloc: cpp: 427,831; xml: 57,779; makefile: 9,961; php: 1,005; sh: 18
file content (124 lines) | stat: -rw-r--r-- 4,947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 * Copyright (C) 2021 Linux Studio Plugins Project <https://lsp-plug.in/>
 *           (C) 2021 Vladimir Sadovnikov <sadko4u@gmail.com>
 *
 * This file is part of lsp-plugins-para-equalizer
 * Created on: 2 авг. 2021 г.
 *
 * lsp-plugins-para-equalizer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * lsp-plugins-para-equalizer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with lsp-plugins-para-equalizer. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PRIVATE_META_PARA_EQUALIZER_H_
#define PRIVATE_META_PARA_EQUALIZER_H_

#include <lsp-plug.in/plug-fw/meta/types.h>
#include <lsp-plug.in/plug-fw/const.h>
#include <lsp-plug.in/dsp-units/misc/windows.h>
#include <lsp-plug.in/dsp-units/misc/envelope.h>

namespace lsp
{
    //-------------------------------------------------------------------------
    // Parametric equalizer metadata
    namespace meta
    {
        struct para_equalizer_metadata
        {
            static constexpr float          FREQ_MIN            = SPEC_FREQ_MIN;
            static constexpr float          FREQ_MAX            = SPEC_FREQ_MAX;
            static constexpr float          FREQ_DFL            = 1000;
            static constexpr float          FREQ_STEP           = 0.002;

            static constexpr size_t         FFT_RANK            = 13;
            static constexpr size_t         FFT_ITEMS           = 1 << FFT_RANK;
            static constexpr size_t         MESH_POINTS         = 640;
            static constexpr size_t         FILTER_MESH_POINTS  = MESH_POINTS + 2;
            static constexpr size_t         FFT_WINDOW          = lsp::dspu::windows::HANN;
            static constexpr size_t         FFT_ENVELOPE        = lsp::dspu::envelope::PINK_NOISE;

            static constexpr float          REACT_TIME_MIN      = 0.000;
            static constexpr float          REACT_TIME_MAX      = 1.000;
            static constexpr float          REACT_TIME_DFL      = 0.200;
            static constexpr float          REACT_TIME_STEP     = 0.001;

            static constexpr float          ZOOM_MIN            = GAIN_AMP_M_36_DB;
            static constexpr float          ZOOM_MAX            = GAIN_AMP_0_DB;
            static constexpr float          ZOOM_DFL            = GAIN_AMP_0_DB;
            static constexpr float          ZOOM_STEP           = 0.025f;

            static constexpr float          IN_GAIN_DFL         = 1.0f;
            static constexpr float          OUT_GAIN_DFL        = 1.0f;
            static constexpr size_t         MODE_DFL            = 0;

            static constexpr float          PITCH_MIN           = -120.0f;
            static constexpr float          PITCH_MAX           = 120.0f;
            static constexpr float          PITCH_DFL           = 0.0f;
            static constexpr float          PITCH_STEP          = 0.01f;

            static constexpr size_t         REFRESH_RATE        = 20;

            enum eq_filter_t
            {
                EQF_OFF,
                EQF_BELL,
                EQF_HIPASS,
                EQF_HISHELF,
                EQF_LOPASS,
                EQF_LOSHELF,
                EQF_NOTCH,
                EQF_RESONANCE,
                EQF_ALLPASS,

            #ifdef LSP_USE_EXPERIMENTAL
                EQF_ALLPASS2,
                EQF_LADDERPASS,
                EQF_LADDERREJ,
                EQF_ENVELOPE,
                EQF_BANDPASS
            #endif /* LSP_USE_EXPERIMENTAL */
            };

            enum eq_filter_mode_t
            {
                EFM_RLC_BT,
                EFM_RLC_MT,
                EFM_BWC_BT,
                EFM_BWC_MT,
                EFM_LRX_BT,
                EFM_LRX_MT,
                EFM_APO_DR
            };

            enum para_eq_mode_t
            {
                PEM_IIR,
                PEM_FIR,
                PEM_FFT,
                PEM_SPM
            };
        };

        extern const meta::plugin_t para_equalizer_x16_mono;
        extern const meta::plugin_t para_equalizer_x16_stereo;
        extern const meta::plugin_t para_equalizer_x16_lr;
        extern const meta::plugin_t para_equalizer_x16_ms;
        extern const meta::plugin_t para_equalizer_x32_mono;
        extern const meta::plugin_t para_equalizer_x32_stereo;
        extern const meta::plugin_t para_equalizer_x32_lr;
        extern const meta::plugin_t para_equalizer_x32_ms;

    } // namespace meta
} // namespace lsp

#endif /* PRIVATE_META_PARA_EQUALIZER_H_ */