Gin
Loading...
Searching...
No Matches
StepLFO Class Reference

Step sequencer-style LFO with programmable values per step. More...

#include <gin_steplfo.h>

Public Member Functions

 StepLFO ()=default
void setSampleRate (double sr)
void setFreq (float f)
void setNumPoints (int n)
void setPoint (int n, float v)
void reset ()
void noteOn (float phase_=-1.0f)
float process (int numSamples)
float getOutput ()
float getCurrentPhase ()

Detailed Description

Step sequencer-style LFO with programmable values per step.

StepLFO provides a stepped low-frequency oscillator where each step can have an independently programmed value. Unlike smooth LFOs, this creates stepped/ quantized modulation patterns useful for rhythmic effects and sequenced modulation.

Key Features:

  • Configurable number of steps
  • Independent value per step (-1.0 to 1.0)
  • Adjustable frequency (rate)
  • Phase reset on note-on for tempo-synced patterns
  • Constant output per step (no interpolation)

Usage:

StepLFO stepLFO;
stepLFO.setSampleRate(44100.0);
stepLFO.setNumPoints(8); // 8-step sequence
stepLFO.setFreq(2.0f); // 2 Hz (complete cycle every 0.5 seconds)
// Program step values
stepLFO.setPoint(0, 1.0f); // Step 1: max
stepLFO.setPoint(1, 0.5f); // Step 2: half
stepLFO.setPoint(2, 0.0f); // Step 3: center
stepLFO.setPoint(3, -0.5f); // Step 4: negative
stepLFO.setPoint(4, -1.0f); // Step 5: min
stepLFO.setPoint(5, -0.5f);
stepLFO.setPoint(6, 0.0f);
stepLFO.setPoint(7, 0.5f);
stepLFO.noteOn(); // Reset to beginning
// In audio callback
float modValue = stepLFO.process(numSamples);
void setNumPoints(int n)
Definition gin_steplfo.h:65
void noteOn(float phase_=-1.0f)
Definition gin_steplfo.h:74
StepLFO()=default
void setSampleRate(double sr)
Definition gin_steplfo.h:63
float process(int numSamples)
Definition gin_steplfo.h:80
void setFreq(float f)
Definition gin_steplfo.h:64
void setPoint(int n, float v)
Definition gin_steplfo.h:66
See also
MSEG, LFO

Constructor & Destructor Documentation

◆ StepLFO()

StepLFO::StepLFO ( )
default

Member Function Documentation

◆ setSampleRate()

void StepLFO::setSampleRate ( double sr)

◆ setFreq()

void StepLFO::setFreq ( float f)

◆ setNumPoints()

void StepLFO::setNumPoints ( int n)

◆ setPoint()

void StepLFO::setPoint ( int n,
float v )

◆ reset()

void StepLFO::reset ( )

◆ noteOn()

void StepLFO::noteOn ( float phase_ = -1.0f)

◆ process()

float StepLFO::process ( int numSamples)

◆ getOutput()

float StepLFO::getOutput ( )

◆ getCurrentPhase()

float StepLFO::getCurrentPhase ( )

The documentation for this class was generated from the following file: