Merge pull request #437 from paulfd/default-attack-release
Default attack release
This commit is contained in:
commit
6f3422a172
4 changed files with 16 additions and 1 deletions
|
|
@ -231,6 +231,7 @@ namespace Default
|
|||
constexpr float delayEG { 0 };
|
||||
constexpr float hold { 0 };
|
||||
constexpr float release { 0 };
|
||||
constexpr float ampegRelease { 0.001 }; // Default release to avoid clicks
|
||||
constexpr float vel2release { 0.0f };
|
||||
constexpr float start { 0.0 };
|
||||
constexpr float sustain { 100.0 };
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ struct Region {
|
|||
|
||||
gainToEffect.reserve(5); // sufficient room for main and fx1-4
|
||||
gainToEffect.push_back(1.0); // contribute 100% into the main bus
|
||||
|
||||
// Default amplitude release
|
||||
amplitudeEG.release = Default::ampegRelease;
|
||||
}
|
||||
Region(const Region&) = default;
|
||||
~Region() = default;
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ TEST_CASE("[Region] Parsing opcodes")
|
|||
REQUIRE(region.amplitudeEG.decay == 0.0f);
|
||||
REQUIRE(region.amplitudeEG.delay == 0.0f);
|
||||
REQUIRE(region.amplitudeEG.hold == 0.0f);
|
||||
REQUIRE(region.amplitudeEG.release == 0.0f);
|
||||
REQUIRE(region.amplitudeEG.release == 0.001f);
|
||||
REQUIRE(region.amplitudeEG.start == 0.0f);
|
||||
REQUIRE(region.amplitudeEG.sustain == 100.0f);
|
||||
REQUIRE(region.amplitudeEG.depth == 0);
|
||||
|
|
|
|||
|
|
@ -1369,3 +1369,14 @@ TEST_CASE("[Synth] Initial values of CC")
|
|||
REQUIRE(synth.getHdccInit(111) == Approx(0.1234f));
|
||||
REQUIRE(synth.getHdccInit(112) == Approx(77.0f / 127));
|
||||
}
|
||||
|
||||
TEST_CASE("[Synth] Default ampeg_release")
|
||||
{
|
||||
sfz::Synth synth;
|
||||
|
||||
synth.loadSfzString(fs::current_path() / "default_release.sfz", R"(
|
||||
<region> sample=*sine
|
||||
)");
|
||||
|
||||
REQUIRE(synth.getRegionView(0)->amplitudeEG.release > 0.0005f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue