File: trigger.h

package info (click to toggle)
lsp-plugins 1.2.26-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 130,004 kB
  • sloc: cpp: 642,749; xml: 78,805; makefile: 14,229; php: 1,361; sh: 185
file content (134 lines) | stat: -rw-r--r-- 8,103 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
/*
 * 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-trigger
 * Created on: 31 июл. 2021 г.
 *
 * lsp-plugins-trigger 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-trigger 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-trigger. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PRIVATE_META_TRIGGER_H_
#define PRIVATE_META_TRIGGER_H_

#include <lsp-plug.in/plug-fw/meta/types.h>
#include <lsp-plug.in/plug-fw/const.h>

namespace lsp
{
    namespace meta
    {
        //-------------------------------------------------------------------------
        // Sampler metadata
        struct trigger_metadata
        {
            static constexpr float SAMPLE_PITCH_MIN         = -24.0f;   // Minimum pitch (st)
            static constexpr float SAMPLE_PITCH_MAX         = 24.0f;    // Maximum pitch (st)
            static constexpr float SAMPLE_PITCH_DFL         = 0.0f;     // Pitch (st)
            static constexpr float SAMPLE_PITCH_STEP        = 0.01f;    // Pitch step (st)

            static constexpr float SAMPLE_LENGTH_MIN        = 0.0f;     // Minimum length (ms)
            static constexpr float SAMPLE_LENGTH_MAX        = 64000.0f; // Maximum sample length (ms)
            static constexpr float SAMPLE_LENGTH_DFL        = 0.0f;     // Sample length (ms)
            static constexpr float SAMPLE_LENGTH_STEP       = 0.1f;     // Sample step (ms)

            static constexpr float PREDELAY_MIN             = 0.0f;     // Pre-delay min (ms)
            static constexpr float PREDELAY_MAX             = 100.0f;   // Pre-delay max (ms)
            static constexpr float PREDELAY_DFL             = 0.0f;     // Pre-delay default (ms)
            static constexpr float PREDELAY_STEP            = 0.1f;     // Pre-delay step (ms)

            static constexpr size_t MESH_SIZE               = 320;      // Maximum mesh size
            static constexpr size_t TRACKS_MAX              = 2;        // Maximum tracks per mesh/sample
            static constexpr size_t SAMPLE_FILES            = 8;        // Number of sample files per trigger
            static constexpr size_t BUFFER_SIZE             = 4096;     // Size of temporary buffer
            static constexpr size_t PLAYBACKS_MAX           = 8192;     // Maximum number of simultaneously playing samples
            static constexpr float ACTIVITY_LIGHTING        = 0.1f;     // Activity lighting (seconds)

            static constexpr float  DETECT_LEVEL_DFL        = GAIN_AMP_M_12_DB;     // Default detection level [G]

            static constexpr float  RELEASE_LEVEL_MIN       = 0.0f;     // Minimum relative release level
            static constexpr float  RELEASE_LEVEL_DFL       = GAIN_AMP_M_3_DB;      // Default release level [G]
            static constexpr float  RELEASE_LEVEL_MAX       = 0.0f;     // Maximum relative release level
            static constexpr float  RELEASE_LEVEL_STEP      = 0.0001f;  // Release level step [G]

            static constexpr float  DETECT_TIME_MIN         = 0.0f;     // Minimum detection time [ms]
            static constexpr float  DETECT_TIME_DFL         = 5.0f;     // Default detection time [ms]
            static constexpr float  DETECT_TIME_MAX         = 20.0f;    // Maximum detection time [ms]
            static constexpr float  DETECT_TIME_STEP        = 0.0025f;  // Detection time step [ms]

            static constexpr float  RELEASE_TIME_MIN        = 0.0f;     // Minimum release time [ms]
            static constexpr float  RELEASE_TIME_DFL        = 10.0f;    // Default release time [ms]
            static constexpr float  RELEASE_TIME_MAX        = 100.0f;   // Maximum release time [ms]
            static constexpr float  RELEASE_TIME_STEP       = 0.005f;   // Release time step [ms]

            static constexpr float  DYNAMICS_MIN            = 0.0f;     // Minimum dynamics [%]
            static constexpr float  DYNAMICS_DFL            = 10.0f;    // Default dynamics [%]
            static constexpr float  DYNAMICS_MAX            = 100.0f;   // Maximum dynamics [%]
            static constexpr float  DYNAMICS_STEP           = 0.05f;    // Dynamics step [%]

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

            static constexpr float  MAXVEL_MIN              = 0.0f;     // Minimum sample velocity [%]
            static constexpr float  MAXVEL_MAX              = 100.0f;   // Maximum sample velocity [%]
            static constexpr float  MAXVEL_DFL              = 0.0f;     // Default sample velocity [%]
            static constexpr float  MAXVEL_STEP             = 0.25f;    // Sample velocity step [%]

            static constexpr float  MIDINOTE_MIN            = 0.0f;     // MIDI note meter minimum value
            static constexpr float  MIDINOTE_MAX            = 127.0f;   // MIDI note meter maximum value
            static constexpr float  MIDINOTE_DFL            = 0.0f;     // MIDI note meter default value
            static constexpr float  MIDINOTE_STEP           = 1.0f;     // MIDI note meter step

            static constexpr float  HISTORY_TIME            = 5.0f;     // Amount of time to display history [s]
            static constexpr size_t HISTORY_MESH_SIZE       = 640;      // 640 dots for history

            static constexpr float  HPF_MIN                 = 10.0f;
            static constexpr float  HPF_MAX                 = 20000.0f;
            static constexpr float  HPF_DFL                 = 10.0f;
            static constexpr float  HPF_STEP                = 0.0025f;

            static constexpr float  LPF_MIN                 = 10.0f;
            static constexpr float  LPF_MAX                 = 20000.0f;
            static constexpr float  LPF_DFL                 = 20000.0f;
            static constexpr float  LPF_STEP                = 0.0025f;

            static constexpr float DRIFT_MIN                = 0.0f;     // Minimum delay
            static constexpr float DRIFT_DFL                = 0.0f;     // Default delay
            static constexpr float DRIFT_STEP               = 0.1f;     // Delay step
            static constexpr float DRIFT_MAX                = 100.0f;   // Maximum delay

            static constexpr float DYNA_MIN                 = 0.0f;     // Minimum dynamics
            static constexpr float DYNA_DFL                 = 0.0f;     // Default dynamics
            static constexpr float DYNA_STEP                = 0.05f;    // Dynamics step
            static constexpr float DYNA_MAX                 = 100.0f;   // Maximum dynamics

            static constexpr size_t MODE_DFL                = 1;        // RMS

            static constexpr size_t MIDI_CHANNEL_DFL        = 0;        // Default channel
            static constexpr size_t MIDI_NOTE_DFL           = 11;       // B
            static constexpr size_t MIDI_OCTAVE_DFL         = 2;        // 2nd octave
        };

        // Different samplers
        extern const plugin_t trigger_mono;
        extern const plugin_t trigger_stereo;
        extern const plugin_t trigger_midi_mono;
        extern const plugin_t trigger_midi_stereo;

    } // namespace meta
} // namespace lsp

#endif /* PRIVATE_META_TRIGGER_H_ */