|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <pan.hpp>
Public Member Functions | |
| Pan () | |
| void | set_position_su (float su) |
| Set pan position. Port — accepts normalized [0,1] signal. | |
| void | process (const float *in, float *out_l, float *out_r, uint16_t n) |
| Apply panning to a mono input, writing to stereo output buffers. | |
| void | process (float *buf_l, float *buf_r, uint16_t n) |
| Apply panning in-place to a stereo pair (scales existing L/R). | |
| float | position () const |
| Current smoothed position [0,1]. | |
| void | reset () |
| Reset smoother to center (0.5) | |
| void | reset (float position) |
| Reset smoother to a specific position. | |
|
inline |
Definition at line 31 of file pan.hpp.
References sbl::dsp::primitives::ParameterSmoother::reset(), sbl::dsp::types::SAMPLE_RATE_F, and sbl::dsp::primitives::ParameterSmoother::set_time_ms().
|
inline |
Set pan position. Port — accepts normalized [0,1] signal.
0.0 = hard left, 0.5 = center, 1.0 = hard right. Input is clamped to [0,1]. Smoothing is applied per-sample in process().
| su | Pan position in normalized units |
Definition at line 44 of file pan.hpp.
Referenced by sbl::dsp::widgets::Channel< MaxFrames, MaxSends >::set_pan_su().
|
inline |
Apply panning to a mono input, writing to stereo output buffers.
Output buffers are overwritten (= semantics, not +=). For accumulating multiple sources, use sbl::dsp::stereo::pan_mix().
| in | Mono input buffer |
| out_l | Left output buffer (overwritten) |
| out_r | Right output buffer (overwritten) |
| n | Number of samples |
Definition at line 61 of file pan.hpp.
References sbl::dsp::stereo::constant_power(), and sbl::dsp::primitives::ParameterSmoother::process().
Referenced by sbl::dsp::widgets::Channel< MaxFrames, MaxSends >::process().
|
inline |
Apply panning in-place to a stereo pair (scales existing L/R).
Multiplies existing left samples by the left pan gain and right samples by the right pan gain. Useful for adjusting stereo balance of an already-stereo signal.
| buf_l | Left buffer (modified in-place) |
| buf_r | Right buffer (modified in-place) |
| n | Number of samples |
Definition at line 81 of file pan.hpp.
References sbl::dsp::stereo::constant_power(), and sbl::dsp::primitives::ParameterSmoother::process().
|
inline |
Current smoothed position [0,1].
Definition at line 94 of file pan.hpp.
References sbl::dsp::primitives::ParameterSmoother::value().
Referenced by reset().
|
inline |
Reset smoother to center (0.5)
Definition at line 97 of file pan.hpp.
References sbl::dsp::primitives::ParameterSmoother::reset().
|
inline |
Reset smoother to a specific position.
Definition at line 103 of file pan.hpp.
References position(), and sbl::dsp::primitives::ParameterSmoother::reset().