/[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 3611 by schoenebeck, Fri Aug 23 11:44:00 2019 UTC revision 3612 by schoenebeck, Mon Sep 30 18:03:43 2019 UTC
# Line 28  namespace LinuxSampler { Line 28  namespace LinuxSampler {
28    
29      /** @brief sine LFO      /** @brief sine LFO
30       */       */
31      template<range_type_t RANGE>      template<LFO::range_type_t RANGE>
32      class SineLFO : public LFOBase<RANGE> {      class SineLFO : public LFOBase<RANGE> {
33          public:          public:
34    
# Line 47  namespace LinuxSampler { Line 47  namespace LinuxSampler {
47               */               */
48              inline float render() {              inline float render() {
49                  uiLevel += c;                  uiLevel += c;
50                  if (RANGE == range_unsigned)                  if (RANGE == LFO::range_unsigned)
51                      return normalizer * (sin(c2 * (float)uiLevel) + 1.0f);                      return normalizer * (sin(c2 * (float)uiLevel) + 1.0f);
52                  else /* signed range */                  else /* signed range */
53                      return normalizer * sin(c2 * (float)uiLevel);                      return normalizer * sin(c2 * (float)uiLevel);
# Line 63  namespace LinuxSampler { Line 63  namespace LinuxSampler {
63    
64                  //const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...                  //const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF...
65                  const float max = (this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff) * this->ScriptDepthFactor;                  const float max = (this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff) * this->ScriptDepthFactor;
66                  if (RANGE == range_unsigned) {                  if (RANGE == LFO::range_unsigned) {
67                      normalizer = max / 2.0f;                      normalizer = max / 2.0f;
68                  } else { // signed range                  } else { // signed range
69                      normalizer = max;                      normalizer = max;
# Line 83  namespace LinuxSampler { Line 83  namespace LinuxSampler {
83               * @param SampleRate      - current sample rate of the engines               * @param SampleRate      - current sample rate of the engines
84               *                          audio output signal               *                          audio output signal
85               */               */
86              virtual void trigger(float Frequency, start_level_t StartLevel, uint16_t InternalDepth, uint16_t ExtControlDepth, bool FlipPhase, unsigned int SampleRate) {              virtual void trigger(float Frequency, LFO::start_level_t StartLevel, uint16_t InternalDepth, uint16_t ExtControlDepth, bool FlipPhase, unsigned int SampleRate) {
87                  this->Frequency            = Frequency;                  this->Frequency            = Frequency;
88                  this->InternalDepth        = (InternalDepth / 1200.0f) * this->Max;                  this->InternalDepth        = (InternalDepth / 1200.0f) * this->Max;
89                  this->ExtControlDepthCoeff = (((float) ExtControlDepth / 1200.0f) / 127.0f) * this->Max;                  this->ExtControlDepthCoeff = (((float) ExtControlDepth / 1200.0f) / 127.0f) * this->Max;

Legend:
Removed from v.3611  
changed lines
  Added in v.3612

  ViewVC Help
Powered by ViewVC