LMMS
Loading...
Searching...
No Matches
Dispersion.h
Go to the documentation of this file.
1/*
2 * Dispersion.h
3 *
4 * Copyright (c) 2023 Lost Robot <r94231/at/gmail/dot/com>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25
26#ifndef LMMS_DISPERSION_H
27#define LMMS_DISPERSION_H
28
29#include "DispersionControls.h"
30#include "Effect.h"
31
32
33namespace lmms
34{
35
36constexpr inline int MAX_DISPERSION_FILTERS = 999;
37
39{
40public:
41 DispersionEffect(Model* parent, const Descriptor::SubPluginFeatures::Key* key);
42 ~DispersionEffect() override = default;
43
44 ProcessStatus processImpl(SampleFrame* buf, const f_cnt_t frames) override;
45
47 {
49 }
50
51 void runDispersionAP(const int filtNum, const float apCoeff1, const float apCoeff2, std::array<sample_t, 2> &put);
52
53private:
55
57
59
60 using Filter = std::array<sample_t, MAX_DISPERSION_FILTERS * 2>;
68
69 std::array<float, 2> m_feedbackVal{};
70 std::array<float, 2> m_integrator{};
71
72 friend class DispersionControls;
73};
74
75
76} // namespace lmms
77
78#endif // LMMS_DISPERSION_H
DispersionEffect(Model *parent, const Descriptor::SubPluginFeatures::Key *key)
Definition Dispersion.cpp:54
std::array< float, 2 > m_feedbackVal
Definition Dispersion.h:69
void runDispersionAP(const int filtNum, const float apCoeff1, const float apCoeff2, std::array< sample_t, 2 > &put)
Definition Dispersion.cpp:127
std::array< sample_t, MAX_DISPERSION_FILTERS *2 > Filter
Definition Dispersion.h:60
ProcessStatus processImpl(SampleFrame *buf, const f_cnt_t frames) override
Definition Dispersion.cpp:63
DispersionControls m_dispersionControls
Definition Dispersion.h:54
int m_amountVal
Definition Dispersion.h:58
std::array< float, 2 > m_integrator
Definition Dispersion.h:70
~DispersionEffect() override=default
EffectControls * controls() override
Definition Dispersion.h:46
float m_sampleRate
Definition Dispersion.h:56
friend class DispersionControls
Definition Dispersion.h:72
FilterState m_state
Definition Dispersion.h:67
Definition EffectControls.h:44
Effect(const Plugin::Descriptor *_desc, Model *_parent, const Descriptor::SubPluginFeatures::Key *_key)
Definition Effect.cpp:41
ProcessStatus
Definition Effect.h:147
Definition Model.h:37
const Descriptor::SubPluginFeatures::Key & key() const
Definition Plugin.h:266
Definition SampleFrame.h:41
static uintptr_t parent
Definition pugl.h:1644
Definition AudioAlsa.cpp:35
constexpr int MAX_DISPERSION_FILTERS
Definition Dispersion.h:36
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43
Definition Dispersion.h:61
Filter x0
Definition Dispersion.h:62
Filter y1
Definition Dispersion.h:65
Filter x1
Definition Dispersion.h:63
Filter y0
Definition Dispersion.h:64