474 |
// TODO: The SustainPedal condition could be wrong, maybe the |
// TODO: The SustainPedal condition could be wrong, maybe the |
475 |
// check should be if this Voice is in release stage or is a |
// check should be if this Voice is in release stage or is a |
476 |
// release sample instead. Need to test this in GSt. |
// release sample instead. Need to test this in GSt. |
477 |
if (itEvent->Param.Note.Key != MIDIKey || |
// -- Andreas |
478 |
!GetGigEngineChannel()->SustainPedal) { |
// |
479 |
|
// Commented sustain pedal check out. I don't think voices of the same |
480 |
|
// note should be stopped at all, because it doesn't sound naturally |
481 |
|
// with a drumkit. |
482 |
|
// -- Christian, 2013-01-08 |
483 |
|
if (itEvent->Param.Note.Key != MIDIKey /*|| |
484 |
|
!GetGigEngineChannel()->SustainPedal*/) { |
485 |
dmsg(4,("Voice %x - kill", this)); |
dmsg(4,("Voice %x - kill", this)); |
486 |
|
|
487 |
// kill the voice fast |
// kill the voice fast |
493 |
EG1.CalculateFadeOutCoeff(FadeOutTime, SampleRate); |
EG1.CalculateFadeOutCoeff(FadeOutTime, SampleRate); |
494 |
} |
} |
495 |
|
|
496 |
|
int Voice::CalculatePan(uint8_t pan) { |
497 |
|
int p; |
498 |
|
// Gst behaviour: -64 and 63 are special cases |
499 |
|
if (RgnInfo.Pan == -64) p = pan * 2 - 127; |
500 |
|
else if (RgnInfo.Pan == 63) p = pan * 2; |
501 |
|
else p = pan + RgnInfo.Pan; |
502 |
|
|
503 |
|
if (p < 0) return 0; |
504 |
|
if (p > 127) return 127; |
505 |
|
return p; |
506 |
|
} |
507 |
|
|
508 |
}} // namespace LinuxSampler::gig |
}} // namespace LinuxSampler::gig |