Offline stretcher. More...
#include <offline_stretch.hpp>
Classes | |
| struct | Window |
| Material-adaptive window/overlap recommendation. More... | |
Public Member Functions | |
| void | prepare (double sample_rate, int channels, const OfflineStretchOptions &sizing={}) |
| Size internal state for channels at sample_rate. | |
| int | channels () const noexcept |
| double | sample_rate () const noexcept |
| double | max_time_ratio () const noexcept |
| double | max_pitch_semitones () const noexcept |
| int | fft_size () const noexcept |
| The STFT window actually in use (0 until prepare() with an override). | |
| bool | process (const SampleType *const *in, long in_frames, SampleType *const *out, long out_frames, const OfflineStretchOptions &opts, std::string *err=nullptr) |
| Render the whole input into the caller-allocated output. | |
Static Public Member Functions | |
| static Window | recommend_window (const SampleType *const *in, long frames, int channels, double sample_rate) |
Offline stretcher.
One instance per concurrent render; not thread-safe for concurrent calls on the SAME instance, but distinct instances are independent (the sampler renders slices on multiple background threads).
|
inlinenoexcept |
|
inlinenoexcept |
The STFT window actually in use (0 until prepare() with an override).
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Size internal state for channels at sample_rate.
Must be called before process(). Allocation happens here, not in process(). sizing fixes the supported range: process() ratios must stay within [1/max_time_ratio, max_time_ratio] and |pitch| within max_pitch_semitones at prepare(). Defaults give a [0.25×, 4×] / ±24 st envelope; pass wider bounds before rendering extreme tempo matches.
|
inline |
Render the whole input into the caller-allocated output.
out_frames MUST equal offline_stretch_output_frames(in_frames, opts.time_ratio). Deinterleaved samples; in/out are arrays of channels() pointers. Returns false (with *err set, if provided) on a contract violation. process()/prepare() allocate scratch and may still throw std::bad_alloc for very long inputs or extreme ratios.
|
inlinestatic |
|
inlinenoexcept |