Loading [MathJax]/extensions/tex2jax.js
VCV Rack API v2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rack::dsp::TSchmittTrigger< float > Struct Reference

#include <digital.hpp>

Collaboration diagram for rack::dsp::TSchmittTrigger< float >:
[legend]

Public Types

enum  State : uint8_t { LOW , HIGH , UNINITIALIZED }
 
enum  Event { NONE = 0 , TRIGGERED = 1 , UNTRIGGERED = -1 }
 

Public Member Functions

void reset ()
 
bool process (float in, float lowThreshold=0.f, float highThreshold=1.f)
 Updates the state of the Schmitt Trigger given a value.
 
Event processEvent (float in, float lowThreshold=0.f, float highThreshold=1.f)
 Returns TRIGGERED if the input reached highThreshold, and UNTRIGGERED if the input reached lowThreshold.
 
bool isHigh ()
 
 TSchmittTrigger ()
 
void reset ()
 
float process (float in, float lowThreshold=0.f, float highThreshold=1.f)
 
float isHigh ()
 

Public Attributes

union rack::dsp::TSchmittTrigger< float >:: { ... }  
 
float state
 

Member Enumeration Documentation

◆ State

enum rack::dsp::TSchmittTrigger< float >::State : uint8_t
Enumerator
LOW 
HIGH 
UNINITIALIZED 

◆ Event

enum rack::dsp::TSchmittTrigger< float >::Event
Enumerator
NONE 
TRIGGERED 
UNTRIGGERED 

Constructor & Destructor Documentation

◆ TSchmittTrigger()

rack::dsp::TSchmittTrigger< float >::TSchmittTrigger ( )
inline

Member Function Documentation

◆ reset() [1/2]

void rack::dsp::TSchmittTrigger< float >::reset ( )
inline

◆ process() [1/2]

bool rack::dsp::TSchmittTrigger< float >::process ( float in,
float lowThreshold = 0.f,
float highThreshold = 1.f )
inline

Updates the state of the Schmitt Trigger given a value.

Returns true if triggered, i.e. the value increases from 0 to 1. If different trigger thresholds are needed, use

process(in, 0.1f, 2.f)

for example.

◆ processEvent()

Event rack::dsp::TSchmittTrigger< float >::processEvent ( float in,
float lowThreshold = 0.f,
float highThreshold = 1.f )
inline

Returns TRIGGERED if the input reached highThreshold, and UNTRIGGERED if the input reached lowThreshold.

◆ isHigh() [1/2]

bool rack::dsp::TSchmittTrigger< float >::isHigh ( )
inline

◆ reset() [2/2]

void rack::dsp::TSchmittTrigger< float >::reset ( )
inline

◆ process() [2/2]

float rack::dsp::TSchmittTrigger< float >::process ( float in,
float lowThreshold = 0.f,
float highThreshold = 1.f )
inline

◆ isHigh() [2/2]

float rack::dsp::TSchmittTrigger< float >::isHigh ( )
inline

Member Data Documentation

◆ s

◆ state [1/2]

bool rack::dsp::TSchmittTrigger< float >::state

Deprecated.

Backward compatible API

◆ []

union rack::dsp::TSchmittTrigger< float > { ... } rack::dsp::TSchmittTrigger< float >

◆ state [2/2]

float rack::dsp::TSchmittTrigger< float >::state

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