Vital
Loading...
Searching...
No Matches
lfo_editor.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4
5#include "line_generator.h"
6#include "open_gl_image.h"
7#include "line_editor.h"
8#include "synth_lfo.h"
9#include "synth_module.h"
10
12
22class LfoEditor : public LineEditor {
23public:
25 static constexpr float kBoostDecay = 0.9f;
26
28 static constexpr float kSpeedDecayMult = 5.0f;
29
30 enum {
36 };
37
45 LfoEditor(LineGenerator* lfo_source, String prefix,
46 const vital::output_map& mono_modulations, const vital::output_map& poly_modulations);
47
51 virtual ~LfoEditor();
52
59 void parentHierarchyChanged() override;
60
67 virtual void mouseDown(const MouseEvent& e) override;
68
75 virtual void mouseDoubleClick(const MouseEvent& e) override;
76
83 virtual void mouseUp(const MouseEvent& e) override;
84
91 void respondToCallback(int point, int power, int result) override;
92
97 void setPhase(float phase);
98
104 void render(OpenGlWrapper& open_gl, bool animate) override;
105
106private:
107 SynthGuiInterface* parent_;
108 const vital::StatusOutput* wave_phase_;
109 const vital::StatusOutput* frequency_;
110 vital::poly_float last_phase_;
111 vital::poly_float last_voice_;
112
113 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LfoEditor)
114};
An editor component for displaying and editing an LFO (Low-Frequency Oscillator) shape.
Definition lfo_editor.h:22
virtual void mouseDown(const MouseEvent &e) override
Handles mouse down events.
Definition lfo_editor.cpp:39
void render(OpenGlWrapper &open_gl, bool animate) override
Renders the LFO editor using OpenGL.
Definition lfo_editor.cpp:131
static constexpr float kSpeedDecayMult
Multiplier for adjusting boost decay speed depending on phase changes.
Definition lfo_editor.h:28
void parentHierarchyChanged() override
Called when the component’s parent hierarchy changes.
Definition lfo_editor.cpp:27
virtual ~LfoEditor()
Destructor.
Definition lfo_editor.cpp:25
LfoEditor(LineGenerator *lfo_source, String prefix, const vital::output_map &mono_modulations, const vital::output_map &poly_modulations)
Constructs the LfoEditor.
Definition lfo_editor.cpp:10
@ kExportLfo
Menu option to export the current LFO shape to file.
Definition lfo_editor.h:35
@ kSetPhaseToPoint
Menu option to set the LFO start phase to a point’s phase.
Definition lfo_editor.h:31
@ kSetPhaseToPower
Menu option to set the LFO start phase to a segment midpoint.
Definition lfo_editor.h:32
@ kImportLfo
Menu option to import an LFO shape from file.
Definition lfo_editor.h:34
@ kSetPhaseToGrid
Menu option to set the LFO start phase to a grid division.
Definition lfo_editor.h:33
void setPhase(float phase)
Sets the LFO’s start phase.
Definition lfo_editor.cpp:126
virtual void mouseDoubleClick(const MouseEvent &e) override
Handles mouse double-click events.
Definition lfo_editor.cpp:84
static constexpr float kBoostDecay
Decay factor used when reducing boost intensity over time.
Definition lfo_editor.h:25
void respondToCallback(int point, int power, int result) override
Responds to selection callbacks from the popup menu.
Definition lfo_editor.cpp:94
virtual void mouseUp(const MouseEvent &e) override
Handles mouse up events.
Definition lfo_editor.cpp:89
A GUI component for editing and visualizing a user-defined line shape (curve or envelope).
Definition line_editor.h:27
@ kNumMenuOptions
Definition line_editor.h:79
A class for generating and storing a line shape, defined by a series of points and associated powers.
Definition line_generator.h:20
An interface class linking the Vital synthesizer backend (SynthBase) with a GUI.
Definition synth_gui_interface.h:56
A helper class to track the "status" of a particular Output as a poly_float value.
Definition synth_module.h:35
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...