diff --git a/src/sfizz/Config.h b/src/sfizz/Config.h index ad3e82ee..97061613 100644 --- a/src/sfizz/Config.h +++ b/src/sfizz/Config.h @@ -56,8 +56,8 @@ namespace config { constexpr int numVoices { 64 }; constexpr unsigned maxVoices { 256 }; constexpr unsigned smoothingSteps { 512 }; - constexpr uint8_t xfadeSmoothing { 5 }; - constexpr uint8_t gainSmoothing { 0 }; + constexpr uint16_t xfadeSmoothing { 5 }; + constexpr uint16_t gainSmoothing { 0 }; constexpr unsigned powerTableSizeExponent { 11 }; constexpr int maxFilePromises { maxVoices }; constexpr int allSoundOffCC { 120 }; diff --git a/src/sfizz/Defaults.cpp b/src/sfizz/Defaults.cpp index 6921be22..b01a8f77 100644 --- a/src/sfizz/Defaults.cpp +++ b/src/sfizz/Defaults.cpp @@ -58,7 +58,7 @@ FloatSpec hiNormalized { 1.0f, {0.0f, 1.0f}, 0 }; FloatSpec loBipolar { -1.0f, {-1.0f, 1.0f}, 0 }; FloatSpec hiBipolar { 1.0f, {-1.0f, 1.0f}, 0 }; UInt16Spec ccNumber { 0, {0, config::numCCs}, 0 }; -UInt8Spec smoothCC { 0, {0, 100}, 0 }; +UInt16Spec smoothCC { 0, {0, 100}, kPermissiveUpperBound }; UInt8Spec curveCC { 0, {0, 255}, 0 }; UInt8Spec sustainCC { 64, {0, 127}, 0 }; FloatSpec sustainThreshold { 1.0f, {0.0f, 127.0f}, kNormalizeMidi }; diff --git a/src/sfizz/Defaults.h b/src/sfizz/Defaults.h index f9850390..8e0dec68 100644 --- a/src/sfizz/Defaults.h +++ b/src/sfizz/Defaults.h @@ -159,7 +159,7 @@ namespace Default extern const OpcodeSpec hiChannelAftertouch; extern const OpcodeSpec ccNumber; extern const OpcodeSpec curveCC; - extern const OpcodeSpec smoothCC; + extern const OpcodeSpec smoothCC; extern const OpcodeSpec sustainCC; extern const OpcodeSpec checkSustain; extern const OpcodeSpec checkSostenuto; diff --git a/src/sfizz/Region.h b/src/sfizz/Region.h index 6244424f..89e720ac 100644 --- a/src/sfizz/Region.h +++ b/src/sfizz/Region.h @@ -464,7 +464,7 @@ struct Region { float bendUp { Default::bendUp }; float bendDown { Default::bendDown }; float bendStep { Default::bendStep }; - uint8_t bendSmooth { Default::smoothCC }; + uint16_t bendSmooth { Default::smoothCC }; // Envelopes EGDescription amplitudeEG; diff --git a/src/sfizz/Smoothers.cpp b/src/sfizz/Smoothers.cpp index df935bc6..df17280e 100644 --- a/src/sfizz/Smoothers.cpp +++ b/src/sfizz/Smoothers.cpp @@ -20,7 +20,7 @@ OnePoleSmoother::OnePoleSmoother() { } -void OnePoleSmoother::setSmoothing(uint8_t smoothValue, float sampleRate) +void OnePoleSmoother::setSmoothing(unsigned smoothValue, float sampleRate) { smoothing = (smoothValue > 0); if (smoothing) { @@ -62,7 +62,7 @@ LinearSmoother::LinearSmoother() { } -void LinearSmoother::setSmoothing(uint8_t smoothValue, float sampleRate) +void LinearSmoother::setSmoothing(unsigned smoothValue, float sampleRate) { const float smoothTime = 1e-3f * smoothValue; smoothFrames_ = static_cast(smoothTime * sampleRate); diff --git a/src/sfizz/Smoothers.h b/src/sfizz/Smoothers.h index e62190eb..0527e96d 100644 --- a/src/sfizz/Smoothers.h +++ b/src/sfizz/Smoothers.h @@ -24,7 +24,7 @@ public: * @param smoothValue * @param sampleRate */ - void setSmoothing(uint8_t smoothValue, float sampleRate); + void setSmoothing(unsigned smoothValue, float sampleRate); /** * @brief Reset the filter state to a given value * @@ -63,7 +63,7 @@ public: * @param smoothValue * @param sampleRate */ - void setSmoothing(uint8_t smoothValue, float sampleRate); + void setSmoothing(unsigned smoothValue, float sampleRate); /** * @brief Reset the filter state to a given value * diff --git a/src/sfizz/modulations/ModKey.cpp b/src/sfizz/modulations/ModKey.cpp index 55d9cee5..5dbdc057 100644 --- a/src/sfizz/modulations/ModKey.cpp +++ b/src/sfizz/modulations/ModKey.cpp @@ -56,7 +56,7 @@ ModKey::Parameters& ModKey::Parameters::operator=(Parameters&& other) noexcept return *this; } -ModKey ModKey::createCC(uint16_t cc, uint8_t curve, uint8_t smooth, float step) +ModKey ModKey::createCC(uint16_t cc, uint8_t curve, uint16_t smooth, float step) { ModKey::Parameters p; p.cc = cc; diff --git a/src/sfizz/modulations/ModKey.h b/src/sfizz/modulations/ModKey.h index 9498ee39..69dc50b3 100644 --- a/src/sfizz/modulations/ModKey.h +++ b/src/sfizz/modulations/ModKey.h @@ -28,7 +28,7 @@ public: explicit ModKey(ModId id, NumericId region = {}, Parameters params = {}) : id_(id), region_(region), params_(params), flags_(ModIds::flags(id_)) {} - static ModKey createCC(uint16_t cc, uint8_t curve, uint8_t smooth, float step); + static ModKey createCC(uint16_t cc, uint8_t curve, uint16_t smooth, float step); static ModKey createNXYZ(ModId id, NumericId region = {}, uint8_t N = 0, uint8_t X = 0, uint8_t Y = 0, uint8_t Z = 0); explicit operator bool() const noexcept { return id_ != ModId(); } @@ -45,7 +45,7 @@ public: struct RawParameters { union { //! Parameters if this key identifies a CC source - struct { uint16_t cc; uint8_t curve, smooth; float step; }; + struct { uint16_t cc; uint8_t curve; uint16_t smooth; float step; }; //! Parameters otherwise, based on the related opcode // eg. `N` in `lfoN`, `N, X` in `lfoN_eqX` struct { uint8_t N, X, Y, Z; };