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

#include <dry_wet_mixer.hpp>

Public Member Functions

void set_mix (SampleType mix)
 Set the mix ratio (0.0 = fully dry, 1.0 = fully wet).
SampleType mix () const
 The ratio most recently requested via set_mix(), which is the ramp target while a ramp is in flight.
SampleType current_mix () const
 The ratio the next sample will actually be mixed at.
void set_ramp_samples (int samples)
 Length of the crossfade applied when set_mix() changes the ratio.
int ramp_samples () const
void set_ramp_time (SampleType seconds, SampleType sample_rate)
 Convenience form of set_ramp_samples() in seconds.
bool is_ramping () const
 True while the ratio is still travelling toward its target.
void set_curve (MixCurve curve)
 Set the mixing curve type.
void set_wet_latency (int samples)
 Set latency in samples for the wet path (compensates dry path delay).
void prepare (int max_channels, int max_block_size)
 Prepare for processing.
void push_dry (const SampleType *const *channels, int num_channels, int num_samples)
 Push dry samples before processing (call before your wet processing).
void mix_wet (SampleType *const *wet_channels, int num_channels, int num_samples)
 Mix dry and wet signals, writing result to wet_channels (in-place).
void reset ()

Member Function Documentation

◆ current_mix()

template<typename SampleType = float>
SampleType pulp::signal::DryWetMixerT< SampleType >::current_mix ( ) const
inline

The ratio the next sample will actually be mixed at.

Equal to mix() once any ramp has settled.

◆ is_ramping()

template<typename SampleType = float>
bool pulp::signal::DryWetMixerT< SampleType >::is_ramping ( ) const
inline

True while the ratio is still travelling toward its target.

◆ mix()

template<typename SampleType = float>
SampleType pulp::signal::DryWetMixerT< SampleType >::mix ( ) const
inline

The ratio most recently requested via set_mix(), which is the ramp target while a ramp is in flight.

◆ mix_wet()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::mix_wet ( SampleType *const * wet_channels,
int num_channels,
int num_samples )
inline

Mix dry and wet signals, writing result to wet_channels (in-place).

◆ prepare()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::prepare ( int max_channels,
int max_block_size )
inline

Prepare for processing.

RT contract: prepare() allocates dry/latency storage and is not audio-thread safe. After prepare(), set_mix(), set_curve(), set_ramp_samples(), set_ramp_time(), push_dry(), mix_wet(), and reset() are allocation-free for num_channels <= max_channels and num_samples <= max_block_size. Calls that exceed the prepared channel/block capacity may grow storage and are non-RT.

prepare() settles any in-flight mix ramp: a ramp does not survive a sample-rate or block-size change.

◆ push_dry()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::push_dry ( const SampleType *const * channels,
int num_channels,
int num_samples )
inline

Push dry samples before processing (call before your wet processing).

◆ ramp_samples()

template<typename SampleType = float>
int pulp::signal::DryWetMixerT< SampleType >::ramp_samples ( ) const
inline

◆ reset()

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

◆ set_curve()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::set_curve ( MixCurve curve)
inline

Set the mixing curve type.

◆ set_mix()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::set_mix ( SampleType mix)
inline

Set the mix ratio (0.0 = fully dry, 1.0 = fully wet).

The ratio reaches its target over the configured ramp length (see set_ramp_samples()). With the default ramp length of 0 the new ratio applies to the whole of the next block.

◆ set_ramp_samples()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::set_ramp_samples ( int samples)
inline

Length of the crossfade applied when set_mix() changes the ratio.

A mix control driven by a knob or by host automation steps at block boundaries; crossfading dry against wet across a stepped ratio is audible as zipper noise. A ramp of a few milliseconds removes it.

0 (the default) keeps the ratio change instantaneous, so the gains are computed once per block. A non-zero ramp computes them per sample until the target is reached, which for the pow()- and trig-based curves is materially more expensive — hence opt-in rather than always-on.

RT contract: allocation-free, safe to call from the audio thread alongside the other setters. Shortening the ramp mid-flight rescales the remaining distance rather than jumping.

◆ set_ramp_time()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::set_ramp_time ( SampleType seconds,
SampleType sample_rate )
inline

Convenience form of set_ramp_samples() in seconds.

◆ set_wet_latency()

template<typename SampleType = float>
void pulp::signal::DryWetMixerT< SampleType >::set_wet_latency ( int samples)
inline

Set latency in samples for the wet path (compensates dry path delay).


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