Vital
Loading...
Searching...
No Matches
formant_module.h
Go to the documentation of this file.
1#pragma once
2
3#include "synth_module.h"
4#include "formant_filter.h"
5
6namespace vital {
7
16 class FormantModule : public SynthModule {
17 public:
27 enum {
34 };
35
41 FormantModule(std::string prefix = "");
42 virtual ~FormantModule() { }
43
52 Output* createModControl(std::string name, bool audio_rate = false, bool smooth_value = false);
53
57 void init() override;
58
64 void process(int num_samples) override;
65
71 void reset(poly_mask reset_mask) override;
72
76 void hardReset() override;
77
83 void setMono(bool mono) { mono_ = mono; }
84
90 virtual Processor* clone() const override { return new FormantModule(*this); }
91
92 protected:
98 void setStyle(int new_style);
99
100 std::string prefix_;
103 bool mono_;
104
105 JUCE_LEAK_DETECTOR(FormantModule)
106 };
107} // namespace vital
@ kTotalFormantFilters
Total number of formant filter modes.
Definition formant_filter.h:29
A module that applies various formant filtering styles to an incoming audio signal.
Definition formant_module.h:16
virtual ~FormantModule()
Definition formant_module.h:42
bool mono_
True if running in mono mode, false for polyphonic.
Definition formant_module.h:103
FormantModule(std::string prefix="")
Constructs a FormantModule, optionally with a parameter prefix for distinguishing multiple instances.
Definition formant_module.cpp:6
int last_style_
Tracks the currently active style.
Definition formant_module.h:102
void reset(poly_mask reset_mask) override
Resets the currently active formant filter for a given set of voices (indicated by the reset_mask).
Definition formant_module.cpp:82
std::string prefix_
Prefix for parameter naming.
Definition formant_module.h:100
@ kReset
Definition formant_module.h:29
@ kStyle
Definition formant_module.h:32
@ kBlend
Definition formant_module.h:31
@ kResonance
Definition formant_module.h:30
@ kNumInputs
Definition formant_module.h:33
@ kAudio
Definition formant_module.h:28
void setStyle(int new_style)
Sets the currently active formant filter style, enabling and disabling submodules as necessary.
Definition formant_module.cpp:96
void setMono(bool mono)
Sets whether the module is operating in mono mode or not.
Definition formant_module.h:83
virtual Processor * clone() const override
Creates a clone of this FormantModule with identical settings.
Definition formant_module.h:90
void init() override
Initializes the FormantModule, creating formant filters and connecting parameters.
Definition formant_module.cpp:25
void hardReset() override
Performs a hard reset of the currently active formant filter, clearing its internal state.
Definition formant_module.cpp:89
Processor * formant_filters_[FormantFilter::kTotalFormantFilters]
Array holding all possible formant filter styles.
Definition formant_module.h:101
void process(int num_samples) override
Processes a block of samples. Chooses the appropriate formant filter style and processes audio.
Definition formant_module.cpp:70
Output * createModControl(std::string name, bool audio_rate=false, bool smooth_value=false)
Creates a modulation control (parameter) that can be mono or poly depending on the module settings.
Definition formant_module.cpp:13
Base class for all signal-processing units in Vital.
Definition processor.h:212
A ProcessorRouter that encapsulates a cohesive unit of functionality in the synthesizer.
Definition synth_module.h:129
Contains classes and functions used within the Vital synthesizer framework.
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...