160 |
} |
} |
161 |
|
|
162 |
double Voice::GetVelocityRelease(uint8_t MIDIKeyVelocity) { |
double Voice::GetVelocityRelease(uint8_t MIDIKeyVelocity) { |
163 |
return 0.9; // TODO: |
return 127.0 / MIDIKeyVelocity; |
164 |
} |
} |
165 |
|
|
166 |
void Voice::ProcessCCEvent(RTList<Event>::Iterator& itEvent) { |
void Voice::ProcessCCEvent(RTList<Event>::Iterator& itEvent) { |
262 |
// otherwise use the v1 EGADSR |
// otherwise use the v1 EGADSR |
263 |
pEG1 = &EGADSR1; |
pEG1 = &EGADSR1; |
264 |
EGADSR1.trigger(uint(RgnInfo.EG1PreAttack), |
EGADSR1.trigger(uint(RgnInfo.EG1PreAttack), |
265 |
RgnInfo.EG1Attack, |
std::max(0.0, RgnInfo.EG1Attack + pRegion->ampeg_vel2attack * velrelease), |
266 |
RgnInfo.EG1Hold, |
std::max(0.0, RgnInfo.EG1Hold + pRegion->ampeg_vel2hold * velrelease), |
267 |
RgnInfo.EG1Decay1, |
std::max(0.0, RgnInfo.EG1Decay1 + pRegion->ampeg_vel2decay * velrelease), |
268 |
uint(RgnInfo.EG1Sustain), |
uint(std::min(std::max(0.0, RgnInfo.EG1Sustain + 10 * pRegion->ampeg_vel2sustain * velrelease), 1000.0)), |
269 |
RgnInfo.EG1Release, |
std::max(0.0, RgnInfo.EG1Release + pRegion->ampeg_vel2release * velrelease), |
270 |
sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
271 |
} |
} |
272 |
|
|
273 |
double Voice::GetEG2ControllerValue(uint8_t MIDIKeyVelocity) { |
double Voice::GetEG2ControllerValue(uint8_t MIDIKeyVelocity) { |
274 |
/*double eg2controllervalue = 0; |
/*double eg2controllervalue = 0; |
275 |
switch (pRegion->EG2Controller.type) { |
switch (pRegion->EG2Controller.type) { |
276 |
case ::gig::eg2_ctrl_t::type_none: // no controller defined |
case ::gig::eg2_ctrl_t::type_none: // no controller defined |