File: spectrum_analyzer.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 (88 lines) | stat: -rw-r--r-- 4,050 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
/*
 * 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-spectrum-analyzer
 * Created on: 22 июн. 2021 г.
 *
 * lsp-plugins-spectrum-analyzer 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-spectrum-analyzer 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-spectrum-analyzer. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PRIVATE_META_SPECTRUM_ANALYZER_H_
#define PRIVATE_META_SPECTRUM_ANALYZER_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
{
    namespace meta
    {
        //-------------------------------------------------------------------------
        // Spectrum analyzer metadata
        struct spectrum_analyzer
        {
            static constexpr float          FREQ_MIN            = SPEC_FREQ_MIN;
            static constexpr float          FREQ_DFL            = 1000.0f;
            static constexpr float          FREQ_MAX            = SPEC_FREQ_MAX;

            static constexpr size_t         PORTS_PER_INPUT     = 6;
            static constexpr size_t         RANK_MIN            = 10;
            static constexpr size_t         RANK_DFL            = 12;
            static constexpr size_t         RANK_MAX            = 14;
            static constexpr size_t         MESH_POINTS         = 640;

            static constexpr float          THRESH_HI_DB        = 0.0f;
            static constexpr float          THRESH_LO_DB        = -48.0f;
            static constexpr float          SPECTRALIZER_BOOST  = 16.0f;
            static constexpr size_t         MMESH_STEP          = 16;
            static constexpr size_t         WND_DFL             = dspu::windows::HANN;
            static constexpr size_t         ENV_DFL             = dspu::envelope::PINK_NOISE;
            static constexpr size_t         FB_ROWS             = 360;
            static constexpr float          FB_TIME             = 8.0f;

            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          SELECTOR_MIN        = 0.01f;
            static constexpr float          SELECTOR_DFL        = 0.01f;
            static constexpr float          SELECTOR_MAX        = 100.0f;
            static constexpr float          SELECTOR_STEP       = 0.005f;

            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          PREAMP_DFL          = 1.0;

            static constexpr size_t         REFRESH_RATE        = 20;
        };

        extern const plugin_t spectrum_analyzer_x1;
        extern const plugin_t spectrum_analyzer_x2;
        extern const plugin_t spectrum_analyzer_x4;
        extern const plugin_t spectrum_analyzer_x8;
        extern const plugin_t spectrum_analyzer_x12;
        extern const plugin_t spectrum_analyzer_x16;
    }
}



#endif /* PRIVATE_META_SPECTRUM_ANALYZER_H_ */