Skip to content

Commit

Permalink
feat(core): Normalize RTPC value for sampling in the curve.
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Nana <[email protected]>
  • Loading branch information
na2axl committed Nov 2, 2024
1 parent 3587c32 commit 412f0b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sound/Rtpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace SparkyStudios::Audio::Amplitude
float RtpcValue::GetValue() const
{
if (_valueKind == ValueKind_RTPC && _rtpc != nullptr)
return _curve->Get(_rtpc->GetValue());
return _curve->Get((_rtpc->GetValue() - _rtpc->GetMinValue()) / (_rtpc->GetMaxValue() - _rtpc->GetMinValue()));

if (_valueKind == ValueKind_Static)
return _value;
Expand Down

0 comments on commit 412f0b9

Please sign in to comment.