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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LFOModifier.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
15class LFOModifier : public Modifier,
17{
18public:
20 ~LFOModifier() override;
21
24
26 void initialise() override;
27 juce::String getName() const override { return TRANS("LFO Modifier"); }
28
29 //==============================================================================
33 float getCurrentValue() override;
34
36 float getCurrentPhase() const;
37
40
42
43 void applyToBuffer (const PluginRenderContext&) override;
44
45 //==============================================================================
47 {
48 Assignment (const juce::ValueTree&, const LFOModifier&);
49
50 bool isForModifierSource (const ModifierSource&) const override;
52
53 const EditItemID lfoModifierID;
54
56 };
57
58 //==============================================================================
59 juce::String getSelectableDescription() override { return getName(); }
60
61 //==============================================================================
62 enum Wave
63 {
64 waveSine = 0,
65 waveTriangle = 1,
66 waveSawUp = 2,
67 waveSawDown = 3,
68 waveSquare = 4,
69 fourStepsUp = 5,
70 fourStepsDown = 6,
71 eightStepsUp = 7,
72 eightStepsDown = 8,
73 random = 9,
74 noise = 10
75 };
76
77 static juce::StringArray getWaveNames();
78
79 juce::CachedValue<float> wave, syncType, rate, rateType, depth, bipolar, phase, offset;
80
81 AutomatableParameter::Ptr waveParam, syncTypeParam, rateParam, rateTypeParam, depthParam, bipolarParam, phaseParam, offsetParam;
82
83private:
84 struct LFOModifierTimer;
86
87 LambdaTimer changedTimer;
88 std::atomic<float> currentPhase { 0.0f }, currentValue { 0.0f };
89
90 void valueTreeChanged() override;
91};
92
93}} // namespace tracktion { inline namespace engine
The Tracktion Edit class!
float getCurrentValue() override
Returns the current value of the LFO.
void applyToBuffer(const PluginRenderContext &) override
Sub classes should implement this to process the Modifier.
float getCurrentPhase() const
Returns the current phase between 0 & 1.
void initialise() override
Call this once after construction to connect it to the audio graph.
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.
AutomatableParameter::ModifierAssignment * createAssignment(const juce::ValueTree &) override
Must return a new ModifierAssignment for a given state.
#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.