74 last_mouse_position_ = e.getPosition();
82 Point<int> delta = e.getPosition() - last_mouse_position_;
83 last_mouse_position_ = e.getPosition();
85 float center_range = center_slider_->getMaximum() - center_slider_->getMinimum();
86 center_slider_->setValue(center_slider_->getValue() + delta.x * center_range / getWidth());
87 float feedback_range = feedback_slider_->getMaximum() - feedback_slider_->getMinimum();
88 feedback_slider_->setValue(feedback_slider_->getValue() - delta.y * feedback_range / getHeight());
116 struct FilterResponseShader {
117 static constexpr int kMaxStages = 4;
118 OpenGLShaderProgram* shader;
119 std::unique_ptr<OpenGLShaderProgram::Attribute> position;
121 std::unique_ptr<OpenGLShaderProgram::Uniform> mix;
122 std::unique_ptr<OpenGLShaderProgram::Uniform> drive;
123 std::unique_ptr<OpenGLShaderProgram::Uniform> midi_cutoff;
124 std::unique_ptr<OpenGLShaderProgram::Uniform> resonance;
125 std::unique_ptr<OpenGLShaderProgram::Uniform> stages[kMaxStages];
133 void drawFilterResponse(
OpenGlWrapper& open_gl,
bool animate);
146 void setupFilterState();
152 void loadShader(
int index);
158 void bind(OpenGLContext& open_gl_context);
164 void unbind(OpenGLContext& open_gl_context);
175 Point<int> last_mouse_position_;
189 FilterResponseShader response_shader_;
190 std::unique_ptr<float[]> line_data_;
191 GLuint vertex_array_object_;
193 GLuint response_buffer_;
245 std::unique_ptr<SynthButton> on_;
246 std::unique_ptr<SynthSlider> frequency_;
247 std::unique_ptr<SynthSlider> tempo_;
248 std::unique_ptr<TempoSelector> sync_;
249 std::unique_ptr<SynthSlider> feedback_;
250 std::unique_ptr<SynthSlider> mod_depth_;
251 std::unique_ptr<SynthSlider> center_;
252 std::unique_ptr<SynthSlider> phase_offset_;
253 std::unique_ptr<SynthSlider> dry_wet_;
255 std::unique_ptr<FlangerResponse> flanger_response_;
Renders a visual representation of the flanger effect's filter response.
Definition flanger_section.h:22
void mouseDown(const MouseEvent &e) override
Handles mouse down events on the response graph.
Definition flanger_section.h:73
void render(OpenGlWrapper &open_gl, bool animate) override
Renders the flanger response curve.
Definition flanger_section.cpp:82
void setFeedbackSlider(SynthSlider *slider)
Associates a SynthSlider with the feedback parameter.
Definition flanger_section.h:101
void setActive(bool active)
Sets the flanger active state, affecting how the response is drawn.
Definition flanger_section.h:113
static constexpr int kDefaultVisualSampleRate
A default sample rate used for visualization purposes.
Definition flanger_section.h:32
virtual ~FlangerResponse()
Destructor.
Definition flanger_section.cpp:40
void setCenterSlider(SynthSlider *slider)
Associates a SynthSlider with the center frequency parameter.
Definition flanger_section.h:95
void init(OpenGlWrapper &open_gl) override
Initializes the OpenGL state required for rendering.
Definition flanger_section.cpp:42
static constexpr int kCombAlternatePeriod
The period used for alternating comb filtering in the displayed response.
Definition flanger_section.h:37
void setMixSlider(SynthSlider *slider)
Associates a SynthSlider with the mix (dry/wet) parameter.
Definition flanger_section.h:107
static constexpr int kResolution
Number of resolution points used for rendering the response.
Definition flanger_section.h:27
void destroy(OpenGlWrapper &open_gl) override
Cleans up and releases OpenGL resources.
Definition flanger_section.cpp:87
FlangerResponse(const vital::output_map &mono_modulations)
Constructs the FlangerResponse.
Definition flanger_section.cpp:13
void mouseDrag(const MouseEvent &e) override
Handles mouse drag events to adjust flanger parameters interactively.
Definition flanger_section.h:81
A GUI section representing the flanger effect in the synthesizer.
Definition flanger_section.h:207
void paintBackgroundShadow(Graphics &g) override
Paints the background shadow if active.
Definition flanger_section.h:231
void setActive(bool active) override
Sets the active state of the flanger section and updates the flanger response accordingly.
Definition flanger_section.cpp:333
void paintBackground(Graphics &g) override
Paints the background of the flanger section, including labels for each parameter.
Definition flanger_section.cpp:281
void resized() override
Positions and sizes the child components when the flanger section is resized.
Definition flanger_section.cpp:298
FlangerSection(String name, const vital::output_map &mono_modulations)
Constructs a FlangerSection.
Definition flanger_section.cpp:224
virtual ~FlangerSection()
Destructor.
Definition flanger_section.cpp:279
A component for rendering lines with optional filling and boost effects using OpenGL.
Definition open_gl_line_renderer.h:16
An interface class linking the Vital synthesizer backend (SynthBase) with a GUI.
Definition synth_gui_interface.h:56
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
bool isActive() const
Checks if the section is currently active.
Definition synth_section.h:683
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
A slider component that allows selection between different tempo modes (seconds, tempo,...
Definition tempo_selector.h:14
A Processor implementing a comb-based filter with multiple feedback styles.
Definition comb_filter.h:18
A helper class to track the "status" of a particular Output as a poly_float value.
Definition synth_module.h:35
Holds the parameters necessary to configure a SynthFilter at runtime.
Definition synth_filter.h:92
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
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
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...