Gin
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
GateEffect Class Reference

Rhythmic gate effect with programmable step sequencing. More...

#include <gin_gateeffect.h>

Public Member Functions

 GateEffect ()
 
void setSampleRate (double sr)
 
void reset ()
 
void process (juce::AudioSampleBuffer &buffer, int noteOnSample, int noteOffSample)
 
void setLength (int n)
 
void setFrequency (float f)
 
void setStep (int step, bool l, bool r)
 
void setAttack (float seconds)
 
void setRelease (float seconds)
 
void setMix (float m)
 

Protected Attributes

double sampleRate = 44100.0
 
AnalogADSR adsrL
 
AnalogADSR adsrR
 
juce::Array< boolstepsL
 
juce::Array< boolstepsR
 
float frequency = 0.0f
 
float phase = 0.0f
 
float mix = 1.0f
 
bool triggered = false
 
bool lastLOn = false
 
bool lastROn = false
 

Detailed Description

Rhythmic gate effect with programmable step sequencing.

GateEffect creates rhythmic gating patterns by turning audio on/off in a programmable sequence. Each step can be independently set for left and right channels, allowing for complex rhythmic patterns and stereo effects.

Key Features:

Usage:

gate.setSampleRate(44100.0);
gate.setLength(16); // 16-step sequence
// Create a pattern (1=on, 0=off)
gate.setStep(0, true, true); // Both channels on
gate.setStep(1, false, false); // Both off
gate.setStep(2, true, false); // Left only
gate.setStep(3, false, true); // Right only
// ... set remaining steps
gate.setFrequency(8.0f); // 8 steps per second
gate.setAttack(0.001f); // 1ms attack
gate.setRelease(0.05f); // 50ms release
gate.setMix(1.0f); // 100% wet
// In audio callback
Rhythmic gate effect with programmable step sequencing.
Definition gin_gateeffect.h:57
void setStep(int step, bool l, bool r)
Definition gin_gateeffect.h:141
void setFrequency(float f)
Definition gin_gateeffect.h:136
void process(juce::AudioSampleBuffer &buffer, int noteOnSample, int noteOffSample)
Definition gin_gateeffect.h:85
void setMix(float m)
Definition gin_gateeffect.h:159
void setRelease(float seconds)
Definition gin_gateeffect.h:153
void setAttack(float seconds)
Definition gin_gateeffect.h:147
void setSampleRate(double sr)
Definition gin_gateeffect.h:67
void setLength(int n)
Definition gin_gateeffect.h:130
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
See also
AnalogADSR

Constructor & Destructor Documentation

◆ GateEffect()

GateEffect::GateEffect ( )

Member Function Documentation

◆ setSampleRate()

void GateEffect::setSampleRate ( double  sr)

◆ reset()

void GateEffect::reset ( )

◆ process()

void GateEffect::process ( juce::AudioSampleBuffer &  buffer,
int  noteOnSample,
int  noteOffSample 
)

◆ setLength()

void GateEffect::setLength ( int  n)

References stepsL, and stepsR.

◆ setFrequency()

void GateEffect::setFrequency ( float  f)

References frequency.

◆ setStep()

void GateEffect::setStep ( int  step,
bool  l,
bool  r 
)

References stepsL, and stepsR.

◆ setAttack()

void GateEffect::setAttack ( float  seconds)

References adsrL, adsrR, and AnalogADSR::setAttack().

◆ setRelease()

void GateEffect::setRelease ( float  seconds)

◆ setMix()

void GateEffect::setMix ( float  m)

References mix.

Member Data Documentation

◆ sampleRate

double GateEffect::sampleRate = 44100.0
protected

Referenced by process(), and setSampleRate().

◆ adsrL

AnalogADSR GateEffect::adsrL
protected

◆ adsrR

AnalogADSR GateEffect::adsrR
protected

◆ stepsL

juce::Array<bool> GateEffect::stepsL
protected

Referenced by process(), setLength(), and setStep().

◆ stepsR

juce::Array<bool> GateEffect::stepsR
protected

Referenced by process(), setLength(), and setStep().

◆ frequency

float GateEffect::frequency = 0.0f
protected

Referenced by process(), and setFrequency().

◆ phase

float GateEffect::phase = 0.0f
protected

Referenced by process(), and reset().

◆ mix

float GateEffect::mix = 1.0f
protected

Referenced by process(), and setMix().

◆ triggered

bool GateEffect::triggered = false
protected

Referenced by process(), and reset().

◆ lastLOn

bool GateEffect::lastLOn = false
protected

Referenced by process(), and reset().

◆ lastROn

bool GateEffect::lastROn = false
protected

Referenced by process(), and reset().


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