LMMS
Loading...
Searching...
No Matches
Phaser.h
Go to the documentation of this file.
1/*
2 Phaser.h
3
4 Copyright 2002-5 Tim Goetze <tim@quitte.de>
5
6 http://quitte.de/dsp/
7
8 Standard and fractal-modulated phaser units.
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 _PHASER_H_
29#define _PHASER_H_
30
31#include "dsp/Sine.h"
32#include "dsp/Lorenz.h"
33#include "dsp/Delay.h"
34
35/* all-pass as used by the phaser. */
37{
38 public:
40
42 {
43 a = m = 0.;
44 }
45
46 void set (double delay)
47 {
48 a = (1 - delay) / (1 + delay);
49 }
50
52 {
53 sample_t y = -a * x + m;
54 m = a * y + x;
55
56 return y;
57 }
58};
59
61: public Plugin
62{
63 public:
66
69
70 struct {
71 double bottom, range;
73
74 template <sample_func_t>
75 void one_cycle (int frames);
76
78
79 public:
81
82 void init()
83 {
84 blocksize = 32;
85 }
86
87 void activate()
88 {
89 y0 = 0.;
90 remain = 0;
91
92 delay.bottom = 400. / fs;
93 delay.range = 2200. / fs;
94
95 rate = -1; /* force lfo reset in one_cycle() */
96 }
97
98 void run (int n)
99 {
101 }
102
103 void run_adding (int n)
104 {
106 }
107};
108
109/* same as above, but filter sweep is controlled by a Lorenz fractal */
110
112: public Plugin
113{
114 public:
115 double fs;
116
119
122
123 struct {
124 double bottom, range;
126
127 template <sample_func_t>
128 void one_cycle (int frames);
129
131
132 public:
134
135 void init()
136 {
137 blocksize = 32;
138 lorenz.init();
139 }
140
141 void activate()
142 {
143 y0 = 0.;
144 remain = 0;
145
146 delay.bottom = 400. / fs;
147 delay.range = 2200. / fs;
148
149 rate = -1; /* force lfo reset in one_cycle() */
150 }
151
152 void run (int n)
153 {
155 }
156
157 void run_adding (int n)
158 {
160 }
161};
162
163
164#endif /* _PHASER_H_ */
LADSPA_Data sample_t
Definition basics.h:100
Definition Lorenz.h:34
Definition Sine.h:34
Definition Phaser.h:37
PhaserAP()
Definition Phaser.h:41
sample_t process(sample_t x)
Definition Phaser.h:51
sample_t a
Definition Phaser.h:39
void set(double delay)
Definition Phaser.h:46
sample_t m
Definition Phaser.h:39
Definition Phaser.h:62
void run(int n)
Definition Phaser.h:98
sample_t rate
Definition Phaser.h:67
double range
Definition Phaser.h:71
PhaserAP ap[6]
Definition Phaser.h:64
static PortInfo port_info[]
Definition Phaser.h:80
int blocksize
Definition Phaser.h:77
sample_t y0
Definition Phaser.h:68
void init()
Definition Phaser.h:82
DSP::Sine lfo
Definition Phaser.h:65
void one_cycle(int frames)
struct PhaserI::@317261115020037365121247251347155227004157151140 delay
void activate()
Definition Phaser.h:87
void run_adding(int n)
Definition Phaser.h:103
int remain
Definition Phaser.h:77
double bottom
Definition Phaser.h:71
Definition Phaser.h:113
double range
Definition Phaser.h:124
int remain
Definition Phaser.h:130
void init()
Definition Phaser.h:135
void one_cycle(int frames)
static PortInfo port_info[]
Definition Phaser.h:133
sample_t y0
Definition Phaser.h:121
void run(int n)
Definition Phaser.h:152
void run_adding(int n)
Definition Phaser.h:157
double bottom
Definition Phaser.h:124
double fs
Definition Phaser.h:115
int blocksize
Definition Phaser.h:130
struct PhaserII::@140261062211302135223127364303360214260372025144 delay
sample_t rate
Definition Phaser.h:120
DSP::Lorenz lorenz
Definition Phaser.h:118
PhaserAP ap[6]
Definition Phaser.h:117
void activate()
Definition Phaser.h:141
Definition basics.h:174
double fs
Definition basics.h:176
int y
Definition inflate.c:1588
unsigned x[BMAX+1]
Definition inflate.c:1586
Definition basics.h:94
int n
Definition crypt.c:458