LMMS
Loading...
Searching...
No Matches
Envelope.h
Go to the documentation of this file.
1/*
2 ZynAddSubFX - a software synthesizer
3
4 Envelope.h - Envelope implementation
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
23#ifndef ENVELOPE_H
24#define ENVELOPE_H
25
26#include "../globals.h"
28
30class Envelope
31{
32 public:
33
35 Envelope(class EnvelopeParams *envpars, float basefreq);
37 ~Envelope();
38 void relasekey();
39 float envout();
40 float envout_dB();
43 bool finished() const;
44 private:
45 float env_rap2dB(float rap);
46 float env_dB2rap(float db);
48 int envsustain; //"-1" means disabled
49 float envdt[MAX_ENVELOPE_POINTS]; //millisecons
50 float envval[MAX_ENVELOPE_POINTS]; // [0.0f .. 1.0f]
53
54 int currentpoint; //current envelope point (starts from 1)
56 bool keyreleased; //if the key was released
58 float t; // the time from the last point
59 float inct; // the time increment
60 float envoutval; //used to do the forced release
61};
62
63
64#endif
#define MAX_ENVELOPE_POINTS
Definition globals.h:191
Definition analogue.cpp:67
float t
Definition Envelope.h:58
~Envelope()
Definition Envelope.cpp:91
float env_rap2dB(float rap)
Definition Envelope.cpp:166
void relasekey()
Definition Envelope.cpp:98
int envpoints
Definition Envelope.h:47
float envoutval
Definition Envelope.h:60
int linearenvelope
Definition Envelope.h:52
int currentpoint
Definition Envelope.h:54
bool envfinish
Definition Envelope.h:57
bool finished() const
Definition Envelope.cpp:203
float envdt[MAX_ENVELOPE_POINTS]
Definition Envelope.h:49
float envout()
Definition Envelope.cpp:110
float envval[MAX_ENVELOPE_POINTS]
Definition Envelope.h:50
float envstretch
Definition Envelope.h:51
float envout_dB()
Definition Envelope.cpp:173
Envelope()
Definition analogue.cpp:71
int forcedrelase
Definition Envelope.h:55
int envsustain
Definition Envelope.h:48
float env_dB2rap(float db)
Definition Envelope.cpp:162
float inct
Definition Envelope.h:59
bool keyreleased
Definition Envelope.h:56