8 unselected_points_(2,
Shaders::kRingFragment),
9 selected_point_(
Shaders::kCircleFragment),
10 dragging_point_(
Shaders::kCircleFragment), shader_(nullptr) {
14 addAndMakeVisible(unselected_points_);
15 addAndMakeVisible(selected_point_);
16 addAndMakeVisible(dragging_point_);
18 low_cutoff_ =
nullptr;
19 low_resonance_ =
nullptr;
21 band_cutoff_ =
nullptr;
22 band_resonance_ =
nullptr;
24 high_cutoff_ =
nullptr;
25 high_resonance_ =
nullptr;
28 low_cutoff_output_ =
nullptr;
29 low_resonance_output_ =
nullptr;
30 low_gain_output_ =
nullptr;
31 band_cutoff_output_ =
nullptr;
32 band_resonance_output_ =
nullptr;
33 band_gain_output_ =
nullptr;
34 high_cutoff_output_ =
nullptr;
35 high_resonance_output_ =
nullptr;
36 high_gain_output_ =
nullptr;
38 current_cutoff_ =
nullptr;
39 current_gain_ =
nullptr;
52 draw_frequency_lines_ =
true;
55 line_data_ = std::make_unique<float[]>(
kResolution);
58 vertex_array_object_ = 0;
62 line_data_[i] = 2.0f * t - 1.0f;
73 low_cutoff_output_ = mono_modulations.at(
"eq_low_cutoff");
74 low_resonance_output_ = mono_modulations.at(
"eq_low_resonance");
75 low_gain_output_ = mono_modulations.at(
"eq_low_gain");
76 band_cutoff_output_ = mono_modulations.at(
"eq_band_cutoff");
77 band_resonance_output_ = mono_modulations.at(
"eq_band_resonance");
78 band_gain_output_ = mono_modulations.at(
"eq_band_gain");
79 high_cutoff_output_ = mono_modulations.at(
"eq_high_cutoff");
80 high_resonance_output_ = mono_modulations.at(
"eq_high_resonance");
81 high_gain_output_ = mono_modulations.at(
"eq_high_gain");
85 low_cutoff_output_ = mono_modulations.at(
"reverb_low_shelf_cutoff");
86 low_gain_output_ = mono_modulations.at(
"reverb_low_shelf_gain");
87 high_cutoff_output_ = mono_modulations.at(
"reverb_high_shelf_cutoff");
88 high_gain_output_ = mono_modulations.at(
"reverb_high_shelf_gain");
94 unselected_points_.
init(open_gl);
95 selected_point_.
init(open_gl);
96 dragging_point_.
init(open_gl);
98 open_gl.
context.extensions.glGenVertexArrays(1, &vertex_array_object_);
99 open_gl.
context.extensions.glBindVertexArray(vertex_array_object_);
101 GLsizeiptr vert_size =
static_cast<GLsizeiptr
>(
kResolution *
sizeof(float));
102 open_gl.
context.extensions.glGenBuffers(1, &line_buffer_);
103 open_gl.
context.extensions.glBindBuffer(GL_ARRAY_BUFFER, line_buffer_);
104 open_gl.
context.extensions.glBufferData(GL_ARRAY_BUFFER, vert_size, line_data_.get(), GL_STATIC_DRAW);
106 open_gl.
context.extensions.glGenBuffers(1, &response_buffer_);
107 open_gl.
context.extensions.glBindBuffer(GL_ARRAY_BUFFER, response_buffer_);
108 open_gl.
context.extensions.glBufferData(GL_ARRAY_BUFFER, vert_size,
nullptr, GL_STATIC_READ);
110 const GLchar* varyings[] = {
"response_out" };
114 position_attribute_ =
getAttribute(open_gl, *shader_,
"position");
115 midi_cutoff_uniform_ =
getUniform(open_gl, *shader_,
"midi_cutoff");
116 resonance_uniform_ =
getUniform(open_gl, *shader_,
"resonance");
117 low_amount_uniform_ =
getUniform(open_gl, *shader_,
"low_amount");
118 band_amount_uniform_ =
getUniform(open_gl, *shader_,
"band_amount");
119 high_amount_uniform_ =
getUniform(open_gl, *shader_,
"high_amount");
141 setFillColors(color_fill_to.withMultipliedAlpha(1.0f - fill_fade), color_fill_to);
144 open_gl.
context.extensions.glBindVertexArray(vertex_array_object_);
145 open_gl.
context.extensions.glBindBuffer(GL_ARRAY_BUFFER, line_buffer_);
146 open_gl.
context.extensions.glVertexAttribPointer(position_attribute_->attributeID, 1, GL_FLOAT, GL_FALSE,
147 sizeof(
float),
nullptr);
148 open_gl.
context.extensions.glEnableVertexAttribArray(position_attribute_->attributeID);
149 open_gl.
context.extensions.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, response_buffer_);
151 midi_cutoff_uniform_->set(low_filter_.
getMidiCutoff()[index],
154 resonance_uniform_->set(low_filter_.
getResonance()[index],
158 low_amount_uniform_->set(low_filter_.
getLowAmount()[index],
161 band_amount_uniform_->set(low_filter_.
getBandAmount()[index],
164 high_amount_uniform_->set(low_filter_.
getHighAmount()[index],
168 open_gl.
context.extensions.glBeginTransformFeedback(GL_POINTS);
170 open_gl.
context.extensions.glEndTransformFeedback();
172 void* buffer = open_gl.
context.extensions.glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0,
175 float* response_data = (
float*)buffer;
176 float width = getWidth();
177 float range = max_db_ - min_db_;
178 float y_mult = getHeight() / range;
181 setYAt(i, (max_db_ - response_data[i]) * y_mult);
184 open_gl.
context.extensions.glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER);
192 if (active_ && animate_)
196 open_gl.
context.extensions.glDisableVertexAttribArray(position_attribute_->attributeID);
197 open_gl.
context.extensions.glBindBuffer(GL_ARRAY_BUFFER, 0);
198 open_gl.
context.extensions.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
209 unselected_points_.
destroy(open_gl);
210 selected_point_.
destroy(open_gl);
211 dragging_point_.
destroy(open_gl);
213 open_gl.
context.extensions.glDeleteBuffers(1, &line_buffer_);
214 open_gl.
context.extensions.glDeleteBuffers(1, &response_buffer_);
216 response_buffer_ = 0;
219 position_attribute_ =
nullptr;
220 midi_cutoff_uniform_ =
nullptr;
221 resonance_uniform_ =
nullptr;
222 low_amount_uniform_ =
nullptr;
223 band_amount_uniform_ =
nullptr;
224 high_amount_uniform_ =
nullptr;
228 float unselected_x1,
float unselected_y1,
229 float unselected_x2,
float unselected_y2) {
230 static constexpr float kHandleRadius = 0.06f;
231 static constexpr float kDraggingRadius = 0.18f;
233 float width = getWidth();
234 float height = getHeight();
235 float handle_radius = kHandleRadius * height;
236 float handle_width = handle_radius * 4.0f / width;
237 float handle_height = handle_radius * 4.0f / height;
239 float dragging_radius = kDraggingRadius * height;
240 float dragging_width = dragging_radius * 4.0f / width;
241 float dragging_height = dragging_radius * 4.0f / height;
243 selected_point_.
setQuad(0, selected_x - handle_width * 0.5f, selected_y - handle_height * 0.5f,
244 handle_width, handle_height);
245 dragging_point_.
setQuad(0, selected_x - dragging_width * 0.5f, selected_y - dragging_height * 0.5f,
246 dragging_width, dragging_height);
247 unselected_points_.
setQuad(0, unselected_x1 - handle_width * 0.5f, unselected_y1 - handle_height * 0.5f,
248 handle_width, handle_height);
249 unselected_points_.
setQuad(1, unselected_x2 - handle_width * 0.5f, unselected_y2 - handle_height * 0.5f,
250 handle_width, handle_height);
259 float width = getWidth();
260 float height = getHeight();
262 float low_x = 2.0f * low_position.x / width - 1.0f;
263 float band_x = 2.0f * band_position.x / width - 1.0f;
264 float high_x = 2.0f * high_position.x / width - 1.0f;
265 float low_y = 1.0f - 2.0f * low_position.y / height;
266 float band_y = 1.0f - 2.0f * band_position.y / height;
267 float high_y = 1.0f - 2.0f * high_position.y / height;
269 if (band_cutoff_output_ ==
nullptr)
272 if (selected_band_ == 0)
274 else if (band_cutoff_output_ && selected_band_ == 1)
276 else if (selected_band_ == 2)
280 if (current_cutoff_ && current_gain_)
281 dragging_point_.
render(open_gl,
true);
283 selected_point_.
render(open_gl,
true);
285 unselected_points_.
render(open_gl,
true);
289 static constexpr int kLineSpacing = 10;
292 if (!draw_frequency_lines_)
298 int height = getHeight();
299 float max_octave = log2f(max_frequency / min_frequency);
301 float frequency = 0.0f;
302 float increment = 1.0f;
305 while (frequency < max_frequency) {
306 for (
int i = 0; i < kLineSpacing; ++i) {
307 frequency += increment;
308 float t = log2f(frequency / min_frequency) / max_octave;
309 x = std::round(t * getWidth());
310 g.fillRect(x, 0, 1, height);
312 g.fillRect(x, 0, 1, height);
313 increment *= kLineSpacing;
320 if (band == 0 && low_resonance_)
322 else if (band == 1 && band_resonance_)
324 else if (band == 2 && high_resonance_)
327 OpenGlComponent::mouseWheelMove(e, wheel);
333 if (selected_band_ == 0) {
334 current_cutoff_ = low_cutoff_;
335 current_gain_ = low_gain_;
336 for (
Listener* listener : listeners_)
337 listener->lowBandSelected();
339 else if (selected_band_ == 1) {
340 current_cutoff_ = band_cutoff_;
341 current_gain_ = band_gain_;
342 for (
Listener* listener : listeners_)
343 listener->midBandSelected();
345 else if (selected_band_ == 2) {
346 current_cutoff_ = high_cutoff_;
347 current_gain_ = high_gain_;
348 for (
Listener* listener : listeners_)
349 listener->highBandSelected();
352 OpenGlLineRenderer::mouseDown(e);
357 OpenGlLineRenderer::mouseDrag(e);
361 if (current_cutoff_ ==
nullptr && current_gain_ ==
nullptr) {
362 OpenGlLineRenderer::mouseUp(e);
366 current_cutoff_ =
nullptr;
367 current_gain_ =
nullptr;
368 OpenGlLineRenderer::mouseUp(e);
376 OpenGlLineRenderer::mouseExit(e);
380 const float grab_distance = 0.06f * getWidth();
382 float delta_low = e.position.getDistanceSquaredFrom(
getLowPosition());
383 float delta_band = e.position.getDistanceSquaredFrom(
getBandPosition());
384 float delta_high = e.position.getDistanceSquaredFrom(
getHighPosition());
386 float min_sqr_dist = grab_distance * grab_distance;
387 float min = std::min(std::min(min_sqr_dist, delta_low), delta_high);
388 if (band_cutoff_output_)
389 min = std::min(min, delta_band);
391 if (delta_low <= min)
393 if (band_cutoff_output_ && delta_band <= min)
395 if (delta_high <= min)
402 float cutoff_range = low_cutoff_->getMaximum() - low_cutoff_->getMinimum();
403 float min_cutoff = low_cutoff_->getMinimum();
404 float gain_range = max_db_ - min_db_;
406 float low_x = getWidth() * (low_cutoff_->getValue() - min_cutoff) / cutoff_range;
407 float low_y = getHeight() * (max_db_ - low_gain_->getValue()) / gain_range;
408 return Point<float>(low_x, low_y);
412 if (band_cutoff_ ==
nullptr)
413 return Point<float>(0.0f, 0.0f);
415 float cutoff_range = band_cutoff_->getMaximum() - band_cutoff_->getMinimum();
416 float min_cutoff = band_cutoff_->getMinimum();
417 float gain_range = max_db_ - min_db_;
419 float band_x = getWidth() * (band_cutoff_->getValue() - min_cutoff) / cutoff_range;
420 float band_y = getHeight() * (max_db_ - band_gain_->getValue()) / gain_range;
421 return Point<float>(band_x, band_y);
425 float cutoff_range = high_cutoff_->getMaximum() - high_cutoff_->getMinimum();
426 float min_cutoff = high_cutoff_->getMinimum();
427 float gain_range = max_db_ - min_db_;
429 float high_x = getWidth() * (high_cutoff_->getValue() - min_cutoff) / cutoff_range;
430 float high_y = getHeight() * (max_db_ - high_gain_->getValue()) / gain_range;
431 return Point<float>(high_x, high_y);
435 low_filter_state_.
midi_cutoff = getOutputTotal(low_cutoff_output_, low_cutoff_);
436 low_filter_state_.
resonance_percent = getOutputTotal(low_resonance_output_, low_resonance_);
437 low_filter_state_.
gain = getOutputTotal(low_gain_output_, low_gain_);
448 band_filter_state_.
midi_cutoff = getOutputTotal(band_cutoff_output_, band_cutoff_);
449 band_filter_state_.
resonance_percent = getOutputTotal(band_resonance_output_, band_resonance_);
450 band_filter_state_.
gain = getOutputTotal(band_gain_output_, band_gain_);
458 high_filter_state_.
midi_cutoff = getOutputTotal(high_cutoff_output_, high_cutoff_);
459 high_filter_state_.
resonance_percent = getOutputTotal(high_resonance_output_, high_resonance_);
460 high_filter_state_.
gain = getOutputTotal(high_gain_output_, high_gain_);
474 if (current_cutoff_) {
476 float min = current_cutoff_->getMinimum();
477 float max = current_cutoff_->getMaximum();
478 float new_cutoff = ratio * (max - min) + min;
480 current_cutoff_->setValue(new_cutoff);
483 float local_position = position.y - 0.5f * db_buffer_ratio_ * getHeight();
484 float ratio =
vital::utils::clamp(local_position / ((1.0f - db_buffer_ratio_) * getHeight()), 0.0f, 1.0f);
485 float min = current_gain_->getMinimum();
486 float max = current_gain_->getMaximum();
487 float new_db = ratio * (min - max) + max;
488 current_gain_->setValue(new_db);
497 float buffer =
gain->getRange().getLength() * db_buffer_ratio_;
498 min_db_ =
gain->getMinimum() - buffer;
499 max_db_ =
gain->getMaximum() + buffer;
500 low_cutoff_ = cutoff;
512 band_cutoff_ = cutoff;
524 high_cutoff_ = cutoff;
535 selected_band_ = selected_band;
545 high_pass_ = high_pass;
555 low_pass_ = low_pass;
560 if (output ==
nullptr || slider ==
nullptr)
563 return slider->getValue();
Interface for objects that want to be notified when a band is selected.
Definition equalizer_response.h:36
void drawControlPoints(OpenGlWrapper &open_gl)
Draws the control points (markers) for the EQ bands.
Definition equalizer_response.cpp:253
void moveFilterSettings(Point< float > position)
Moves the currently selected filter's cutoff and gain based on a mouse drag position.
Definition equalizer_response.cpp:473
void setHighSliders(SynthSlider *cutoff, SynthSlider *resonance, SynthSlider *gain)
Assigns the sliders for the high band.
Definition equalizer_response.cpp:522
void mouseUp(const MouseEvent &e) override
Handles mouse up events, finalizing any changes made during drag.
Definition equalizer_response.cpp:360
void setControlPointBounds(float selected_x, float selected_y, float unselected_x1, float unselected_y1, float unselected_x2, float unselected_y2)
Sets the bounds for the control points (selected and unselected) in normalized coordinates.
Definition equalizer_response.cpp:227
void setActive(bool active)
Sets the active state of the EQ visualization.
Definition equalizer_response.cpp:539
virtual void destroy(OpenGlWrapper &open_gl) override
Destroys OpenGL resources.
Definition equalizer_response.cpp:206
void mouseExit(const MouseEvent &e) override
Handles mouse exit events to hide popups or reset state.
Definition equalizer_response.cpp:371
static constexpr float kDefaultDbBufferRatio
Ratio of dB range used as a buffer around min/max gain values.
Definition equalizer_response.h:27
void setNotch(bool notch)
Configures the mid band as a notch filter (or a shelf).
Definition equalizer_response.cpp:549
void mouseDown(const MouseEvent &e) override
Handles mouse down events to select a band.
Definition equalizer_response.cpp:330
void setHighPass(bool high_pass)
Configures the low band as a high-pass filter (or a shelf).
Definition equalizer_response.cpp:544
void mouseDrag(const MouseEvent &e) override
Handles mouse drag events to adjust filter settings.
Definition equalizer_response.cpp:355
void initEq(const vital::output_map &mono_modulations)
Initializes the Equalizer response for a standard 3-band EQ using the provided outputs.
Definition equalizer_response.cpp:72
~EqualizerResponse()
Destructor.
EqualizerResponse()
Constructs an EqualizerResponse component.
Definition equalizer_response.cpp:7
void setLowPass(bool low_pass)
Configures the high band as a low-pass filter (or a shelf).
Definition equalizer_response.cpp:554
void paintBackground(Graphics &g) override
Paints the background and optionally draws frequency lines.
Definition equalizer_response.cpp:288
int getHoveredBand(const MouseEvent &e)
Determines which band is currently hovered by the mouse.
Definition equalizer_response.cpp:379
void mouseWheelMove(const MouseEvent &e, const MouseWheelDetails &wheel) override
Handles mouse wheel movements for adjusting resonance if hovering over a band.
Definition equalizer_response.cpp:317
static constexpr int kResolution
Number of points used for resolution in the frequency response display.
Definition equalizer_response.h:21
void setLowSliders(SynthSlider *cutoff, SynthSlider *resonance, SynthSlider *gain)
Assigns the sliders for the low band.
Definition equalizer_response.cpp:495
static constexpr int kViewSampleRate
A high view sample rate for accurate visualization (not actual audio processing).
Definition equalizer_response.h:24
void initReverb(const vital::output_map &mono_modulations)
Initializes the Equalizer response for a reverb's shelving EQ.
Definition equalizer_response.cpp:84
virtual void init(OpenGlWrapper &open_gl) override
Initializes OpenGL resources.
Definition equalizer_response.cpp:91
void setBandSliders(SynthSlider *cutoff, SynthSlider *resonance, SynthSlider *gain)
Assigns the sliders for the mid (band) band.
Definition equalizer_response.cpp:510
void setSelectedBand(int selected_band)
Sets the currently selected band.
Definition equalizer_response.cpp:534
void computeFilterCoefficients()
Computes the filter coefficients based on current slider values and states.
Definition equalizer_response.cpp:434
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the EQ response and control points.
Definition equalizer_response.cpp:189
Point< float > getLowPosition()
Returns the current low band control point position in component coordinates.
Definition equalizer_response.cpp:401
void drawResponse(OpenGlWrapper &open_gl, int index)
Draws the response of the filters.
Definition equalizer_response.cpp:122
Point< float > getHighPosition()
Returns the current high band control point position in component coordinates.
Definition equalizer_response.cpp:424
Point< float > getBandPosition()
Returns the current mid (band) control point position in component coordinates.
Definition equalizer_response.cpp:411
static std::unique_ptr< OpenGLShaderProgram::Attribute > getAttribute(const OpenGlWrapper &open_gl, const OpenGLShaderProgram &program, const char *name)
Retrieves an attribute from the shader program if it exists.
Definition open_gl_component.h:79
void renderCorners(OpenGlWrapper &open_gl, bool animate, Colour color, float rounding)
Renders the corner shapes using the given color and rounding amount.
Definition open_gl_component.cpp:153
force_inline void checkGlError()
Checks for and asserts that there are no OpenGL errors.
Definition open_gl_component.h:231
float findValue(Skin::ValueId value_id)
Finds a float value from the skin associated with this component's parent.
Definition open_gl_component.cpp:173
static std::unique_ptr< OpenGLShaderProgram::Uniform > getUniform(const OpenGlWrapper &open_gl, const OpenGLShaderProgram &program, const char *name)
Retrieves a uniform from the shader program if it exists.
Definition open_gl_component.h:64
virtual void paintBackground(Graphics &g)
Paints a standard background for the component.
Definition open_gl_component.cpp:105
A component for rendering lines with optional filling and boost effects using OpenGL.
Definition open_gl_line_renderer.h:16
virtual void init(OpenGlWrapper &open_gl) override
Initializes OpenGL resources for rendering the line.
Definition open_gl_line_renderer.cpp:78
virtual void destroy(OpenGlWrapper &open_gl) override
Destroys OpenGL resources allocated by this line renderer.
Definition open_gl_line_renderer.cpp:468
force_inline void setFillCenter(float fill_center)
Sets the vertical center for the fill area.
Definition open_gl_line_renderer.h:138
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the line using OpenGL.
Definition open_gl_line_renderer.cpp:464
force_inline void setYAt(int index, float val)
Sets the y-coordinate of a point, marking data as dirty.
Definition open_gl_line_renderer.h:98
force_inline void setFill(bool fill)
Enables or disables filling below the line.
Definition open_gl_line_renderer.h:124
force_inline void setXAt(int index, float val)
Sets the x-coordinate of a point, marking data as dirty.
Definition open_gl_line_renderer.h:105
force_inline void setFillColors(Colour fill_color_from, Colour fill_color_to)
Sets a gradient fill from one color to another.
Definition open_gl_line_renderer.h:132
force_inline void setLineWidth(float width)
Sets the line width in pixels.
Definition open_gl_line_renderer.h:66
force_inline void setColor(Colour color)
Sets the line color.
Definition open_gl_line_renderer.h:63
void setThickness(float thickness, bool reset=false)
Sets the thickness used by some shaders and can reset to this thickness.
Definition open_gl_multi_quad.h:338
virtual void init(OpenGlWrapper &open_gl) override
Initializes OpenGL buffers and shader attributes.
Definition open_gl_multi_quad.cpp:37
void setQuad(int i, float x, float y, float w, float h)
Sets the position and size of a quad in normalized device space.
Definition open_gl_multi_quad.h:313
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the quads using OpenGL.
Definition open_gl_multi_quad.cpp:92
virtual void destroy(OpenGlWrapper &open_gl) override
Releases OpenGL resources when the component is destroyed.
Definition open_gl_multi_quad.cpp:69
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
Manages and provides access to vertex and fragment shaders used by the OpenGL rendering pipeline.
Definition shaders.h:19
@ kEqFilterResponseVertex
Definition shaders.h:44
@ kColorFragment
Definition shaders.h:63
OpenGLShaderProgram * getShaderProgram(VertexShader vertex_shader, FragmentShader fragment_shader, const GLchar **varyings=nullptr)
Retrieves or creates an OpenGLShaderProgram from a given vertex and fragment shader pair.
Definition shaders.cpp:953
@ kWidgetLineWidth
Definition skin.h:105
@ kWidgetFillFade
Definition skin.h:108
@ kWidgetPrimaryDisabled
Definition skin.h:167
@ kWidgetPrimary2
Definition skin.h:166
@ kWidgetPrimary1
Definition skin.h:165
@ kWidgetSecondary1
Definition skin.h:168
@ kLightenScreen
Definition skin.h:141
@ kWidgetSecondaryDisabled
Definition skin.h:170
@ kWidgetSecondary2
Definition skin.h:169
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
void addSliderListener(SliderListener *listener)
Definition synth_slider.cpp:631
void hidePopup(bool primary)
Definition synth_slider.cpp:640
void showPopup(bool primary)
Definition synth_slider.cpp:635
virtual void mouseWheelMove(const MouseEvent &e, const MouseWheelDetails &wheel) override
Definition synth_slider.cpp:346
void setDriveCompensation(bool drive_compensation)
Enables or disables drive compensation (reducing drive as resonance increases).
Definition digital_svf.h:407
poly_float getMidiCutoff() const
Retrieves the current MIDI-based cutoff frequency.
Definition digital_svf.h:345
poly_float getResonance() const
Retrieves the current resonance value (inverted if needed).
Definition digital_svf.h:351
void setupFilter(const FilterState &filter_state) override
Configures this SVF based on a FilterState (cutoff, resonance, style, etc.).
Definition digital_svf.cpp:237
poly_float getBandAmount() const
Retrieves the current band-frequency mix portion.
Definition digital_svf.h:363
poly_float getHighAmount() const
Retrieves the current high-frequency mix portion.
Definition digital_svf.h:369
poly_float getLowAmount() const
Retrieves the current low-frequency mix portion.
Definition digital_svf.h:357
force_inline bool enabled() const
Checks if this Processor is enabled.
Definition processor.h:310
virtual void setSampleRate(int sample_rate)
Updates the sample rate of this Processor (scaled by oversampling).
Definition processor.h:285
poly_float pass_blend
Blend parameter in [0..2], controlling pass type.
Definition synth_filter.h:117
int style
Filter style enum (e.g., k12Db, k24Db)
Definition synth_filter.h:116
poly_float gain
Additional gain parameter.
Definition synth_filter.h:115
poly_float midi_cutoff
MIDI note-based cutoff value.
Definition synth_filter.h:110
poly_float resonance_percent
Resonance parameter in [0..1].
Definition synth_filter.h:112
@ kNotchPassSwap
Definition synth_filter.h:77
@ kShelving
Definition synth_filter.h:80
@ k12Db
Definition synth_filter.h:75
force_inline poly_float clamp(poly_float value, mono_float min, mono_float max)
Clamps each lane of a vector to [min, max].
Definition poly_utils.h:306
force_inline poly_float midiNoteToFrequency(poly_float value)
Converts a MIDI note to a frequency (vectorized).
Definition poly_utils.h:123
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
OpenGLContext & context
The OpenGLContext for current rendering.
Definition shaders.h:181
Shaders * shaders
Pointer to the Shaders instance providing compiled shaders.
Definition shaders.h:182
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
Processor * owner
Owning processor.
Definition processor.h:112
poly_float trigger_value
Trigger values for voices.
Definition processor.h:116
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Provides various utility functions, classes, and constants for audio, math, and general-purpose opera...