Vital
Loading...
Searching...
No Matches
phaser.h
Go to the documentation of this file.
1#pragma once
2
3#include "processor_router.h"
4#include "phaser_filter.h"
5#include "operators.h"
6
7namespace vital {
8
17 class PhaserFilter;
18
19 class Phaser : public ProcessorRouter {
20 public:
25 enum {
35 };
36
41 enum {
45 };
46
50 Phaser();
51
53 virtual ~Phaser() { }
54
59 virtual Processor* clone() const override { VITAL_ASSERT(false); return nullptr; }
60
66 void process(int num_samples) override;
67
74 void processWithInput(const poly_float* audio_in, int num_samples) override;
75
79 void init() override;
80
84 void hardReset() override;
85
93 void correctToTime(double seconds);
94
100 void setOversampleAmount(int oversample) override {
102 cutoff_.ensureBufferSize(oversample * kMaxBufferSize);
103 }
104
105 private:
109 Output cutoff_;
110
114 PhaserFilter* phaser_filter_;
115
119 poly_float mix_;
120
124 poly_float mod_depth_;
125
129 poly_float phase_offset_;
130
134 poly_int phase_;
135
136 JUCE_LEAK_DETECTOR(Phaser)
137 };
138} // namespace vital
139
A multi-stage phaser filter for the Vital synthesizer.
Definition phaser_filter.h:19
A multi-stage phaser effect that modulates filter cutoff with a low-frequency oscillator.
Definition phaser.h:19
void correctToTime(double seconds)
Corrects LFO phase according to an absolute time offset.
Definition phaser.cpp:134
void setOversampleAmount(int oversample) override
Sets oversampling for the phaser and allocates extra buffer size for internal use.
Definition phaser.h:100
@ kMix
Dry/wet mix control.
Definition phaser.h:27
@ kRate
LFO rate for cutoff modulation.
Definition phaser.h:28
@ kModDepth
Modulation depth (amount of sweep)
Definition phaser.h:31
@ kAudio
Audio input buffer.
Definition phaser.h:26
@ kNumInputs
Total number of inputs.
Definition phaser.h:34
@ kPhaseOffset
LFO phase offset for stereo spread.
Definition phaser.h:32
@ kFeedbackGain
Amount of feedback in the phaser filter.
Definition phaser.h:29
@ kBlend
Amount of pass/comb blend in the phaser.
Definition phaser.h:33
@ kCenter
Center frequency (MIDI note) for the phaser.
Definition phaser.h:30
void hardReset() override
Resets internal states, filters, and stored parameters.
Definition phaser.cpp:43
void init() override
Initializes the phaser, hooking up internal connections.
Definition phaser.cpp:29
virtual Processor * clone() const override
Creates a clone of this Processor. (Not implemented for Phaser).
Definition phaser.h:59
void process(int num_samples) override
Processes a block of audio by pulling from the audio input buffer.
Definition phaser.cpp:54
Phaser()
Constructs a Phaser ProcessorRouter with default settings.
Definition phaser.cpp:16
@ kAudioOutput
Phaser audio output.
Definition phaser.h:42
@ kCutoffOutput
Current cutoff (MIDI note) at the final sample.
Definition phaser.h:43
@ kNumOutputs
Total number of outputs.
Definition phaser.h:44
virtual ~Phaser()
Virtual destructor.
Definition phaser.h:53
void processWithInput(const poly_float *audio_in, int num_samples) override
Processes a block of audio using the provided input buffer.
Definition phaser.cpp:67
Base class for all signal-processing units in Vital.
Definition processor.h:212
A specialized Processor that manages a directed graph of Processors and ensures correct processing or...
Definition processor_router.h:34
virtual void setOversampleAmount(int oversample) override
Sets the oversampling amount for all Processors in this router.
Definition processor_router.cpp:104
#define VITAL_ASSERT(x)
Definition common.h:11
Contains classes and functions used within the Vital synthesizer framework.
constexpr int kMaxBufferSize
Maximum buffer size for processing.
Definition common.h:39
Declares the ProcessorRouter class, which manages a graph of Processors and their dependencies.
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
void ensureBufferSize(int new_max_buffer_size)
Ensures the buffer is large enough to hold new_max_buffer_size samples. This will reallocate if neces...
Definition processor.h:98
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56