A versatile audio filter plugin that implements various filter types and allows for dynamic parameter smoothing.
src/
lib.rs
: Main plugin file, contains the plugin implementation and audio processing logic.params.rs
: Defines the plugin parameters.filter/
mod.rs
: Manages the different filter types and their selection.moog.rs
: Implementation of the Moog filter.roland.rs
: Implementation of the Roland filter.le13700.rs
: Implementation of the Le13700 filter.
- Create a new file in
src/filter/
, e.g.,new_filter.rs
. - Implement the filter in this file:
pub struct NewFilter {
// Filter-specific fields
}
impl NewFilter {
pub fn new() -> Self {
// Initialization logic
}
pub fn set_params(&mut self, cutoff: f32, resonance: f32) {
// Parameter setting logic
}
pub fn process(&mut self, input: f32, sample_rate: f32) -> f32 {
// Audio processing logic
}
}
- Add the new filter in
src/filter/mod.rs
:
pub mod new_filter;
use new_filter::NewFilter;
// Add the new filter to the FilterType enumeration
pub enum FilterType {
// ...
NewFilter,
}
// Update the Filter structure
pub struct Filter {
// ...
new_filter: NewFilter,
}
// Update the implementation of the Filter structure
impl Filter {
// ...
pub fn process(&mut self, input: f32, sample_rate: f32) -> f32 {
match self.filter_type {
// ...
FilterType::NewFilter => self.new_filter.process(input, sample_rate),
}
}
}
- Update
src/params.rs
to add the new filter type as an option:
#[derive(Enum, PartialEq, Clone)]
pub enum FilterType {
// ...
NewFilter,
}
- In
src/lib.rs
, update theprocess
function to consider the new filter type:
self.filter.set_filter_type(match filter_type {
// ...
ParamFilterType::NewFilter => FilterType::NewFilter,
});
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
- Ensure Rust and Cargo are installed.
- Clone the repository:
git clone https://github.com/OseMine/variable-filter.git
- Navigate to the project directory:
cd variable-filter
- Install all the necessary dependencies:
cargo fetch
- Build the project:
cargo xtask bundle variable-filter --release
- Find the plugin files in the
target/release
directory.
- Copy the created plugin files to your VST3/CLAP plugin directory.
- Load the plugin in your preferred DAW.