/[svn]/linuxsampler/trunk/src/engines/AbstractEngine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/AbstractEngine.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2930 by schoenebeck, Tue Apr 19 14:07:53 2016 UTC revision 2931 by schoenebeck, Sat Jul 9 14:38:33 2016 UTC
# Line 655  namespace LinuxSampler { Line 655  namespace LinuxSampler {
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

Legend:
Removed from v.2930  
changed lines
  Added in v.2931

  ViewVC Help
Powered by ViewVC