LMMS
Loading...
Searching...
No Matches
Clip.h
Go to the documentation of this file.
1/*
2 Clip.h
3
4 Copyright 2004-5 Tim Goetze <tim@quitte.de>
5
6 http://quitte.de/dsp/
7
8 oversampled hard ('diode', 'transistor', sometimes 'op-amp') clipper.
9
10*/
11/*
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 02111-1307, USA or point your web browser to http://www.gnu.org.
26*/
27
28#ifndef _CLIP_H_
29#define _CLIP_H_
30
31#include "dsp/util.h"
32#include "dsp/FIR.h"
33#include "dsp/sinc.h"
34#include "dsp/windows.h"
35
36class Clip
37: public Plugin
38{
39 public:
41
43
44 enum {
47 };
48
49 /* antialias filters */
52
53 template <sample_func_t F>
54 void one_cycle (int frames);
55
57
58 public:
60
64 { }
65
66 void init();
67
68 void activate()
69 {
70 up.reset();
71 down.reset();
72 gain_db = *ports[1];
74 }
75
76 void run (int n)
77 {
79 }
80
81 void run_adding (int n)
82 {
84 }
85};
86
87#endif /* _CLIP_H_ */
LADSPA_Data sample_t
Definition basics.h:100
void run_adding(int n)
Definition Clip.h:81
sample_t clip(sample_t x)
Clip()
Definition Clip.h:61
static PortInfo port_info[]
Definition Clip.h:59
@ FIR_SIZE
Definition Clip.h:46
@ OVERSAMPLE
Definition Clip.h:45
DSP::FIR down
Definition Clip.h:51
void init()
void activate()
Definition Clip.h:68
sample_t gain_db
Definition Clip.h:40
DSP::FIRUpsampler up
Definition Clip.h:50
sample_t threshold[2]
Definition Clip.h:42
void one_cycle(int frames)
sample_t gain
Definition Clip.h:40
void run(int n)
Definition Clip.h:76
Definition FIR.h:42
Definition FIR.h:161
Definition basics.h:174
sample_t ** ports
Definition basics.h:182
unsigned x[BMAX+1]
Definition inflate.c:1586
double db2lin(double db)
Definition util.h:62
Definition basics.h:94
int n
Definition crypt.c:458