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

Diff of /linuxsampler/trunk/src/engines/common/PulseLFO.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 31  namespace LinuxSampler { Line 31  namespace LinuxSampler {
31       * This is a pulse Low Frequency Oscillator which uses pure integer       * This is a pulse Low Frequency Oscillator which uses pure integer
32       * math (without branches) to synthesize the pulse wave.       * math (without branches) to synthesize the pulse wave.
33       */       */
34      template<range_type_t RANGE, int WIDTH /* in permilles */>      template<LFO::range_type_t RANGE, int WIDTH /* in permilles */>
35      class PulseLFO : public LFOBase<RANGE> {      class PulseLFO : public LFOBase<RANGE> {
36          public:          public:
37    
# Line 50  namespace LinuxSampler { Line 50  namespace LinuxSampler {
50               */               */
51              inline float render() {              inline float render() {
52                  uiLevel += c;                  uiLevel += c;
53                  if (RANGE == range_unsigned)                  if (RANGE == LFO::range_unsigned)
54                      return uiLevel <= width ? normalizer : 0;                      return uiLevel <= width ? normalizer : 0;
55                  else /* signed range */                  else /* signed range */
56                      return uiLevel <= width ? normalizer : -normalizer;                      return uiLevel <= width ? normalizer : -normalizer;
# Line 99  namespace LinuxSampler { Line 99  namespace LinuxSampler {
99                  uiLevel = 0;                  uiLevel = 0;
100              }              }
101                            
102              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) {
103                  trigger(Frequency, InternalDepth, ExtControlDepth, WIDTH / 10.0f, SampleRate);                  trigger(Frequency, InternalDepth, ExtControlDepth, WIDTH / 10.0f, SampleRate);
104              }              }
105                            
# Line 162  namespace LinuxSampler { Line 162  namespace LinuxSampler {
162              float normalizer;              float normalizer;
163      };      };
164            
165      template<range_type_t RANGE>      template<LFO::range_type_t RANGE>
166      class SquareLFO : public PulseLFO<RANGE, 500> {      class SquareLFO : public PulseLFO<RANGE, 500> {
167          public:          public:
168              SquareLFO(float Max) : PulseLFO<RANGE, 500>::PulseLFO(Max) { }              SquareLFO(float Max) : PulseLFO<RANGE, 500>::PulseLFO(Max) { }

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

  ViewVC Help
Powered by ViewVC