Deluge Firmware
Loading...
Searching...
No Matches
envelope.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef ENVELOPE_H
19#define ENVELOPE_H
20
21#include "r_typedefs.h"
22#include "definitions.h"
23
24class Sound;
25class Voice;
27
29{
30public:
31 Envelope();
32
33 uint32_t pos;
34 uint8_t state; // You may not set this directly, even from this class. Call setState()
35 int32_t lastValue;
40 int32_t noteOn(bool directlyToDecay);
41 int32_t noteOn(uint8_t envelopeIndex, Sound* sound, Voice* voice);
42 void noteOff(uint8_t envelopeIndex, Sound* sound, ParamManagerForTimeline* paramManager);
43 int32_t render(uint32_t numSamples, uint32_t attack, uint32_t decay, uint32_t sustain, uint32_t release, const uint16_t* releaseTable);
44 void unconditionalRelease(uint8_t typeOfRelease = ENVELOPE_STAGE_RELEASE, uint32_t newFastReleaseIncrement = 4096);
45 void resumeAttack(int32_t oldLastValue);
46
47private:
48 void setState(uint8_t newState);
49};
50
51
52#endif // ENVELOPE_H
Definition: envelope.h:29
void noteOff(uint8_t envelopeIndex, Sound *sound, ParamManagerForTimeline *paramManager)
Definition: envelope.cpp:128
uint32_t pos
Definition: envelope.h:33
uint32_t fastReleaseIncrement
Definition: envelope.h:39
int32_t lastValuePreCurrentStage
Definition: envelope.h:36
void resumeAttack(int32_t oldLastValue)
Definition: envelope.cpp:151
uint32_t timeEnteredState
Definition: envelope.h:37
int32_t lastValue
Definition: envelope.h:35
int32_t render(uint32_t numSamples, uint32_t attack, uint32_t decay, uint32_t sustain, uint32_t release, const uint16_t *releaseTable)
Definition: envelope.cpp:29
uint8_t state
Definition: envelope.h:34
bool ignoredNoteOff
Definition: envelope.h:38
Envelope()
Definition: envelope.cpp:24
void unconditionalRelease(uint8_t typeOfRelease=ENVELOPE_STAGE_RELEASE, uint32_t newFastReleaseIncrement=4096)
Definition: envelope.cpp:143
int32_t noteOn(bool directlyToDecay)
Definition: envelope.cpp:105
Definition: ParamManager.h:166
Definition: sound.h:66
Definition: voice.h:33
#define ENVELOPE_STAGE_RELEASE
Definition: definitions.h:334