Skip to content

Commit

Permalink
update to v2.6.11
Browse files Browse the repository at this point in the history
  • Loading branch information
sickozell committed May 20, 2024
1 parent 7f97e82 commit e586f4a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion extra/crossCompiler.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 19 additions & 6 deletions src/Enver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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]) {

Expand Down
6 changes: 3 additions & 3 deletions src/shapes.hpp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -261,7 +261,7 @@

},

{
{ // log
0.0,
0.007797241210938,
0.015563964843750,
Expand Down Expand Up @@ -522,7 +522,7 @@

},

{
{ // gentle (flesso)
0.0,
0.000122070312500,
0.000274658203125,
Expand Down

0 comments on commit e586f4a

Please sign in to comment.