MCPcopy Create free account
hub / github.com/StrangeLoopsAudio/gRainbow / EnvModSource

Class EnvModSource

Source/Modulators.h:118–145  ·  view source on GitHub ↗

Envelope modulation source

Source from the content-addressed store, hash-verified

116
117// Envelope modulation source
118class EnvModSource : public ModSource {
119public:
120 EnvModSource(int idx, juce::Colour _colour): ModSource(idx, _colour) {}
121
122 ModSourceType getType() { return ModSourceType::ENV; }
123 void processBlock() override;
124 juce::Range<float> getRange() override;
125 float getPhase() override { return (float)mEnv.state; }
126
127 void handleNoteOn(int ts) {
128 mEnv.noteOn(ts);
129 mCurTs = ts;
130 }
131 void handleNoteOff(int ts) {
132 mEnv.noteOff(ts);
133 mCurTs = ts;
134 }
135
136 // Must be initialized externally (in this app done in Parameters.cpp)
137 juce::AudioParameterFloat* attack;
138 juce::AudioParameterFloat* decay;
139 juce::AudioParameterFloat* sustain;
140 juce::AudioParameterFloat* release;
141
142private:
143 Utils::EnvelopeADSR mEnv;
144 int mCurTs = 0;
145};
146
147// Macro modulation source
148class MacroModSource : public ModSource {

Callers 1

ParamGlobalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected