Deluge Firmware
Loading...
Searching...
No Matches
compressor.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 COMPRESSOR_H
19#define COMPRESSOR_H
20
21#include "r_typedefs.h"
22
23class Song;
24
26{
27public:
28 Compressor();
29 void cloneFrom(Compressor* other);
30
31 uint8_t status;
32 uint32_t pos;
33 int32_t lastValue;
35
38
39 int32_t attack;
40 int32_t release;
41
42 uint8_t sync; // Basically, 0 is off, max value is 9. Higher numbers are shorter intervals (higher speed). 6 represents 8th-notes normally
43
44 int32_t render(uint16_t numSamples, int32_t shapeValue);
45 void registerHit(int32_t strength);
46 void registerHitRetrospectively(int32_t strength, uint32_t numSamplesAgo);
47
48private:
49 int32_t getActualAttackRate();
50 int32_t getActualReleaseRate();
51
52};
53
54#endif // COMPRESSOR_H
Definition: compressor.h:26
int32_t lastValue
Definition: compressor.h:33
void registerHit(int32_t strength)
Definition: compressor.cpp:57
int32_t attack
Definition: compressor.h:39
int32_t pendingHitStrength
Definition: compressor.h:34
uint8_t sync
Definition: compressor.h:42
int32_t envelopeOffset
Definition: compressor.h:36
int32_t release
Definition: compressor.h:40
void cloneFrom(Compressor *other)
Definition: compressor.cpp:49
uint32_t pos
Definition: compressor.h:32
uint8_t status
Definition: compressor.h:31
int32_t render(uint16_t numSamples, int32_t shapeValue)
Definition: compressor.cpp:118
Compressor()
Definition: compressor.cpp:26
void registerHitRetrospectively(int32_t strength, uint32_t numSamplesAgo)
Definition: compressor.cpp:61
int32_t envelopeHeight
Definition: compressor.h:37
Definition: song.h:72