tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_EnvelopeFollowerModifier.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
17{
18public:
19 //==============================================================================
22
25
26 void initialise() override {}
27 float getCurrentValue() override;
28
29 juce::String getName() const override { return TRANS("Envelope Follower Modifier"); }
30
31 //==============================================================================
32 float getEnvelopeValue() const noexcept { return envelopeValue.load (std::memory_order_acquire); }
33
34 AutomatableParameter::ModifierAssignment* createAssignment (const juce::ValueTree&) override;
35
38
39 void initialise (double sampleRate, int blockSizeSamples) override;
40 void deinitialise() override;
41 void applyToBuffer (const PluginRenderContext&) override;
42
43 //==============================================================================
45 {
47
48 bool isForModifierSource (const ModifierSource&) const override;
49 EnvelopeFollowerModifier::Ptr getEnvelopeFollowerModifier() const;
50
51 const EditItemID envelopeFollowerModifierID;
52
54 };
55
56 //==============================================================================
57 juce::String getSelectableDescription() override { return getName(); }
58
59 //==============================================================================
60 juce::CachedValue<float> gainDb, attack, hold, release, depth, offset, lowPassEnabled, highPassEnabled, lowPassFrequency, highPassFrequency;
61 AutomatableParameter::Ptr gainDbParam, attackParam, holdParam, releaseParam, depthParam, offsetParam,
62 lowPassEnabledParam, highPassEnabledParam, lowPassFrequencyParam, highPassFrequencyParam;
63
64private:
65 class EnvelopeFollower;
66
67 std::atomic<float> envelopeValue;
68 std::unique_ptr<EnvelopeFollower> envelopeFollower;
69 juce::IIRFilter lowPassFilter, highPassFilter;
70 float currentLowPassFrequency = 0.0f, currentHighPassFrequency = 0.0f;
71 LambdaTimer changedTimer;
72
73 void prepareToPlay (double sampleRate);
74 void processBlock (const juce::AudioBuffer<float>&);
75 void reset();
76
77 void valueTreeChanged() override;
78};
79
80}} // namespace tracktion { inline namespace engine
The Tracktion Edit class!
ProcessingPosition getProcessingPosition() override
Should return the position in the plugin chain that this Modifier should be processed.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void initialise() override
Call this once after construction to connect it to the audio graph.
float getCurrentValue() override
Must return the current value of the modifier.
void applyToBuffer(const PluginRenderContext &) override
Sub classes should implement this to process the Modifier.
void deinitialise() override
Sub classes should implement this to deinitialise the Modifier.
AutomatableParameter::ModifierAssignment * createAssignment(const juce::ValueTree &) override
Must return a new ModifierAssignment for a given state.
juce::StringArray getAudioInputNames() override
Can return an array of names represeting audio inputs.
T is_pointer_v
#define TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
T load(T... args)
Connects a modifier source to an AutomatableParameter.
ID for objects of type EditElement - e.g.
Bass class for parameter Modifiers.
ProcessingPosition
Determines the position in the FX chain where the modifier should be processed.
@ postFX
The Modifier is processed after the plugn chain.
The context passed to plugin render methods to provide it with buffers to fill.