Skip to content

Commit

Permalink
Add skew to attack/release in Hades
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 12, 2024
1 parent e84350d commit e52a3ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grit/eurorack/hades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ auto Hades::Channel::setParameter(Parameter const& parameter) -> void
{
_parameter = parameter;

auto const attack = Milliseconds<float>{remap(parameter.attack, 1.0F, 50.0F)};
auto const release = Milliseconds<float>{remap(parameter.release, 1.0F, 500.0F)};
auto const attack = Milliseconds<float>{attackRange.from0to1(parameter.attack)};
auto const release = Milliseconds<float>{releaseRange.from0to1(parameter.release)};

_envelope.setParameter({
.attack = attack,
Expand Down
4 changes: 4 additions & 0 deletions lib/grit/eurorack/hades.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <grit/audio/waveshape/half_wave_rectifier.hpp>
#include <grit/audio/waveshape/hard_clipper.hpp>
#include <grit/audio/waveshape/tanh_clipper.hpp>
#include <grit/math/normalizable_range.hpp>
#include <grit/math/remap.hpp>
#include <grit/unit/decibel.hpp>

Expand Down Expand Up @@ -110,6 +111,9 @@ struct Hades
[[nodiscard]] auto operator()(float sample) -> etl::pair<float, float>;

private:
static constexpr auto attackRange = NormalizableRange<float>{1.0F, 100.0F, 25.0F};
static constexpr auto releaseRange = NormalizableRange<float>{1.0F, 500.0F, 100.0F};

Parameter _parameter{};

EnvelopeFollower<float> _envelope{};
Expand Down

0 comments on commit e52a3ce

Please sign in to comment.