File: mb_expander.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 (159 lines) | stat: -rw-r--r-- 7,751 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
 * 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-mb-expander
 * Created on: 3 авг. 2021 г.
 *
 * lsp-plugins-mb-expander 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-mb-expander 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-mb-expander. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PRIVATE_META_MB_EXPANDER_H_
#define PRIVATE_META_MB_EXPANDER_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>


namespace lsp
{
    namespace meta
    {
        struct mb_expander_metadata
        {
            static constexpr size_t         BANDS_MAX           = 8;
            static constexpr size_t         BANDS_DFL           = 4;

            static constexpr float          IN_GAIN_DFL         = GAIN_AMP_0_DB;
            static constexpr float          OUT_GAIN_DFL        = GAIN_AMP_0_DB;

            static constexpr size_t         SC_BAND_DFL         = 0;
            static constexpr size_t         SC_MODE_DFL         = 1;
            static constexpr size_t         SC_SOURCE_DFL       = 0;
            static constexpr size_t         SC_TYPE_DFL         = 0;

            static constexpr float          FREQ_MIN            = 10.0f;
            static constexpr float          FREQ_MAX            = 20000.0f;
            static constexpr float          FREQ_DFL            = 1000.0f;
            static constexpr float          FREQ_STEP           = 0.002f;

            static constexpr float          OUT_FREQ_MIN        = 0.0f;
            static constexpr float          OUT_FREQ_MAX        = MAX_SAMPLE_RATE;
            static constexpr float          OUT_FREQ_DFL        = 1000.0f;
            static constexpr float          OUT_FREQ_STEP       = 0.002f;

            static constexpr float          REACTIVITY_MIN      = 0.000;    // Minimum reactivity [ms]
            static constexpr float          REACTIVITY_MAX      = 250;      // Maximum reactivity [ms]
            static constexpr float          REACTIVITY_DFL      = 10;       // Default reactivity [ms]
            static constexpr float          REACTIVITY_STEP     = 0.025;    // Reactivity step

            static constexpr float          ATTACK_LVL_MIN      = GAIN_AMP_M_60_DB;
            static constexpr float          ATTACK_LVL_MAX      = GAIN_AMP_0_DB;
            static constexpr float          ATTACK_LVL_DFL      = GAIN_AMP_M_12_DB;
            static constexpr float          ATTACK_LVL_STEP     = 0.05f;

            static constexpr float          RELEASE_LVL_MIN     = GAIN_AMP_M_INF_DB;
            static constexpr float          RELEASE_LVL_MAX     = GAIN_AMP_P_36_DB;
            static constexpr float          RELEASE_LVL_DFL     = GAIN_AMP_M_INF_DB;
            static constexpr float          RELEASE_LVL_STEP    = 0.05f;

            static constexpr float          ATTACK_TIME_MIN     = 0.0f;
            static constexpr float          ATTACK_TIME_MAX     = 2000.0f;
            static constexpr float          ATTACK_TIME_DFL     = 20.0f;
            static constexpr float          ATTACK_TIME_STEP    = 0.0025f;

            static constexpr float          RELEASE_TIME_MIN    = 0.0f;
            static constexpr float          RELEASE_TIME_MAX    = 5000.0f;
            static constexpr float          RELEASE_TIME_DFL    = 100.0f;
            static constexpr float          RELEASE_TIME_STEP   = 0.0025f;

            static constexpr float          RATIO_MIN           = 1.0f;
            static constexpr float          RATIO_MAX           = 100.0f;
            static constexpr float          RATIO_DFL           = 1.0f;
            static constexpr float          RATIO_STEP          = 0.0025f;

            static constexpr float          KNEE_MIN            = GAIN_AMP_M_24_DB;
            static constexpr float          KNEE_MAX            = GAIN_AMP_0_DB;
            static constexpr float          KNEE_DFL            = GAIN_AMP_M_6_DB;
            static constexpr float          KNEE_STEP           = 0.01f;

            static constexpr float          MAKEUP_MIN          = GAIN_AMP_M_60_DB;
            static constexpr float          MAKEUP_MAX          = GAIN_AMP_P_60_DB;
            static constexpr float          MAKEUP_DFL          = GAIN_AMP_0_DB;
            static constexpr float          MAKEUP_STEP         = 0.05f;

            static constexpr float          LOOKAHEAD_MIN       = 0.0f;
            static constexpr float          LOOKAHEAD_MAX       = 20.0f;
            static constexpr float          LOOKAHEAD_DFL       = 0.0f;
            static constexpr float          LOOKAHEAD_STEP      = 0.01f;

            static constexpr float          ZOOM_MIN            = GAIN_AMP_M_18_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.0125f;

            static constexpr size_t         MESH_POINTS         = 640;

            static constexpr size_t         CURVE_MESH_SIZE     = 256;
            static constexpr float          CURVE_DB_MIN        = -72;
            static constexpr float          CURVE_DB_MAX        = +24;

            static constexpr float          FREQ_BOOST_MIN      = 10.0f;
            static constexpr float          FREQ_BOOST_MAX      = 20000.0f;

            static constexpr size_t         FFT_RANK            = 13;
            static constexpr size_t         FFT_ITEMS           = 1 << FFT_RANK;
            static constexpr size_t         FFT_MESH_POINTS     = MESH_POINTS;
            static constexpr size_t         FILTER_MESH_POINTS  = MESH_POINTS + 2;
            static constexpr size_t         FFT_WINDOW          = dspu::windows::HANN;
            static constexpr size_t         FFT_REFRESH_RATE    = 20;
            static constexpr float          FFT_REACT_TIME_MIN  = 0.000;
            static constexpr float          FFT_REACT_TIME_MAX  = 1.000;
            static constexpr float          FFT_REACT_TIME_DFL  = 0.200;
            static constexpr float          FFT_REACT_TIME_STEP = 0.001;

            enum boost_t
            {
                FB_OFF,
                FB_BT_3DB,
                FB_MT_3DB,
                FB_BT_6DB,
                FB_MT_6DB,

                FB_DEFAULT              = FB_BT_3DB
            };

            enum mode_t
            {
                EM_DOWNWARD,
                EM_UPWARD
            };

            static constexpr size_t EM_DEFAULT              = EM_UPWARD;
        };

        extern const meta::plugin_t mb_expander_mono;
        extern const meta::plugin_t mb_expander_stereo;
        extern const meta::plugin_t mb_expander_lr;
        extern const meta::plugin_t mb_expander_ms;
        extern const meta::plugin_t sc_mb_expander_mono;
        extern const meta::plugin_t sc_mb_expander_stereo;
        extern const meta::plugin_t sc_mb_expander_lr;
        extern const meta::plugin_t sc_mb_expander_ms;
    } // namespace meta
} // namespace lsp


#endif /* PRIVATE_META_MB_EXPANDER_H_ */