LMMS
Loading...
Searching...
No Matches
modules_limit.h
Go to the documentation of this file.
1/* Calf DSP plugin pack
2 * Limiter related plugins
3 *
4 * Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02111-1307, USA.
20 */
21#ifndef CALF_MODULES_LIMIT_H
22#define CALF_MODULES_LIMIT_H
23
24#include <assert.h>
25#include <limits.h>
26#include "biquad.h"
27#include "inertia.h"
28#include "audio_fx.h"
29#include "giface.h"
30#include "metadata.h"
31#include "plugin_tools.h"
32#include "bypass.h"
33
34namespace calf_plugins {
35
36/**********************************************************************
37 * LIMITER by Christian Holschuh and Markus Schmidt
38**********************************************************************/
39
63
64/**********************************************************************
65 * MULTIBAND LIMITER by Markus Schmidt and Christian Holschuh
66**********************************************************************/
67
68class multibandlimiter_audio_module: public audio_module<multibandlimiter_metadata>, public frequency_response_line_graph {
69private:
71 static const int strips = 4;
73 int _mode;
74 bool solo[strips];
75 bool no_solo;
81 float over;
82 unsigned int pos;
83 unsigned int buffer_size;
84 unsigned int overall_buffer_size;
85 float *buffer;
87 float weight[strips];
89 float limit_old;
90 bool asc_old;
95public:
100 void activate();
101 void deactivate();
102 void params_changed();
103 void set_srates();
104 uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
105 void set_sample_rate(uint32_t sr);
106 bool get_graph(int index, int subindex, int phase, float *data, int points, cairo_iface *context, int *mode) const;
107 bool get_layers(int index, int generation, unsigned int &layers) const;
108};
109
110class sidechainlimiter_audio_module: public audio_module<sidechainlimiter_metadata>, public frequency_response_line_graph {
111private:
113 static const int strips = 5;
115 int _mode;
123 float over;
124 unsigned int pos;
125 unsigned int buffer_size;
127 float *buffer;
137public:
142 void activate();
143 void deactivate();
144 void params_changed();
145 void set_srates();
146 uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
147 void set_sample_rate(uint32_t sr);
148 bool get_graph(int index, int subindex, int phase, float *data, int points, cairo_iface *context, int *mode) const;
149 bool get_layers(int index, int generation, unsigned int &layers) const;
150};
151
152};
153
154#endif
Line graph interface implementation for frequency response graphs.
Definition giface.h:777
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask)
The audio processing loop; assumes numsamples <= MAX_SAMPLE_RUN, for larger buffers,...
Definition modules_limit.cpp:100
limiter_audio_module()
Definition modules_limit.cpp:41
int oversampling_old
Definition modules_limit.h:44
dsp::lookahead_limiter limiter
Definition modules_limit.h:45
void set_srates()
Definition modules_limit.cpp:65
limiter_audio_module AM
Definition modules_limit.h:42
dsp::resampleN resampler[2]
Definition modules_limit.h:46
float limit_old
Definition modules_limit.h:52
bool is_active
Definition modules_limit.h:51
bool asc_old
Definition modules_limit.h:53
void params_changed()
Called when params are changed (before processing).
Definition modules_limit.cpp:73
void activate()
LADSPA-esque activate function, except it is called after ports are connected, not before.
Definition modules_limit.cpp:52
float attack_old
Definition modules_limit.h:54
void deactivate()
LADSPA-esque deactivate function.
Definition modules_limit.cpp:60
uint32_t asc_led
Definition modules_limit.h:43
void set_sample_rate(uint32_t sr)
Set sample rate for the plugin.
Definition modules_limit.cpp:91
vumeters meters
Definition modules_limit.h:48
dsp::bypass bypass
Definition modules_limit.h:47
uint32_t srate
Definition modules_limit.h:50
multibandlimiter_audio_module AM
Definition modules_limit.h:70
dsp::resampleN resampler[strips][2]
Definition modules_limit.h:78
void deactivate()
LADSPA-esque deactivate function.
Definition modules_limit.cpp:233
unsigned int pos
Definition modules_limit.h:82
static const int strips
Definition modules_limit.h:71
bool no_solo
Definition modules_limit.h:75
bool get_layers(int index, int generation, unsigned int &layers) const
Definition modules_limit.cpp:577
bool _sanitize
Definition modules_limit.h:93
void set_srates()
Definition modules_limit.cpp:316
multibandlimiter_audio_module()
Definition modules_limit.cpp:190
bool is_active
Definition modules_limit.h:97
bool get_graph(int index, int subindex, int phase, float *data, int points, cairo_iface *context, int *mode) const
Definition modules_limit.cpp:573
unsigned int overall_buffer_size
Definition modules_limit.h:84
void set_sample_rate(uint32_t sr)
Set sample rate for the plugin.
Definition modules_limit.cpp:307
~multibandlimiter_audio_module()
Definition modules_limit.cpp:214
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask)
The audio processing loop; assumes numsamples <= MAX_SAMPLE_RUN, for larger buffers,...
Definition modules_limit.cpp:340
int _mode
Definition modules_limit.h:73
float * buffer
Definition modules_limit.h:85
uint32_t asc_led
Definition modules_limit.h:72
float weight[strips]
Definition modules_limit.h:87
void activate()
LADSPA-esque activate function, except it is called after ports are connected, not before.
Definition modules_limit.cpp:218
bool asc_old
Definition modules_limit.h:90
dsp::crossover crossover
Definition modules_limit.h:79
vumeters meters
Definition modules_limit.h:94
dsp::bypass bypass
Definition modules_limit.h:80
float oversampling_old
Definition modules_limit.h:92
float weight_old[strips]
Definition modules_limit.h:88
float attack_old
Definition modules_limit.h:91
float over
Definition modules_limit.h:81
dsp::lookahead_limiter broadband
Definition modules_limit.h:77
unsigned int buffer_size
Definition modules_limit.h:83
bool solo[strips]
Definition modules_limit.h:74
uint32_t srate
Definition modules_limit.h:96
void params_changed()
Called when params are changed (before processing).
Definition modules_limit.cpp:243
float limit_old
Definition modules_limit.h:89
int channels
Definition modules_limit.h:86
dsp::lookahead_limiter strip[strips]
Definition modules_limit.h:76
uint32_t cnt
Definition modules_limit.h:72
unsigned int buffer_size
Definition modules_limit.h:125
sidechainlimiter_audio_module AM
Definition modules_limit.h:112
float attack_old
Definition modules_limit.h:133
sidechainlimiter_audio_module()
Definition modules_limit.cpp:586
bool asc_old
Definition modules_limit.h:132
uint32_t cnt
Definition modules_limit.h:114
float over
Definition modules_limit.h:123
unsigned int overall_buffer_size
Definition modules_limit.h:126
void set_sample_rate(uint32_t sr)
Set sample rate for the plugin.
Definition modules_limit.cpp:706
static const int strips
Definition modules_limit.h:113
unsigned int pos
Definition modules_limit.h:124
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask)
The audio processing loop; assumes numsamples <= MAX_SAMPLE_RUN, for larger buffers,...
Definition modules_limit.cpp:739
void activate()
LADSPA-esque activate function, except it is called after ports are connected, not before.
Definition modules_limit.cpp:614
bool no_solo
Definition modules_limit.h:117
void set_srates()
Definition modules_limit.cpp:715
dsp::lookahead_limiter strip[strips]
Definition modules_limit.h:118
uint32_t asc_led
Definition modules_limit.h:114
bool solo[strips]
Definition modules_limit.h:116
float weight[strips]
Definition modules_limit.h:129
bool get_graph(int index, int subindex, int phase, float *data, int points, cairo_iface *context, int *mode) const
Definition modules_limit.cpp:917
int _mode
Definition modules_limit.h:115
uint32_t srate
Definition modules_limit.h:138
float * buffer
Definition modules_limit.h:127
bool get_layers(int index, int generation, unsigned int &layers) const
Definition modules_limit.cpp:921
~sidechainlimiter_audio_module()
Definition modules_limit.cpp:610
void deactivate()
LADSPA-esque deactivate function.
Definition modules_limit.cpp:629
bool is_active
Definition modules_limit.h:139
float oversampling_old
Definition modules_limit.h:134
int channels
Definition modules_limit.h:128
vumeters meters
Definition modules_limit.h:136
void params_changed()
Called when params are changed (before processing).
Definition modules_limit.cpp:639
float weight_old[strips]
Definition modules_limit.h:130
dsp::resampleN resampler[strips][2]
Definition modules_limit.h:120
dsp::lookahead_limiter broadband
Definition modules_limit.h:119
float limit_old
Definition modules_limit.h:131
dsp::bypass bypass
Definition modules_limit.h:122
bool _sanitize
Definition modules_limit.h:135
dsp::crossover crossover
Definition modules_limit.h:121
Definition plugin_tools.h:32
Definition bypass.h:9
Definition audio_fx.h:634
Lookahead Limiter by Markus Schmidt and Christian Holschuh.
Definition audio_fx.h:556
Definition audio_fx.h:677
JSAMPIMAGE data
Definition jpeglib.h:945
unsigned int uint32_t
Definition mid.cpp:100
Definition benchmark.cpp:53
png_structrp int mode
Definition png.h:1139
Definition giface.h:160
'provides live line graph values' interface
Definition giface.h:198