LMMS
Loading...
Searching...
No Matches
Resonance.h
Go to the documentation of this file.
1/*
2 ZynAddSubFX - a software synthesizer
3
4 Resonance.h - Resonance
5 Copyright (C) 2002-2005 Nasca Octavian Paul
6 Author: Nasca Octavian Paul
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of version 2 of the GNU General Public License
10 as published by the Free Software Foundation.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License (version 2 or later) for more details.
16
17 You should have received a copy of the GNU General Public License (version 2)
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21*/
22#ifndef RESONANCE_H
23#define RESONANCE_H
24
25#include "../globals.h"
26#include "../Misc/Util.h"
27#include "../Misc/XMLwrapper.h"
28#include "../Params/Presets.h"
29#include "../DSP/FFTwrapper.h"
30
31#define N_RES_POINTS 256
32
33class Resonance:public Presets
34{
35 public:
36 Resonance();
37 ~Resonance();
38 void setpoint(int n, unsigned char p);
39 void applyres(int n, fft_t *fftdata, float freq);
40 void smooth();
41 void interpolatepeaks(int type);
42 void randomize(int type);
43
44 void add2XML(XMLwrapper *xml);
45 void defaults();
46 void getfromXML(XMLwrapper *xml);
47
48
49 float getfreqpos(float freq);
50 float getfreqx(float x);
51 float getfreqresponse(float freq);
52 float getcenterfreq();
53 float getoctavesfreq();
54 void sendcontroller(MidiControllers ctl, float par);
55
56 //parameters
57 unsigned char Penabled; //if the ressonance is enabled
58 unsigned char Prespoints[N_RES_POINTS]; //how many points define the resonance function
59 unsigned char PmaxdB; //how many dB the signal may be amplified
60 unsigned char Pcenterfreq, Poctavesfreq; //the center frequency of the res. func., and the number of octaves
61 unsigned char Pprotectthefundamental; //the fundamental (1-st harmonic) is not damped, even it resonance function is low
62
63 //controllers
64 float ctlcenter; //center frequency(relative)
65 float ctlbw; //bandwidth(relative)
66
67 private:
68};
69
70#endif
std::complex< fftw_real > fft_t
Definition FFTwrapper.h:28
#define N_RES_POINTS
Definition Resonance.h:31
MidiControllers
Definition globals.h:170
Presets()
Definition Presets.cpp:27
char type[MAX_PRESETTYPE_SIZE]
Definition Presets.h:43
unsigned char Penabled
Definition Resonance.h:57
float getfreqpos(float freq)
Definition Resonance.cpp:209
unsigned char Poctavesfreq
Definition Resonance.h:60
void sendcontroller(MidiControllers ctl, float par)
Definition Resonance.cpp:230
unsigned char Pcenterfreq
Definition Resonance.h:60
void add2XML(XMLwrapper *xml)
Definition Resonance.cpp:241
float getoctavesfreq()
Definition Resonance.cpp:225
void interpolatepeaks(int type)
Definition Resonance.cpp:178
void randomize(int type)
Definition Resonance.cpp:160
void defaults()
Definition Resonance.cpp:36
float ctlcenter
Definition Resonance.h:64
void setpoint(int n, unsigned char p)
Definition Resonance.cpp:52
unsigned char Pprotectthefundamental
Definition Resonance.h:61
void applyres(int n, fft_t *fftdata, float freq)
Definition Resonance.cpp:62
unsigned char PmaxdB
Definition Resonance.h:59
float ctlbw
Definition Resonance.h:65
float getfreqresponse(float freq)
Definition Resonance.cpp:107
float getcenterfreq()
Definition Resonance.cpp:217
unsigned char Prespoints[N_RES_POINTS]
Definition Resonance.h:58
void getfromXML(XMLwrapper *xml)
Definition Resonance.cpp:261
Resonance()
Definition Resonance.cpp:26
~Resonance()
Definition Resonance.cpp:32
float getfreqx(float x)
Definition Resonance.cpp:198
void smooth()
Definition Resonance.cpp:141
unsigned x[BMAX+1]
Definition inflate.c:1586
JHUFF_TBL long freq[]
Definition jchuff.h:50
int n
Definition crypt.c:458
uch * p
Definition crypt.c:594