Skip to content

Commit

Permalink
Finish moving RegionsValueT to SynthDiscussion
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfd committed Jan 22, 2024
1 parent 6504a38 commit 86d98f4
Show file tree
Hide file tree
Showing 4 changed files with 1,465 additions and 2,978 deletions.
25 changes: 12 additions & 13 deletions src/sfizz/SfzHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,21 @@ inline CXX14_CONSTEXPR bool ccModulationIsPerVoice(int cc) {
}

namespace literals {
inline float operator""_norm(unsigned long long int value)
inline float operator""_norm(unsigned long long int value)
{
if (value > 127)
value = 127;

return normalize7Bits(value);
return static_cast<float>(value) / 127.0f;
}

inline float operator""_norm(long double value)
inline float operator""_norm(long double value)
{
if (value < 0)
value = 0;
if (value > 127)
value = 127;

return normalize7Bits(value);
return static_cast<float>(value) / 127.0f;
}
inline float operator""_bend(unsigned long long int value)
{
return static_cast<float>(value) / 8191.0f;
}
inline float operator""_bend(long double value)
{
return static_cast<float>(value) / 8191.0f;
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/RegionValuesSetT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace sfz;

using OSC = OSCValueLess;

TEST_CASE("[Set values]")
TEST_CASE("Set values", "[parsing][OSC]")
{
SynthDiscussion d;

Expand Down
Loading

0 comments on commit 86d98f4

Please sign in to comment.