71 KAttachment(std::shared_ptr<KParameter> paramToAttach, std::function<
void(
float)> updateFunction =
nullptr);
85 KAttachment(std::shared_ptr<KParameter> paramToAttach,
float smoothingTimeSeconds,
int updateRate,
86 std::function<
void(
float)> updateFunction =
nullptr);
94 void prepare(
double sampleRate,
int samplesPerBlock);
195 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
KAttachment)
Definition KAttachment.h:23
void reset()
Definition KAttachment.h:36
void incrementCounters()
Definition KAttachment.h:49
ParameterUpdater(KAttachment &owner)
Definition KAttachment.h:25
void callUpdateFunction()
Definition KAttachment.h:43
KAttachment & m_owner
Definition KAttachment.h:55
int m_updateCounter
Definition KAttachment.h:56
int m_sampleCounter
Definition KAttachment.h:57
void next()
Definition KAttachment.h:27
Attaches to a KParameter to provide parameter smoothing and modulation.
Definition KAttachment.h:13
int m_numSmoothingSamples
Definition KAttachment.h:174
std::unique_ptr< ParameterUpdater > m_updater
Definition KAttachment.h:170
void sendInitialUpdate()
Definition KAttachment.cpp:226
bool m_wasSmoothing
Definition KAttachment.h:191
const float * data()
Definition KAttachment.cpp:155
void updateSmoother()
Definition KAttachment.cpp:249
void applyPendingUpdates()
Definition KAttachment.cpp:212
SmoothedValue< float > m_smoother
Definition KAttachment.h:172
void setModulatorDepth(Modulator *m, float depth)
Definition KAttachment.cpp:195
void modulatorChanged(const Modulator *m) override
Definition KAttachment.cpp:243
Array< Modulator * > m_fastModulators
Definition KAttachment.h:177
Polarity
Definition KAttachment.h:120
@ Bipolar
Definition KAttachment.h:121
@ Unipolar
Definition KAttachment.h:122
AudioBuffer< float > m_valueBuffer
Definition KAttachment.h:168
bool m_needsUpdate
Definition KAttachment.h:190
void addModulator(Modulator *m, float depth=1.0f, Polarity polarity=Polarity::Bipolar)
Definition KAttachment.cpp:166
std::map< Modulator *, Depth > m_depthMap
Definition KAttachment.h:185
Array< Modulator * > m_slowModulators
Definition KAttachment.h:176
void prepare(double sampleRate, int samplesPerBlock)
Definition KAttachment.cpp:53
void setModulatorPolarity(Modulator *m, Polarity polarity)
Definition KAttachment.cpp:204
bool nextBlock(int numSamples)
Definition KAttachment.cpp:76
double m_sampleRate
Definition KAttachment.h:187
RangedAudioParameter * m_cachedParameterPtr
Definition KAttachment.h:166
Mode
Definition KAttachment.h:154
@ Continuous
Definition KAttachment.h:156
@ Discrete
Definition KAttachment.h:155
const std::function< void(float)> m_updateFunction
Definition KAttachment.h:192
void parameterGestureChanged(int, bool) override
Definition KAttachment.h:160
KAttachment(std::shared_ptr< KParameter > paramToAttach, std::function< void(float)> updateFunction=nullptr)
Definition KAttachment.cpp:3
const Mode m_attachmentMode
Definition KAttachment.h:169
int m_maxBlockSize
Definition KAttachment.h:188
float m_smoothingTimeSeconds
Definition KAttachment.h:173
void parameterValueChanged(int, float newValue) override
Definition KAttachment.cpp:220
bool needsUpdate() const
Definition KAttachment.cpp:218
~KAttachment() override
Definition KAttachment.cpp:45
void removeModulator(Modulator *m)
Definition KAttachment.cpp:183
float m_parameterValue
Definition KAttachment.h:167
std::weak_ptr< RangedAudioParameter > const m_parameterPtr
Definition KAttachment.h:165
int m_updateRate
Definition KAttachment.h:193
ParameterUpdater * getUpdater()
Definition KAttachment.cpp:157
Holds a list of modulation destinations and sends events to them when the modulator output is updated...
Definition ModulationSource.h:20
Definition AirAbsorptionFilter.cpp:2
Definition KAttachment.h:180
Polarity polarity
Definition KAttachment.h:182
float value
Definition KAttachment.h:181
Definition ModulationSource.h:23