Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
crossfade.hpp File Reference

Audio crossfades: equal-power per value, and constant-mix over a buffer. More...

Detailed Description

Audio crossfades: equal-power per value, and constant-mix over a buffer.

The linear blend and smooth step are domain-neutral and live in <sbl/math/interpolate.hpp>.

Definition in file crossfade.hpp.

#include <cmath>
#include <cstdint>
#include <sbl/math/clamp.hpp>
#include <sbl/math/constants.hpp>

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::dsp
 The audio stack.
 
namespace  sbl::dsp::math
 Math for the audio stack.
 

Functions

float sbl::dsp::math::crossfade_equal_power (float a, float b, float t)
 Equal-power crossfade between two values.
 
void sbl::dsp::math::crossfade_gains_equal_power (float t, float end_zone, float &gain_a, float &gain_b)
 Equal-power gains for a crossfade with a zone at each end.
 
void sbl::dsp::math::crossfade (const float *a, const float *b, float *out, float mix, uint16_t frames)
 Linear crossfade over a buffer with constant mix.
 
void sbl::dsp::math::crossfade_equal_power (const float *a, const float *b, float *out, float mix, uint16_t frames)
 Equal-power crossfade over a buffer with constant mix.