Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::GateLogicT< SampleType > Class Template Reference

Combinational logic on gate signals. More...

#include <gate_logic.hpp>

Public Member Functions

void prepare (double)
void set_op (GateOp op)
GateOp op () const
void apply_reset_edge ()
void reset ()
bool process (bool a, bool b) const
bool process (const bool *gates, int count) const
 N-input form.
SampleType process_levels (SampleType a, SampleType b) const
 Level-domain form: thresholds both inputs and returns 0 or 1.

Static Public Member Functions

static constexpr int latency_samples ()

Static Public Attributes

static constexpr double kLevelThreshold = kTriggerHighThreshold
 Level above which an input counts as high in the level-domain overload.

Detailed Description

template<typename SampleType = float>
class pulp::signal::GateLogicT< SampleType >

Combinational logic on gate signals.

Genuinely stateless — a transport reset is a no-op, because there is nothing to reset. That is why the level-domain overload compares against a plain threshold rather than running each input through a TriggerDetectT: hysteresis is memory, and memory in a combinational block would make its output depend on the order inputs happened to arrive in.

The N-input form applies the base operation across all inputs and inverts for the negated variants — nand is not (a and b and c…), xnor is the complement of parity — rather than folding the two-input operation pairwise, which for the negated ops would not be associative and would make the answer depend on argument order.

USE. and two clocks for an only-on-coincidence gate; xor two divided clocks for a composite rhythm busier than either; or to merge two gate streams. Three ClockDividerT (kit) taps at ÷2/÷3/÷5 through a tree of these is a dense polymetric pattern from one master clock and zero randomness.

RT contract: pure arithmetic, no state, no allocation.

Member Function Documentation

◆ apply_reset_edge()

template<typename SampleType = float>
void pulp::signal::GateLogicT< SampleType >::apply_reset_edge ( )
inline

◆ latency_samples()

template<typename SampleType = float>
constexpr int pulp::signal::GateLogicT< SampleType >::latency_samples ( )
inlinestaticconstexpr

◆ op()

template<typename SampleType = float>
GateOp pulp::signal::GateLogicT< SampleType >::op ( ) const
inline

◆ prepare()

template<typename SampleType = float>
void pulp::signal::GateLogicT< SampleType >::prepare ( double )
inline

◆ process() [1/2]

template<typename SampleType = float>
bool pulp::signal::GateLogicT< SampleType >::process ( bool a,
bool b ) const
inline

◆ process() [2/2]

template<typename SampleType = float>
bool pulp::signal::GateLogicT< SampleType >::process ( const bool * gates,
int count ) const
inline

N-input form.

An empty input list returns the operation's identity, so a tree that loses a branch degrades predictably instead of returning false for everything.

◆ process_levels()

template<typename SampleType = float>
SampleType pulp::signal::GateLogicT< SampleType >::process_levels ( SampleType a,
SampleType b ) const
inline

Level-domain form: thresholds both inputs and returns 0 or 1.

◆ reset()

template<typename SampleType = float>
void pulp::signal::GateLogicT< SampleType >::reset ( )
inline

◆ set_op()

template<typename SampleType = float>
void pulp::signal::GateLogicT< SampleType >::set_op ( GateOp op)
inline

Member Data Documentation

◆ kLevelThreshold

template<typename SampleType = float>
double pulp::signal::GateLogicT< SampleType >::kLevelThreshold = kTriggerHighThreshold
staticconstexpr

Level above which an input counts as high in the level-domain overload.

Matches the kit's rising threshold so a gate that opens a TriggerDetectT also reads high here. [design parameter] default kTriggerHighThreshold (0.5), range 0.01 .. 2.5.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/gate_logic.hpp