Skip to content

feat: dynamic filter range in GUI#168

Merged
OpenSauce merged 1 commit intomainfrom
dynamic-filter-range
Dec 29, 2025
Merged

feat: dynamic filter range in GUI#168
OpenSauce merged 1 commit intomainfrom
dynamic-filter-range

Conversation

@OpenSauce
Copy link
Owner

Closes #111

Copilot AI review requested due to automatic review settings December 29, 2025 19:20
@OpenSauce OpenSauce enabled auto-merge (squash) December 29, 2025 19:21
@OpenSauce OpenSauce merged commit de3abe0 into main Dec 29, 2025
11 checks passed
@OpenSauce OpenSauce deleted the dynamic-filter-range branch December 29, 2025 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements dynamic filter range selection in the GUI based on the filter type, replacing a fixed range (20.0..=20,000.0 Hz) with type-specific ranges. The change aims to provide more appropriate slider ranges for highpass and lowpass filters.

Key changes:

  • Added a match expression to determine slider range based on FilterType (Highpass vs Lowpass)
  • Highpass filters now use a range of 0.0..=1000.0 Hz
  • Lowpass filters now use a range of 5000.0..=15000.0 Hz

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +27
FilterType::Highpass => 0.0..=1000.0,
FilterType::Lowpass => 5000.0..=15000.0,
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter ranges create a problematic gap in the 1000-5000 Hz range. A highpass filter with a maximum cutoff of 1000 Hz and a lowpass filter with a minimum cutoff of 5000 Hz means users cannot set cutoff frequencies between 1000-5000 Hz. This is a critical frequency range for audio filtering.

Additionally, the ranges seem semantically incorrect:

  • Highpass filters typically cut frequencies below the cutoff, so they should allow higher cutoff values (to filter out more low frequencies)
  • Lowpass filters typically cut frequencies above the cutoff, so they should allow lower cutoff values (to filter out more high frequencies)

Consider ranges like:

  • Highpass: 20.0..=5000.0 (or higher)
  • Lowpass: 1000.0..=20000.0 (or use the full spectrum)

This would provide full coverage of the audio spectrum and allow users to configure filters appropriately for their needs.

Suggested change
FilterType::Highpass => 0.0..=1000.0,
FilterType::Lowpass => 5000.0..=15000.0,
FilterType::Highpass => 20.0..=5000.0,
FilterType::Lowpass => 1000.0..=20000.0,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic Slider Range on 'Filter' Stage

2 participants