Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
global_effectable.h
1/*
2 * Copyright © 2016-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#pragma once
19
20#include "definitions_cxx.hpp"
21#include "dsp/filter/filter_set.h"
22#include "model/mod_controllable/mod_controllable_audio.h"
23#include "modulation/arpeggiator.h"
24using namespace deluge;
25class Serializer;
26
27class GlobalEffectable : public ModControllableAudio {
28public:
29 GlobalEffectable();
30 void cloneFrom(ModControllableAudio* other) override;
31
32 static void initParams(ParamManager* paramManager);
33 static void initParamsForAudioClip(ParamManagerForTimeline* paramManager);
34 void modButtonAction(uint8_t whichModButton, bool on, ParamManagerForTimeline* paramManager) override;
35 bool modEncoderButtonAction(uint8_t whichModEncoder, bool on, ModelStackWithThreeMainThings* modelStack) override;
36 ModelStackWithAutoParam* getParamFromModEncoder(int32_t whichModEncoder, ModelStackWithThreeMainThings* modelStack,
37 bool allowCreation = true) override;
38 void setupFilterSetConfig(int32_t* postFXVolume, ParamManager* paramManager);
39 void processFilters(std::span<StereoSample> buffer);
40 void compensateVolumeForResonance(ParamManagerForTimeline* paramManager);
41 void processFXForGlobalEffectable(std::span<StereoSample> buffer, int32_t* postFXVolume, ParamManager* paramManager,
42 const Delay::State& delayWorkingState, bool anySoundComingIn, q31_t verbAmount);
43
44 void writeAttributesToFile(Serializer& writer, bool writeToFile);
45 void writeTagsToFile(Serializer& writer, ParamManager* paramManager, bool writeToFile);
46 Error readTagFromFile(Deserializer& reader, char const* tagName, ParamManagerForTimeline* paramManager,
47 int32_t readAutomationUpToPos, ArpeggiatorSettings* arpSettings, Song* song) override;
48 static void writeParamAttributesToFile(Serializer& writer, ParamManager* paramManager, bool writeAutomation,
49 int32_t* valuesForOverride = nullptr);
50 static void writeParamTagsToFile(Serializer& writer, ParamManager* paramManager, bool writeAutomation,
51 int32_t* valuesForOverride = nullptr);
52 static void readParamsFromFile(Deserializer& reader, ParamManagerForTimeline* paramManager,
53 int32_t readAutomationUpToPos);
54 static bool readParamTagFromFile(Deserializer& reader, char const* tagName, ParamManagerForTimeline* paramManager,
55 int32_t readAutomationUpToPos);
56 Delay::State createDelayWorkingState(ParamManager& paramManager, bool shouldLimitDelayFeedback = false,
57 bool soundComingIn = true);
58 bool isEditingComp() override { return editingComp; }
59 int32_t getKnobPosForNonExistentParam(int32_t whichModEncoder, ModelStackWithAutoParam* modelStack) override;
60 ActionResult modEncoderActionForNonExistentParam(int32_t offset, int32_t whichModEncoder,
61 ModelStackWithAutoParam* modelStack) override;
62 dsp::filter::FilterSet filterSet;
63 ModFXParam currentModFXParam;
64 FilterType currentFilterType;
65 bool editingComp;
66 CompParam currentCompParam;
67
68 ModFXType getModFXType() override;
69
70protected:
71 int maxCompParam = 0;
72 virtual int32_t getParameterFromKnob(int32_t whichModEncoder);
73 ModFXType getActiveModFXType(ParamManager* paramManager);
74
75private:
76 void ensureModFXParamIsValid();
77 void displayCompressorAndReverbSettings(bool on);
78 char const* getCompressorModeDisplayName();
79 char const* getCompressorParamDisplayName();
80 void displayModFXSettings(bool on);
81 char const* getModFXTypeDisplayName();
82 char const* getModFXParamDisplayName();
83};
Definition arpeggiator.h:46
Definition storage_manager.h:185
Definition model_stack.h:269
Definition model_stack.h:231
Definition param_manager.h:174
Definition param_manager.h:45
Definition storage_manager.h:119
Definition song.h:104
Definition filter_set.h:44
Definition delay.h:30