#include <realtime_pitch_time_processor.hpp>
Public Member Functions | |
| RealtimePitchTimeProcessorT ()=default | |
| PitchTimePrepareStatus | prepare (double sample_rate, const RealtimePitchTimeConfig &config, std::uint64_t target_max_bytes=kTargetAddressMaximumBytes) |
| RT contract: prepare() allocates and sizes all spectral, smoothing, ring, drain, noise-morphing, and optional sinc-resampling storage; it is not audio-thread safe. | |
| int | latency_samples () const |
| Fixed pipeline delay of process() in realtime_pitch mode. | |
| int | fft_size () const |
| void | set_pitch_semitones (float semitones) |
| void | set_formant_semitones (float semitones) |
| void | set_formant_mode (FormantMode mode) |
| void | set_frozen (bool frozen) |
| Freeze (infinite hold) of the current input moment. | |
| bool | is_frozen () const |
| void | set_time_ratio (float ratio) |
| time_stretch mode only; > 1 lengthens. Takes effect at the next frame. | |
| double | achieved_time_ratio () const |
| Hop-quantized stretch actually applied so far (time_stretch mode). | |
| void | process (const SampleType *const *in, SampleType *const *out, int num_samples) |
| realtime_pitch mode: consume and produce exactly num_samples. | |
| PitchTimeStreamFeedStatus | feed (const SampleType *const *in, int num_samples) |
| time_stretch mode: atomically push one bounded input block. | |
| int | available_stretched () const |
| time_stretch mode: stretched samples ready to read. | |
| int | output_free_space () const |
| Remaining prepared output-ring capacity. | |
| int | input_priming_samples () const |
| Input required before the first final stretched sample can become readable. | |
| int | output_alignment_samples () const |
| int | maximum_stream_output_lag_samples () const noexcept |
| Admission-time causal stream delay bound in output samples for every ratio accepted by set_time_ratio(). | |
| int | samples_until_next_analysis_frame () const noexcept |
| Samples remaining before the next analysis frame completes. | |
| PitchTimeStreamFinalizeStatus | finalize () |
| Seal the finite input stream and advance at most one prepared input block of zero padding. | |
| PitchTimeStreamFinalizePlan | plan_finalize (int max_samples) const noexcept |
| Allocation-free, non-mutating preflight for bounded finalization. | |
| PitchTimeStreamFinalizeStatus | finalize (int max_samples) |
| Bounded finalization variant. | |
| int | read_stretched (SampleType *const *out, int num_samples) |
| time_stretch mode: pop stretched samples (caller respects available_stretched(); excess is zero-filled without advancing). | |
| void | reset () |
|
default |
|
inline |
Hop-quantized stretch actually applied so far (time_stretch mode).
|
inline |
time_stretch mode: stretched samples ready to read.
|
inline |
time_stretch mode: atomically push one bounded input block.
The call accepts all samples or none; a backpressure result leaves every stream counter and DSP state unchanged. Drain output and retry the same block.
|
inline |
|
inline |
Seal the finite input stream and advance at most one prepared input block of zero padding.
Repeat after draining output until complete. The final output count is derived from the same frame map used by the realtime reader, so constant and varying feed schedules produce the same hop-quantized duration. No caller-authored silence is required.
|
inline |
Bounded finalization variant.
Advances no more than max_samples of prepared zero padding, so a driver can stop exactly at the next analysis boundary and update per-frame controls before continuing.
|
inline |
Input required before the first final stretched sample can become readable.
The pull stream itself has no silence prefix: output sample zero is aligned to input sample zero.
|
inline |
|
inline |
Fixed pipeline delay of process() in realtime_pitch mode.
|
inlinenoexcept |
Admission-time causal stream delay bound in output samples for every ratio accepted by set_time_ratio().
A fixed-latency driver may stage by this amount without deriving DSP geometry itself.
|
inline |
|
inline |
Remaining prepared output-ring capacity.
A producer can drain output and retry after feed()/finalize() reports backpressure.
|
inlinenoexcept |
Allocation-free, non-mutating preflight for bounded finalization.
A ready plan is guaranteed admissible until another stream operation mutates the processor. Drivers can therefore resolve a boundary control exactly once only after rejected/terminal work has been ruled out.
|
inline |
RT contract: prepare() allocates and sizes all spectral, smoothing, ring, drain, noise-morphing, and optional sinc-resampling storage; it is not audio-thread safe.
After prepare(), process(), feed(), read_stretched(), reset(), control setters, and accessors are allocation-free for blocks no larger than config.max_block and the prepared channel count. target_max_bytes defaults to the native address limit and may be lowered to validate a narrower deployment target.
|
inline |
realtime_pitch mode: consume and produce exactly num_samples.
|
inline |
time_stretch mode: pop stretched samples (caller respects available_stretched(); excess is zero-filled without advancing).
Returns the number of real stream samples copied.
|
inline |
|
inlinenoexcept |
Samples remaining before the next analysis frame completes.
This is exposed for finite-stream drivers that must apply control changes at analysis boundaries independently of their own feed quantum. Returns zero outside prepared time_stretch mode.
|
inline |
|
inline |
|
inline |
Freeze (infinite hold) of the current input moment.
Held audio remains pitch/formant-controllable: the hold replaces analysis frames at the head of the chain, upstream of phase propagation.
|
inline |
|
inline |
time_stretch mode only; > 1 lengthens. Takes effect at the next frame.