start2 method
Implementation
void start2(RegionPair region, int key, int velocity)
{
// According to the implementation of TinySoundFont,
// the attack time should be adjusted by the velocity.
var hold = region.holdModulationEnvelope() *
SoundFontMath.keyNumberToMultiplyingFactor(region.keyNumberToModulationEnvelopeHold(), key);
var decay = region.decayModulationEnvelope() *
SoundFontMath.keyNumberToMultiplyingFactor(region.keyNumberToModulationEnvelopeDecay(), key);
start(delay: region.delayModulationEnvelope(),
attack: region.attackModulationEnvelope() * ((145.0 - velocity) / 144.0),
hold: hold,
decay: decay,
sustain: 1.0 - region.sustainModulationEnvelope() / 100.0,
release: region.releaseModulationEnvelope());
}