Amuse
Main Page
Classes
Files
File List
Envelope.hpp
1
#ifndef __AMUSE_ENVELOPE_HPP__
2
#define __AMUSE_ENVELOPE_HPP__
3
4
#include "AudioGroupPool.hpp"
5
6
namespace
amuse
7
{
8
10
class
Envelope
11
{
12
public
:
13
enum class
State
14
{
15
Attack,
16
Decay,
17
Sustain,
18
Release,
19
Complete
20
};
21
private
:
22
State m_phase = State::Attack;
23
double
m_attackTime = 0.0;
24
double
m_decayTime = 0.0;
25
double
m_sustainFactor = 1.0;
26
double
m_releaseTime = 0.0;
27
double
m_releaseStartFactor;
28
double
m_curTime;
29
public
:
30
void
reset(
const
ADSR
* adsr);
31
void
reset(
const
ADSRDLS
* adsr, int8_t note, int8_t vel);
32
void
keyOff();
33
float
nextSample(
double
sampleRate);
34
bool
isComplete()
const
{
return
m_phase == State::Complete;}
35
};
36
37
}
38
39
#endif // __AMUSE_ENVELOPE_HPP__
amuse::ADSR
Definition:
AudioGroupPool.hpp:23
amuse::ADSRDLS
Definition:
AudioGroupPool.hpp:41
amuse
Definition:
AudioGroup.hpp:8
amuse::Envelope
Definition:
Envelope.hpp:10
include
amuse
Envelope.hpp
Generated on Wed May 18 2016 20:05:19 for Amuse by
1.8.11