start2 method
Implementation
void start2(RegionPair region, int key, int velocity)
{
// If the release time is shorter than 10 ms, it will be clamped to 10 ms to avoid pop noise.
var hold = region.holdVolumeEnvelope() *
SoundFontMath.keyNumberToMultiplyingFactor(region.keyNumberToVolumeEnvelopeHold(), key);
var decay = region.decayVolumeEnvelope() *
SoundFontMath.keyNumberToMultiplyingFactor(region.keyNumberToVolumeEnvelopeDecay(), key);
start(delay: region.delayVolumeEnvelope(),
attack: region.attackVolumeEnvelope(),
hold: hold,
decay: decay,
sustain: SoundFontMath.decibelsToLinear(-region.sustainVolumeEnvelope()),
release: max(region.releaseVolumeEnvelope(), 0.01),
);
}