VCV Rack API v2
Loading...
Searching...
No Matches
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 ()
 

Public Attributes

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

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 

Member Function Documentation

◆ reset()

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

◆ process()

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()

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

Member Data Documentation

◆ s

◆ state

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

Deprecated.

Backward compatible API

◆ []

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

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