Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::drum::ClickLayer Class Reference

The transient: a burst of noise through a lowpass, decaying in a few milliseconds. More...

#include <layers.hpp>

Public Member Functions

void prepare (double sample_rate)
void reset ()
void set_level (double level)
void set_cutoff_hz (double hz)
void set_decay_ms (double ms)
double level () const
double cutoff_hz () const
void trigger (double brightness=1.0)
 Starts a click.
bool is_active () const
 A silent layer is never active.
double process (double noise)
 Next sample. noise is a raw white sample from the voice's generator.

Detailed Description

The transient: a burst of noise through a lowpass, decaying in a few milliseconds.

Every percussion voice has one, and it is always built the same way, because a strike is broadband and short and a one-pole is what turns that into a specific-sounding strike. The cutoff is the interesting control, not the level: lowering it turns a beater tick into a thump and a rimshot into a body hit, whereas turning the level down just makes the same tick quieter. That is why velocity brightens the click here rather than only scaling it.

The layer does not own its noise generator. Voices share one generator across their layers so a hit reseeds once and stays reproducible; giving each layer its own would mean each hit's layers were correlated with each other in a way that changes with the layer count.

RT contract: prepare() allocates nothing; trigger() and process() allocate nothing and take no locks.

Member Function Documentation

◆ cutoff_hz()

double pulp::signal::drum::ClickLayer::cutoff_hz ( ) const
inline

◆ is_active()

bool pulp::signal::drum::ClickLayer::is_active ( ) const
inline

A silent layer is never active.

Both halves matter: without the level term a layer whose level is zero would report itself active forever, because process() returns early and so never advances the envelope that would eventually clear the flag – and a voice built from layers would then never finish and never leave the CPU.

◆ level()

double pulp::signal::drum::ClickLayer::level ( ) const
inline

◆ prepare()

void pulp::signal::drum::ClickLayer::prepare ( double sample_rate)
inline

◆ process()

double pulp::signal::drum::ClickLayer::process ( double noise)
inline

Next sample. noise is a raw white sample from the voice's generator.

◆ reset()

void pulp::signal::drum::ClickLayer::reset ( )
inline

◆ set_cutoff_hz()

void pulp::signal::drum::ClickLayer::set_cutoff_hz ( double hz)
inline

◆ set_decay_ms()

void pulp::signal::drum::ClickLayer::set_decay_ms ( double ms)
inline

◆ set_level()

void pulp::signal::drum::ClickLayer::set_level ( double level)
inline

◆ trigger()

void pulp::signal::drum::ClickLayer::trigger ( double brightness = 1.0)
inline

Starts a click.

brightness multiplies the cutoff, which is how velocity reaches this layer's timbre.


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