LMMS
Loading...
Searching...
No Matches
VCO.h
Go to the documentation of this file.
1/*
2 VCO.h
3
4 Copyright 2004-5 Tim Goetze <tim@quitte.de>
5
6 http://quitte.de/dsp/
7
8 an oversampled triangle/saw/square oscillator, and a combination of two
9 such oscillators with hard sync.
10
11*/
12/*
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License
15 as published by the Free Software Foundation; either version 2
16 of the License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 02111-1307, USA or point your web browser to http://www.gnu.org.
27*/
28
29#ifndef _VCO_H_
30#define _VCO_H_
31
32#include "dsp/util.h"
33#include "dsp/VCO.h"
34
35#include "dsp/FIR.h"
36#include "dsp/sinc.h"
37#include "dsp/windows.h"
38
39class VCOs
40: public Plugin
41{
42 public:
44
45 /* ok to just change these as you please, 4/32 works ok, sortof. */
46 enum {
48 FIR_SIZE = 64,
49 };
50
52
53 /* downsampling filter */
55
56 template <sample_func_t F>
57 void one_cycle (int frames);
58
59 public:
61
63 : down (FIR_SIZE)
64 { }
65
66 void init();
67 void activate()
68 {
69 gain = *ports[3];
70 down.reset();
71 vco.reset();
72 }
73
74 void run (int n)
75 {
77 }
78
79 void run_adding (int n)
80 {
82 }
83};
84
85/* //////////////////////////////////////////////////////////////////////// */
86
87class VCOd
88: public Plugin
89{
90 public:
91 double fs;
93
94 /* ok to just change these as you please, 4/32 works ok, sortof. */
95 enum {
97 FIR_SIZE = 64,
98 };
99
101
102 /* downsampling filter */
104
105 template <sample_func_t F>
106 void one_cycle (int frames);
107
108 public:
110
112 : down (FIR_SIZE)
113 { }
114
115 void init();
116 void activate()
117 {
118 gain = *ports[8];
119 down.reset();
120 vco.reset();
121 }
122
123 void run (int n)
124 {
126 }
127
128 void run_adding (int n)
129 {
131 }
132};
133
134#endif /* _VCO_H_ */
LADSPA_Data sample_t
Definition basics.h:100
Definition FIR.h:42
Definition VCO.h:92
Definition VCO.h:182
Definition basics.h:174
sample_t ** ports
Definition basics.h:182
DSP::VCO2 vco
Definition VCO.h:100
sample_t gain
Definition VCO.h:92
VCOd()
Definition VCO.h:111
void one_cycle(int frames)
@ OVERSAMPLE
Definition VCO.h:96
@ FIR_SIZE
Definition VCO.h:97
void run_adding(int n)
Definition VCO.h:128
void init()
void activate()
Definition VCO.h:116
sample_t f
Definition VCO.h:92
void run(int n)
Definition VCO.h:123
DSP::FIR down
Definition VCO.h:103
double fs
Definition VCO.h:91
static PortInfo port_info[]
Definition VCO.h:109
void run_adding(int n)
Definition VCO.h:79
DSP::TriSawSquare vco
Definition VCO.h:51
@ FIR_SIZE
Definition VCO.h:48
@ OVERSAMPLE
Definition VCO.h:47
static PortInfo port_info[]
Definition VCO.h:60
void init()
void activate()
Definition VCO.h:67
sample_t gain
Definition VCO.h:43
void run(int n)
Definition VCO.h:74
void one_cycle(int frames)
sample_t f
Definition VCO.h:43
DSP::FIR down
Definition VCO.h:54
VCOs()
Definition VCO.h:62
Definition basics.h:94
int n
Definition crypt.c:458