LMMS
Loading...
Searching...
No Matches
MultitapEcho.h
Go to the documentation of this file.
1/*
2 * MultitapEcho.h - a multitap echo delay plugin
3 *
4 * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
5 * Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 *
7 * This file is part of LMMS - https://lmms.io
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
23 *
24 */
25
26#ifndef MULTITAP_ECHO_H
27#define MULTITAP_ECHO_H
28
29#include "Effect.h"
31#include "RingBuffer.h"
32#include "BasicFilters.h"
33
34namespace lmms
35{
36
37
39{
40public:
41 MultitapEchoEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key );
42 ~MultitapEchoEffect() override;
43
44 ProcessStatus processImpl(SampleFrame* buf, const f_cnt_t frames) override;
45
47 {
48 return &m_controls;
49 }
50
51private:
52 void updateFilters( int begin, int end );
53 void runFilter( SampleFrame* dst, SampleFrame* src, StereoOnePole & filter, const f_cnt_t frames );
54
55 inline void setFilterFreq( float fc, StereoOnePole & f )
56 {
57 const float b1 = std::exp(-2 * std::numbers::pi_v<float> * fc);
58 f.setCoeffs( 1.0f - b1, b1 );
59 }
60
62
64
65 float m_amp [32];
66 float m_lpFreq [32];
67
70
73
75
77
78};
79
80
81} // namespace lmms
82
83#endif
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
float m_lpFreq[32]
Definition MultitapEcho.h:66
MultitapEchoEffect(Model *parent, const Descriptor::SubPluginFeatures::Key *key)
Definition MultitapEcho.cpp:55
float m_amp[32]
Definition MultitapEcho.h:65
EffectControls * controls() override
Definition MultitapEcho.h:46
void runFilter(SampleFrame *dst, SampleFrame *src, StereoOnePole &filter, const f_cnt_t frames)
Definition MultitapEcho.cpp:88
float m_sampleRatio
Definition MultitapEcho.h:72
StereoOnePole m_filter[32][4]
Definition MultitapEcho.h:69
friend class MultitapEchoControls
Definition MultitapEcho.h:76
void setFilterFreq(float fc, StereoOnePole &f)
Definition MultitapEcho.h:55
ProcessStatus processImpl(SampleFrame *buf, const f_cnt_t frames) override
Definition MultitapEcho.cpp:98
~MultitapEchoEffect() override
Definition MultitapEcho.cpp:70
int m_stages
Definition MultitapEcho.h:61
MultitapEchoControls m_controls
Definition MultitapEcho.h:63
SampleFrame * m_work
Definition MultitapEcho.h:74
float m_sampleRate
Definition MultitapEcho.h:71
void updateFilters(int begin, int end)
Definition MultitapEcho.cpp:76
RingBuffer m_buffer
Definition MultitapEcho.h:68
const Descriptor::SubPluginFeatures::Key & key() const
Definition Plugin.h:266
A basic LMMS ring buffer for single-thread use. For thread and realtime safe alternative see Lockless...
Definition RingBuffer.h:43
Definition SampleFrame.h:41
unsigned f
Definition inflate.c:1572
static uintptr_t parent
Definition pugl.h:1644
Definition AudioAlsa.cpp:35
OnePole< 2 > StereoOnePole
Definition BasicFilters.h:220
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43