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
interpolate.hpp File Reference

Interpolation: linear blend, smooth step, integer blend. More...

Detailed Description

Interpolation: linear blend, smooth step, integer blend.

float mix = sbl::math::crossfade(a, b, 0.5f); // halfway from a to b
float s = sbl::math::smooth_step(t); // S-curve on [0, 1]
constexpr float crossfade(float a, float b, float t)
Linear crossfade between two values.
constexpr float smooth_step(float t)
Hermite smooth step (3rd-order S-curve)

Definition in file interpolate.hpp.

#include <cstdint>
#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::math
 Domain-neutral math: constants, clamp, interpolation.
 

Functions

constexpr float sbl::math::crossfade (float a, float b, float t)
 Linear crossfade between two values.
 
constexpr float sbl::math::smooth_step (float t)
 Hermite smooth step (3rd-order S-curve)
 
constexpr int32_t sbl::math::crossfade_i16 (int16_t a, int16_t b, uint16_t t)
 Integer crossfade for 16-bit values.