MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ rising_toggle()

MAYAFLUX_API bool MayaFlux::Kinesis::Discrete::rising_toggle ( double  input,
std::span< double >  coefs 
)
noexcept

Flip-flop: the output inverts on every rise of the input.

coefs: [threshold, latched, state]. Divide by two with a half-rate square wave out.

Definition at line 94 of file Boolean.cpp.

95{
96 if (coefs.size() < 3)
97 return false;
98
99 if (rises(input > coefs[0], coefs[1]))
100 coefs[2] = coefs[2] > 0.5 ? 0.0 : 1.0;
101 return coefs[2] > 0.5;
102}
Core::GlobalInputConfig input
Definition Config.cpp:42

References input.