Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::ModMatrixT< MaxSlots, SampleType > Struct Template Reference

#include <mod_matrix.hpp>

Classes

struct  Slot
 One routing. More...

Public Member Functions

void clear ()
void clear_slot (int index)
bool set_slot (int index, int source, int dest, SampleType depth, int via=-1)
void evaluate (std::span< const SampleType > sources, std::span< SampleType > dests) const
 Accumulate every active routing into dests.
int active_count () const
 Number of slots currently carrying a routing.

Public Attributes

std::array< Slot, MaxSlots > slots {}

Static Public Attributes

static constexpr int kMaxSlots = MaxSlots

Detailed Description

template<int MaxSlots = 32, typename SampleType = float>
struct pulp::signal::ModMatrixT< MaxSlots, SampleType >
Template Parameters
MaxSlotsrouting capacity. Fixed so the matrix stays POD.

Member Function Documentation

◆ active_count()

template<int MaxSlots = 32, typename SampleType = float>
int pulp::signal::ModMatrixT< MaxSlots, SampleType >::active_count ( ) const
inline

Number of slots currently carrying a routing.

◆ clear()

template<int MaxSlots = 32, typename SampleType = float>
void pulp::signal::ModMatrixT< MaxSlots, SampleType >::clear ( )
inline

◆ clear_slot()

template<int MaxSlots = 32, typename SampleType = float>
void pulp::signal::ModMatrixT< MaxSlots, SampleType >::clear_slot ( int index)
inline

◆ evaluate()

template<int MaxSlots = 32, typename SampleType = float>
void pulp::signal::ModMatrixT< MaxSlots, SampleType >::evaluate ( std::span< const SampleType > sources,
std::span< SampleType > dests ) const
inline

Accumulate every active routing into dests.

dests[d] += sources[s] * depth * (via < 0 ? 1 : sources[via]).

The caller owns dests: zero it (or seed it with the unmodulated base values) before calling, and clamp it in destination units afterwards.

A stale routing left over from a larger source or destination list can never read out of bounds, but the two cases differ deliberately. An out-of-range source or dest skips the slot — the routing has nowhere to come from or go to. An out-of-range via instead leaves the depth unmodulated, because via scales a routing rather than defining it, and silently dropping the whole routing is the worse failure of the two.

◆ set_slot()

template<int MaxSlots = 32, typename SampleType = float>
bool pulp::signal::ModMatrixT< MaxSlots, SampleType >::set_slot ( int index,
int source,
int dest,
SampleType depth,
int via = -1 )
inline
Returns
false if index is out of range; the matrix is unchanged.

Member Data Documentation

◆ kMaxSlots

template<int MaxSlots = 32, typename SampleType = float>
int pulp::signal::ModMatrixT< MaxSlots, SampleType >::kMaxSlots = MaxSlots
staticconstexpr

◆ slots

template<int MaxSlots = 32, typename SampleType = float>
std::array<Slot, MaxSlots> pulp::signal::ModMatrixT< MaxSlots, SampleType >::slots {}

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