Vital
Loading...
Searching...
No Matches
envelope_module.h
Go to the documentation of this file.
1#pragma once
2
3#include "synth_module.h"
4
5namespace vital {
6
7 class Envelope;
8
17 class EnvelopeModule : public SynthModule {
18 public:
24 enum {
27 };
28
35 enum {
39 };
40
47 EnvelopeModule(const std::string& prefix, bool force_audio_rate = false);
48
52 virtual ~EnvelopeModule() { }
53
57 void init() override;
58
63 virtual Processor* clone() const override { return new EnvelopeModule(*this); }
64
70 void setControlRate(bool control_rate) override {
72 envelope_->setControlRate(control_rate);
73 }
74
75 protected:
76 std::string prefix_;
79
80 JUCE_LEAK_DETECTOR(EnvelopeModule)
81 };
82} // namespace vital
A processor that generates an envelope signal based on typical ADSR (Attack, Decay,...
Definition envelope.h:16
A module that generates an envelope signal (ADSR-like) controlled by various parameters.
Definition envelope_module.h:17
std::string prefix_
Prefix for all envelope parameter names.
Definition envelope_module.h:76
virtual ~EnvelopeModule()
Destroys the EnvelopeModule.
Definition envelope_module.h:52
virtual Processor * clone() const override
Creates a clone of the current EnvelopeModule with identical settings.
Definition envelope_module.h:63
EnvelopeModule(const std::string &prefix, bool force_audio_rate=false)
Constructs an EnvelopeModule with a given prefix for parameter naming and a control rate mode.
Definition envelope_module.cpp:7
@ kTrigger
Definition envelope_module.h:25
@ kNumInputs
Definition envelope_module.h:26
void init() override
Initializes the EnvelopeModule, creating parameter controls and connecting them to the internal Envel...
Definition envelope_module.cpp:23
@ kValue
Definition envelope_module.h:36
@ kPhase
Definition envelope_module.h:37
@ kNumOutputs
Definition envelope_module.h:38
bool force_audio_rate_
Whether this module is forced to run at audio rate.
Definition envelope_module.h:78
Envelope * envelope_
The internal Envelope processor handling the envelope generation.
Definition envelope_module.h:77
void setControlRate(bool control_rate) override
Sets the processing mode of the envelope (control-rate or audio-rate) if not forced.
Definition envelope_module.h:70
Base class for all signal-processing units in Vital.
Definition processor.h:212
virtual void setControlRate(bool control_rate)
Sets whether this Processor runs at control rate.
Definition processor.h:350
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.
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...