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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_BreakpointOscillatorModifier.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
16{
17public:
18 //==============================================================================
21
24
26 void initialise() override;
27 juce::String getName() const override { return TRANS("Breakpoint Modifier"); }
28
29 //==============================================================================
31 float getCurrentValue() override;
32
34 float getCurrentEnvelopeValue() const noexcept;
35
37 float getCurrentPhase() const noexcept;
38
40 float getTotalTime() const;
41
42 AutomatableParameter::ModifierAssignment* createAssignment (const juce::ValueTree&) override;
43
45
46 void applyToBuffer (const PluginRenderContext&) override;
47
48 //==============================================================================
50 {
52
53 bool isForModifierSource (const ModifierSource&) const override;
55
56 const EditItemID breakpointOscillatorModifierID;
57
59 };
60
61 //==============================================================================
62 juce::String getSelectableDescription() override { return getName(); }
63
64 //==============================================================================
65 juce::CachedValue<float> numActivePoints, syncType, rate, rateType, depth, bipolar,
66 stageZeroValue,
67 stageOneValue, stageOneTime, stageOneCurve,
68 stageTwoValue, stageTwoTime, stageTwoCurve,
69 stageThreeValue, stageThreeTime, stageThreeCurve,
70 stageFourValue, stageFourTime, stageFourCurve;
71
72 AutomatableParameter::Ptr numActivePointsParam, syncTypeParam, rateParam, rateTypeParam, depthParam, bipolarParam,
73 stageZeroValueParam,
74 stageOneValueParam, stageOneTimeParam, stageOneCurveParam,
75 stageTwoValueParam, stageTwoTimeParam, stageTwoCurveParam,
76 stageThreeValueParam, stageThreeTimeParam, stageThreeCurveParam,
77 stageFourValueParam, stageFourTimeParam, stageFourCurveParam;
78
79 struct Stage
80 {
81 AutomatableParameter *valueParam = nullptr, *timeParam = nullptr, *curveParam = nullptr;
82 };
83
84 Stage getStage (int index) const;
85
86private:
89 LambdaTimer changedTimer;
90 std::atomic<float> currentPhase { 1.0f }, currentValue { 0.0f }, currentEnvelopeValue { 0.0f };
91
92 struct Section { float value = 0.0f, time = 0.0f, curve = 0.0f; };
93 std::array<Section, 5> getAllSections() const;
94 std::pair<Section, Section> getSectionsSurrounding (float time) const;
95
96 void setPhase (float newPhase);
97
98 void valueTreeChanged() override;
99};
100
101}} // namespace tracktion { inline namespace engine
AutomatableParameter::ModifierAssignment * createAssignment(const juce::ValueTree &) override
Must return a new ModifierAssignment for a given state.
void applyToBuffer(const PluginRenderContext &) override
Sub classes should implement this to process the Modifier.
float getTotalTime() const
Returns the total time for this envelope.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
float getCurrentValue() override
Returns the current value of the modifier.
float getCurrentPhase() const noexcept
Returns the current phase between 0 & 1.
ProcessingPosition getProcessingPosition() override
Should return the position in the plugin chain that this Modifier should be processed.
float getCurrentEnvelopeValue() const noexcept
Returns the envelope value before the bipolar and depth have been applied.
void initialise() override
Call this once after construction to connect it to the audio graph.
The Tracktion Edit class!
#define TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Connects a modifier source to an AutomatableParameter.
ID for objects of type EditElement - e.g.
Bass class for parameter Modifiers.
virtual void initialise()=0
Call this once after construction to connect it to the audio graph.
ProcessingPosition
Determines the position in the FX chain where the modifier should be processed.
@ preFX
The Modifier is processed before the plugn chain.
The context passed to plugin render methods to provide it with buffers to fill.
time