113 |
// calculate volume |
// calculate volume |
114 |
const double velocityAttenuation = GetVelocityAttenuation(itNoteOnEvent->Param.Note.Velocity); |
const double velocityAttenuation = GetVelocityAttenuation(itNoteOnEvent->Param.Note.Velocity); |
115 |
float volume = CalculateVolume(velocityAttenuation); |
float volume = CalculateVolume(velocityAttenuation); |
116 |
|
if (volume <= 0) return -1; |
117 |
|
|
118 |
// select channel mode (mono or stereo) |
// select channel mode (mono or stereo) |
119 |
SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, SmplInfo.ChannelCount == 2); |
SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, SmplInfo.ChannelCount == 2); |
609 |
GetNoteOnTime(MIDIKey) ) / GetEngine()->SampleRate; |
GetNoteOnTime(MIDIKey) ) / GetEngine()->SampleRate; |
610 |
|
|
611 |
float attenuation = 1 - 0.01053 * (256 >> RgnInfo.ReleaseTriggerDecay) * noteLength; |
float attenuation = 1 - 0.01053 * (256 >> RgnInfo.ReleaseTriggerDecay) * noteLength; |
|
if (attenuation <= 0) return -1; |
|
612 |
volume *= attenuation; |
volume *= attenuation; |
613 |
} |
} |
614 |
|
|