655 |
return y; |
return y; |
656 |
} |
} |
657 |
|
|
658 |
|
/** |
659 |
|
* Returns the volume factor to be used for the requested signed, |
660 |
|
* normalized @a pan value and audio @a channel index. |
661 |
|
* |
662 |
|
* @param pan - between -1.0 (most left) and +1.0 (most right) |
663 |
|
* @param channel - 0: return value for left channel, 1: return value for right channel |
664 |
|
* @returns final volume factor for the requested audio channel to be applied |
665 |
|
*/ |
666 |
|
float AbstractEngine::PanCurveValueNorm(float pan, int channel) { |
667 |
|
float pan128 = (pan + 1.f) / 2.f * 128.f; |
668 |
|
if (channel == 0) pan128 = 128 - pan128; |
669 |
|
return PanCurve[pan128]; //TODO: interpolation should be done here (float type "pan" argument here allows a much more fine graded result value than those 129 steps of the PanCurve) |
670 |
|
} |
671 |
|
|
672 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |