diff --git a/changelog.md b/changelog.md index 72c2f96..6fb0793 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -### 2.6.11 (2024-05-19) +### 2.6.11 (2024-05-20) - added 'enver' module. - added 'multiSwitcher' and 'multiRouter' modules. - improved usability of 'sickoAmp'. diff --git a/extra/crossCompiler.md b/extra/crossCompiler.md index 6a857af..e1ede56 100644 --- a/extra/crossCompiler.md +++ b/extra/crossCompiler.md @@ -1,4 +1,4 @@ -git tag v2.6.11-beta10 -m "create v2.6.11-beta10" +git tag v2.6.11-beta11 -m "create v2.6.11-beta11" git push origin --tags delete local tag diff --git a/src/Enver.cpp b/src/Enver.cpp index 75742d4..f3be55e 100644 --- a/src/Enver.cpp +++ b/src/Enver.cpp @@ -202,6 +202,20 @@ struct Enver : Module { } + float shapeResponse2(float value) { + + if (shape < 0.25f) { + return (expTable[1][int(expTableCoeff * value)] * (1 - shape * 4.f)) + (expTable[2][int(expTableCoeff * value)] * (shape * 4.f)); + } else if (shape < 0.5f) { + return (expTable[2][int(expTableCoeff * value)] * (1 - ((shape - 0.25f) * 4.f))) + (value * ((shape - 0.25f) * 4.f)); + } else if (shape < 0.75f) { + return (value * (1 - ((shape - 0.5f) * 4.f))) + (expTable[2][int(expTableCoeff * value)] * ((shape - 0.5f) * 4.f)); + } else { + return (expTable[2][int(expTableCoeff * value)] * (1 - ((shape - 0.75f) * 4.f))) + (expTable[0][int(expTableCoeff * value)] * ((shape - 0.75f) * 4.f)); + } + + } + static float convertCVToMs(float cv) { return minStageTime * std::pow(maxStageTime / minStageTime, cv); } @@ -426,7 +440,8 @@ struct Enver : Module { } if (mode == ENV_MODE) { - stageLevel[c] = (shapeResponse(1 - (stageSample[c] / maxStageSample[c])) * (1 - sustainValue)) + sustainValue; + + stageLevel[c] = (shapeResponse2(1 - (stageSample[c] / maxStageSample[c])) * (1 - sustainValue)) + sustainValue; if (stageSample[c] >= maxStageSample[c]) { stage[c] = SUSTAIN_STAGE; @@ -440,10 +455,8 @@ struct Enver : Module { } } else if (mode == FUNC_MODE) { - //stageLevel[c] = (shapeResponse(1 - (stageSample[c] / maxStageSample[c])) * (1 - sustainValue)) + sustainValue; - //stageLevel[c] = shapeResponse(1 - (stageSample[c] / maxStageSample[c])); - stageLevel[c] = shapeResponse(1 - (stageSample[c] / maxStageSample[c])) * refValue[c]; + stageLevel[c] = shapeResponse2(1 - (stageSample[c] / maxStageSample[c])) * refValue[c]; if (stageSample[c] >= maxStageSample[c]) { stage[c] = STOP_STAGE; @@ -458,7 +471,7 @@ struct Enver : Module { } } else { // loop mode - stageLevel[c] = (shapeResponse(1 - (stageSample[c] / maxStageSample[c])) ); + stageLevel[c] = (shapeResponse2(1 - (stageSample[c] / maxStageSample[c])) ); if (stageSample[c] >= maxStageSample[c]) { stage[c] = ATTACK_STAGE; @@ -517,7 +530,7 @@ struct Enver : Module { maxStageSample[c] = 0; } - stageLevel[c] = shapeResponse(1 - (stageSample[c] / maxStageSample[c])) * refValue[c]; + stageLevel[c] = shapeResponse2(1 - (stageSample[c] / maxStageSample[c])) * refValue[c]; if (stageSample[c] >= maxStageSample[c]) { diff --git a/src/shapes.hpp b/src/shapes.hpp index 2d6a019..6d69ab1 100644 --- a/src/shapes.hpp +++ b/src/shapes.hpp @@ -1,6 +1,6 @@ const int expTableCoeff = 256; - const float expTable[3][257] = {{ + const float expTable[3][257] = {{ // exp 0.0, 0.000061035156250, 0.000137329101563, @@ -261,7 +261,7 @@ }, - { + { // log 0.0, 0.007797241210938, 0.015563964843750, @@ -522,7 +522,7 @@ }, - { + { // gentle (flesso) 0.0, 0.000122070312500, 0.000274658203125,