Skip to content

Commit

Permalink
Use operator() in DynamicSmoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 17, 2024
1 parent 4d1c8b1 commit 11be6a5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions lib/grit/audio/filter/dynamic_smoothing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct DynamicSmoothing
DynamicSmoothing() = default;

auto setSampleRate(Float sampleRate) -> void;
auto process(Float input) -> Float;
auto operator()(Float input) -> Float;
auto reset() -> void;

private:
Expand All @@ -38,7 +38,7 @@ auto DynamicSmoothing<Float>::setSampleRate(Float sampleRate) -> void
}

template<etl::floating_point Float>
auto DynamicSmoothing<Float>::process(Float input) -> Float
auto DynamicSmoothing<Float>::operator()(Float input) -> Float
{
auto const low1z = _low1;
auto const low2z = _low2;
Expand Down
4 changes: 2 additions & 2 deletions lib/grit/audio/mix/cross_fade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct CrossFade
auto setParameter(Parameter parameter) -> void;
[[nodiscard]] auto getParameter() const -> Parameter;

auto process(Float left, Float right) -> Float;
auto operator()(Float left, Float right) -> Float;

private:
auto update() -> void;
Expand All @@ -56,7 +56,7 @@ auto CrossFade<Float>::getParameter() const -> Parameter
}

template<etl::floating_point Float>
auto CrossFade<Float>::process(Float left, Float right) -> Float
auto CrossFade<Float>::operator()(Float left, Float right) -> Float
{
return (left * _gainL) + (right * _gainR);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/grit/audio/oscillator/variable_shape_oscillator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ auto VariableShapeOscillator<Float>::addPhaseOffset(Float offset) -> void
template<etl::floating_point Float>
auto VariableShapeOscillator<Float>::operator()() -> Float
{
return _crossFade.process(_oscA(), _oscB());
return _crossFade(_oscA(), _oscB());
}

} // namespace grit
16 changes: 8 additions & 8 deletions lib/grit/eurorack/hades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ auto Hades::prepare(float sampleRate, etl::size_t blockSize) -> void

auto Hades::process(StereoBlock<float> const& buffer, ControlInput const& inputs) -> ControlOutput
{
auto const textureKnob = _textureKnob.process(inputs.textureKnob);
auto const morphKnob = _morphKnob.process(inputs.morphKnob);
auto const ampKnob = _ampKnob.process(inputs.ampKnob);
auto const compressorKnob = _compressorKnob.process(inputs.compressorKnob);
auto const morphCv = _morphCv.process(inputs.morphCV);
auto const sideChainCv = _sideChainCv.process(inputs.sideChainCV);
auto const attackCv = _attackCv.process(inputs.attackCV);
auto const releaseCv = _releaseCv.process(inputs.releaseCV);
auto const textureKnob = _textureKnob(inputs.textureKnob);
auto const morphKnob = _morphKnob(inputs.morphKnob);
auto const ampKnob = _ampKnob(inputs.ampKnob);
auto const compressorKnob = _compressorKnob(inputs.compressorKnob);
auto const morphCv = _morphCv(inputs.morphCV);
auto const sideChainCv = _sideChainCv(inputs.sideChainCV);
auto const attackCv = _attackCv(inputs.attackCV);
auto const releaseCv = _releaseCv(inputs.releaseCV);

auto const channelParameter = Hades::Channel::Parameter{
.texture = textureKnob,
Expand Down
18 changes: 9 additions & 9 deletions src/amp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ struct Amp

[[nodiscard]] auto process(grit::StereoBlock<float> const& buffer, ControlInput const& inputs) -> void
{
auto const gainKnob = _gainKnob.process(inputs.gainKnob);
auto const toneKnob = _toneKnob.process(inputs.toneKnob);
auto const outputKnob = _outputKnob.process(inputs.outputKnob);
auto const mixKnob = _mixKnob.process(inputs.mixKnob);

auto const gainCV = _gainCV.process(inputs.gainCV);
auto const toneCV = _toneCV.process(inputs.toneCV);
auto const outputCV = _outputCV.process(inputs.outputCV);
auto const mixCV = _mixCV.process(inputs.mixCV);
auto const gainKnob = _gainKnob(inputs.gainKnob);
auto const toneKnob = _toneKnob(inputs.toneKnob);
auto const outputKnob = _outputKnob(inputs.outputKnob);
auto const mixKnob = _mixKnob(inputs.mixKnob);

auto const gainCV = _gainCV(inputs.gainCV);
auto const toneCV = _toneCV(inputs.toneCV);
auto const outputCV = _outputCV(inputs.outputCV);
auto const mixCV = _mixCV(inputs.mixCV);

auto const parameter = Channel::Parameter{
.mode = inputs.mode,
Expand Down

0 comments on commit 11be6a5

Please sign in to comment.