LMMS
Loading...
Searching...
No Matches
Cabinet.h
Go to the documentation of this file.
1/*
2 Cabinet.h
3
4 Copyright 2002-5 Tim Goetze <tim@quitte.de>
5
6 http://quitte.de/dsp/
7
8 CabinetI - 16th order IIR filters modeled after various impulse responses
9 from Steve Harris' 'imp' plugin. Limited to 44.1 kHz sample rate.
10
11 CabinetII - 32nd order IIR filters modeled after the same impulse responses
12 using a different algorithm. Versions for 44.1 / 48 / 88.2 / 96 kHz sample
13 rates, switched at runtime.
14*/
15/*
16 This program is free software; you can redistribute it and/or
17 modify it under the terms of the GNU General Public License
18 as published by the Free Software Foundation; either version 2
19 of the License, or (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 02111-1307, USA or point your web browser to http://www.gnu.org.
30*/
31
32#ifndef _CABINET_H_
33#define _CABINET_H_
34
35#include "dsp/util.h"
36
37/* cabinet_float sets the data type used for the IIR history and thus the
38 * computing precision. doubles tend to make the sound more vivid and lively.
39 * You can squeeze out a few extra cycles by making this 'float' if needed.
40 * Be warned though that CabinetII has not been tested with 32-bit floats and
41 * might become unstable due to the lower computing precision. */
42typedef double cabinet_float;
43
44typedef struct {
45 int n;
46 cabinet_float a[16], b[16];
47 float gain;
48} Model16;
49
50typedef struct {
51 int n;
52 cabinet_float a[32], b[32];
53 float gain;
54} Model32;
55
57: public Plugin
58{
59 public:
61 static Model16 models [];
62
63 int model;
64 void switch_model (int m);
65
66 int n, h;
68 cabinet_float x[16], y[16];
69
70 template <sample_func_t F>
71 void one_cycle (int frames);
72
73 public:
75
76 void init();
77
78 void activate();
79
80 void run (int n)
81 {
83 }
84
85 void run_adding (int n)
86 {
88 }
89};
90
91/* Second version with 32nd order filters precalculated for
92 * 44.1 / 48 / 88.2 / 96 kHz sample rates */
93
95: public Plugin
96{
97 public:
99
100 static Model32 models44100 [];
101 static Model32 models48000 [];
102 static Model32 models88200 [];
103 static Model32 models96000 [];
104
106 int model;
107 void switch_model (int m);
108
109 int n, h;
111 cabinet_float x[32], y[32];
112
113 template <sample_func_t F>
114 void one_cycle (int frames);
115
116 public:
118
120
121 void init();
122 void activate();
123
124 void run (int n)
125 {
127 }
128
129 void run_adding (int n)
130 {
132 }
134
135#endif /* _CABINET_H_ */
double cabinet_float
Definition Cabinet.h:42
LADSPA_Data sample_t
Definition basics.h:100
Definition Cabinet.h:58
int h
Definition Cabinet.h:66
void switch_model(int m)
static PortInfo port_info[]
Definition Cabinet.h:74
int n
Definition Cabinet.h:66
void init()
void run(int n)
Definition Cabinet.h:80
int model
Definition Cabinet.h:63
sample_t gain
Definition Cabinet.h:60
void activate()
cabinet_float * b
Definition Cabinet.h:67
void one_cycle(int frames)
cabinet_float x[16]
Definition Cabinet.h:68
static Model16 models[]
Definition Cabinet.h:61
cabinet_float * a
Definition Cabinet.h:67
cabinet_float y[16]
Definition Cabinet.h:68
void run_adding(int n)
Definition Cabinet.h:85
Definition Cabinet.h:96
static Model32 models44100[]
Definition Cabinet.h:29
cabinet_float x[32]
Definition Cabinet.h:111
cabinet_float * b
Definition Cabinet.h:110
int model
Definition Cabinet.h:106
void one_cycle(int frames)
sample_t gain
Definition Cabinet.h:98
static Model32 models88200[]
Definition Cabinet.h:133
void init()
void switch_model(int m)
static Model32 models96000[]
Definition Cabinet.h:185
int n
Definition Cabinet.h:109
Model32 * models
Definition Cabinet.h:105
void run_adding(int n)
Definition Cabinet.h:129
cabinet_float * a
Definition Cabinet.h:110
static PortInfo port_info[]
Definition Cabinet.h:117
sample_t adding_gain
Definition Cabinet.h:119
int h
Definition Cabinet.h:109
void run(int n)
Definition Cabinet.h:124
cabinet_float y[32]
Definition Cabinet.h:111
static Model32 models48000[]
Definition Cabinet.h:81
void activate()
Definition basics.h:174
unsigned * m
Definition inflate.c:1559
Definition Cabinet.h:44
float gain
Definition Cabinet.h:47
cabinet_float a[16]
Definition Cabinet.h:46
cabinet_float b[16]
Definition Cabinet.h:46
int n
Definition Cabinet.h:45
Definition Cabinet.h:50
float gain
Definition Cabinet.h:53
cabinet_float b[32]
Definition Cabinet.h:52
cabinet_float a[32]
Definition Cabinet.h:52
int n
Definition Cabinet.h:51
Definition basics.h:94