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

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

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

revision 2223 by iliev, Fri Jul 29 13:39:58 2011 UTC revision 3034 by schoenebeck, Mon Oct 31 00:05:00 2016 UTC
# Line 59  namespace LinuxSampler { Line 59  namespace LinuxSampler {
59               * @param ExtControlValue - new external controller value               * @param ExtControlValue - new external controller value
60               */               */
61              inline void update(const uint16_t& ExtControlValue) {              inline void update(const uint16_t& ExtControlValue) {
62                  const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...                  //const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...
63                  const float max = this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff;                  const float max = this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff;
64                  if (RANGE == range_unsigned) {                  if (RANGE == range_unsigned) {
65                      normalizer = max / 2.0f;                      normalizer = max / 2.0f;
# Line 92  namespace LinuxSampler { Line 92  namespace LinuxSampler {
92    
93                  uiLevel = 0;                  uiLevel = 0;
94              }              }
95                
96                /**
97                 * @param phase 0 to 360 degrees
98                 */
99                void setPhase(float phase) {
100                    if (phase < 0) phase = 0;
101                    if (phase > 360) phase = 360;
102                    phase /= 360.0f;
103                    const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...
104                    uiLevel = intLimit * phase;
105                }
106                
107                void setFrequency(float Frequency, unsigned int SampleRate) {
108                    const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...
109                    float r = Frequency / (float) SampleRate; // frequency alteration quotient
110                    c = (int) (intLimit * r);
111                }
112    
113          protected:          protected:
114              unsigned int uiLevel;              unsigned int uiLevel;

Legend:
Removed from v.2223  
changed lines
  Added in v.3034

  ViewVC Help
Powered by ViewVC