/[svn]/linuxsampler/trunk/src/engines/common/LFOTriangleIntMath.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/LFOTriangleIntMath.h

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

revision 718 by schoenebeck, Sun Jul 24 15:05:30 2005 UTC revision 719 by senkov, Sun Jul 24 16:48:11 2005 UTC
# Line 64  namespace LinuxSampler { Line 64  namespace LinuxSampler {
64               */               */
65              inline void update(const uint16_t& ExtControlValue) {              inline void update(const uint16_t& ExtControlValue) {
66                  const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...                  const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...
67                  const float max = InternalDepth + ExtControlValue * ExtControlDepthCoeff;                  const float max = this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff;
68                  if (RANGE == range_unsigned) {                  if (RANGE == range_unsigned) {
69                      normalizer = max / (float) intLimit;                      normalizer = max / (float) intLimit;
70                  } else { // signed range                  } else { // signed range
# Line 88  namespace LinuxSampler { Line 88  namespace LinuxSampler {
88               *                          audio output signal               *                          audio output signal
89               */               */
90              void trigger(float Frequency, start_level_t StartLevel, uint16_t InternalDepth, uint16_t ExtControlDepth, bool FlipPhase, unsigned int SampleRate) {              void trigger(float Frequency, start_level_t StartLevel, uint16_t InternalDepth, uint16_t ExtControlDepth, bool FlipPhase, unsigned int SampleRate) {
91                  this->InternalDepth        = (InternalDepth / 1200.0f) * Max;                  this->InternalDepth        = (InternalDepth / 1200.0f) * this->Max;
92                  this->ExtControlDepthCoeff = (((float) ExtControlDepth / 1200.0f) / 127.0f) * Max;                  this->ExtControlDepthCoeff = (((float) ExtControlDepth / 1200.0f) / 127.0f) * this->Max;
93                  if (RANGE == range_unsigned) {                  if (RANGE == range_unsigned) {
94                      this->InternalDepth        *= 2.0f;                      this->InternalDepth        *= 2.0f;
95                      this->ExtControlDepthCoeff *= 2.0f;                      this->ExtControlDepthCoeff *= 2.0f;

Legend:
Removed from v.718  
changed lines
  Added in v.719

  ViewVC Help
Powered by ViewVC