diff --git a/src/sfizz/modulations/ModKey.cpp b/src/sfizz/modulations/ModKey.cpp index bfdd198a..c5ee2a37 100644 --- a/src/sfizz/modulations/ModKey.cpp +++ b/src/sfizz/modulations/ModKey.cpp @@ -7,7 +7,6 @@ #include "ModKey.h" #include "../Debug.h" #include -#include namespace sfz { @@ -31,16 +30,6 @@ ModKey::Parameters& ModKey::Parameters::operator=(const Parameters& other) noexc return *this; } -bool ModKey::Parameters::operator==(const Parameters& other) const noexcept -{ - return std::memcmp(this, &other, sizeof(*this)) == 0; -} - -bool ModKey::Parameters::operator!=(const Parameters& other) const noexcept -{ - return std::memcmp(this, &other, sizeof(*this)) != 0; -} - ModKey ModKey::createCC(uint16_t cc, uint8_t curve, uint8_t smooth, float value, float step) { ModKey::Parameters p; @@ -106,13 +95,3 @@ std::string ModKey::toString() const } // namespace sfz -bool sfz::ModKey::operator==(const ModKey &other) const noexcept -{ - return id_ == other.id_ && region_ == other.region_ && - parameters() == other.parameters(); -} - -bool sfz::ModKey::operator!=(const ModKey &other) const noexcept -{ - return !this->operator==(other); -} diff --git a/src/sfizz/modulations/ModKey.h b/src/sfizz/modulations/ModKey.h index 96ab3705..5fff0197 100644 --- a/src/sfizz/modulations/ModKey.h +++ b/src/sfizz/modulations/ModKey.h @@ -9,6 +9,7 @@ #include "ModId.h" #include "../NumericId.h" #include +#include namespace sfz { @@ -49,8 +50,15 @@ public: Parameters(Parameters&&) = delete; Parameters &operator=(Parameters&&) = delete; - bool operator==(const Parameters& other) const noexcept; - bool operator!=(const Parameters& other) const noexcept; + bool operator==(const Parameters& other) const noexcept + { + return std::memcmp(this, &other, sizeof(*this)) == 0; + } + + bool operator!=(const Parameters& other) const noexcept + { + return std::memcmp(this, &other, sizeof(*this)) != 0; + } union { //! Parameters if this key identifies a CC source @@ -64,8 +72,17 @@ public: }; public: - bool operator==(const ModKey &other) const noexcept; - bool operator!=(const ModKey &other) const noexcept; + bool operator==(const ModKey &other) const noexcept + { + return id_ == other.id_ && region_ == other.region_ && + parameters() == other.parameters(); + } + + bool operator!=(const ModKey &other) const noexcept + { + return !this->operator==(other); + } + private: //! Identifier diff --git a/src/sfizz/modulations/ModMatrix.cpp b/src/sfizz/modulations/ModMatrix.cpp index 9290ba2d..643f168d 100644 --- a/src/sfizz/modulations/ModMatrix.cpp +++ b/src/sfizz/modulations/ModMatrix.cpp @@ -364,8 +364,7 @@ float* ModMatrix::getModulation(TargetId targetId) } else { ASSERT(targetFlags & kModIsAdditive); - for (uint32_t i = 0; i < numFrames; ++i) - buffer[i] += sourceDepth * sourceBuffer[i]; + sfz::multiplyAdd1(sourceDepth, sourceBuffer, buffer); } } }