LMMS
Loading...
Searching...
No Matches
plugins
LadspaEffect
caps
dsp
Roessler.h
Go to the documentation of this file.
1
/*
2
dsp/Roessler.h
3
4
Copyright 2003-4 Tim Goetze <tim@quitte.de>
5
6
http://quitte.de/dsp/
7
8
Roessler fractal.
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 _DSP_ROESSLER_H_
29
#define _DSP_ROESSLER_H_
30
31
namespace
DSP
{
32
33
class
Roessler
34
{
35
public
:
36
double
x
[2],
y
[2],
z
[2];
37
double
h
,
a
,
b
,
c
;
38
int
I
;
39
40
public
:
41
Roessler
()
42
{
43
h
= 0.001;
44
a
= .2;
45
b
= .2;
46
c
= 5.7;
47
}
48
49
/* rate is normalized (0 .. 1) */
50
void
set_rate
(
double
r
)
51
{
52
h
=
max
(.000001,
r
* .096);
53
}
54
55
void
init
(
double
_h = .001,
double
seed = .0)
56
{
57
h
= _h;
58
59
I
= 0;
60
61
x
[0] = .0001 + .0001 * seed;
62
y
[0] = .0001;
63
z
[0] = .0001;
64
65
for
(
int
i
= 0;
i
< 5000; ++
i
)
66
get
();
67
}
68
69
sample_t
get
()
70
{
71
int
J =
I
^ 1;
72
73
x
[J] =
x
[
I
] +
h
* (-
y
[
I
] -
z
[
I
]);
74
y
[J] =
y
[
I
] +
h
* (
x
[
I
] +
a
*
y
[
I
]);
75
z
[J] =
z
[
I
] +
h
* (
b
+
z
[
I
] * (
x
[
I
] -
c
));
76
77
I
= J;
78
79
return
x
[
I
] * .01725 +
z
[
I
] * .015;
80
}
81
82
double
get_x
()
83
{
84
return
x
[
I
];
85
}
86
87
double
get_y
()
88
{
89
return
y
[
I
];
90
}
91
92
double
get_z
()
93
{
94
return
z
[
I
];
95
}
96
};
97
98
}
/* namespace DSP */
99
100
#endif
/* _DSP_ROESSLER_H_ */
sample_t
LADSPA_Data sample_t
Definition
basics.h:100
DSP::Roessler::init
void init(double _h=.001, double seed=.0)
Definition
Roessler.h:55
DSP::Roessler::x
double x[2]
Definition
Roessler.h:36
DSP::Roessler::y
double y[2]
Definition
Roessler.h:36
DSP::Roessler::b
double b
Definition
Roessler.h:37
DSP::Roessler::get
sample_t get()
Definition
Roessler.h:69
DSP::Roessler::get_x
double get_x()
Definition
Roessler.h:82
DSP::Roessler::z
double z[2]
Definition
Roessler.h:36
DSP::Roessler::set_rate
void set_rate(double r)
Definition
Roessler.h:50
DSP::Roessler::I
int I
Definition
Roessler.h:38
DSP::Roessler::Roessler
Roessler()
Definition
Roessler.h:41
DSP::Roessler::get_y
double get_y()
Definition
Roessler.h:87
DSP::Roessler::a
double a
Definition
Roessler.h:37
DSP::Roessler::get_z
double get_z()
Definition
Roessler.h:92
DSP::Roessler::h
double h
Definition
Roessler.h:37
DSP::Roessler::c
double c
Definition
Roessler.h:37
i
register unsigned i
Definition
inflate.c:1575
DSP
Definition
BiQuad.h:31
max
#define max(x, y)
Definition
os.h:78
r
int r
Definition
crypt.c:458
Generated on
for LMMS by
1.16.1