#include <freeze_loop_sampler.hpp>
|
| void | prepare (int channels, int capacity, int crossfade) |
| int | channels () const noexcept |
| int | capacity () const noexcept |
| int | available_history () const noexcept |
| bool | frozen () const noexcept |
| int | loop_length () const noexcept |
| std::size_t | retained_bytes () const noexcept |
| void | write (const SampleType *const *in, int n) |
| | Record n frames into the ring (call every block, always).
|
| CaptureResult | try_freeze_recent (int loop_samples) noexcept |
| | Capture exactly the most recent loop_samples frames.
|
| SampleType | loop_sample (int channel, int frame) const noexcept |
| void | freeze (int loop_samples) |
| | Freeze the most recent loop_samples of recorded audio into a seamless loop.
|
| void | release () |
| void | read (SampleType *const *out, int n) |
| | Play the loop into out (frozen only).
|
| void | reset () |
| void | clear_history () noexcept |
| | Invalidate rolling input continuity without changing a captured loop.
|
| std::vector< SampleType > | snapshot () const |
| | Serialize the frozen loop: [channels][loop_len][crossfade][play_pos] then loop_len * channels samples.
|
| bool | restore (const std::vector< SampleType > &blob) |
| | Restore a loop produced by snapshot().
|
◆ CaptureResult
template<typename SampleType = float>
| Enumerator |
|---|
| Success | |
| InvalidLength | |
| InsufficientHistory | |
| ExceedsCapacity | |
◆ available_history()
template<typename SampleType = float>
◆ capacity()
template<typename SampleType = float>
◆ channels()
template<typename SampleType = float>
◆ clear_history()
template<typename SampleType = float>
Invalidate rolling input continuity without changing a captured loop.
State recall uses this after restoring the persistent loop because the pre-recall ring belongs to a different transport history.
◆ freeze()
template<typename SampleType = float>
Freeze the most recent loop_samples of recorded audio into a seamless loop.
Clamped to what the ring can supply.
◆ frozen()
template<typename SampleType = float>
◆ loop_length()
template<typename SampleType = float>
◆ loop_sample()
template<typename SampleType = float>
◆ prepare()
template<typename SampleType = float>
- Parameters
-
| channels | channel count |
| capacity | max samples per channel the record ring holds (must exceed the largest loop + crossfade + a block) |
| crossfade | loop-boundary crossfade length in samples RT contract: prepare(), snapshot(), and restore() allocate or copy variable-size storage and are not audio-thread safe. After prepare(), write(), freeze(), release(), read(), reset(), and accessors are allocation-free for the prepared channel/capacity bounds. |
◆ read()
template<typename SampleType = float>
Play the loop into out (frozen only).
Does nothing if not frozen — the caller passes the live signal through in that case.
◆ release()
template<typename SampleType = float>
◆ reset()
template<typename SampleType = float>
◆ restore()
template<typename SampleType = float>
Restore a loop produced by snapshot().
Returns false on a malformed or channel-mismatched blob without changing the current loop. Not RT-safe.
◆ retained_bytes()
template<typename SampleType = float>
◆ snapshot()
template<typename SampleType = float>
Serialize the frozen loop: [channels][loop_len][crossfade][play_pos] then loop_len * channels samples.
Empty when not frozen. Not RT-safe.
◆ try_freeze_recent()
template<typename SampleType = float>
Capture exactly the most recent loop_samples frames.
Unlike freeze(), this never clamps or pads: callers that own musical timing can reject a gesture without changing the current loop. The prepared ring and loop buffers exchange roles in constant time; the captured region remains circular and the former loop storage becomes an empty rolling history. No transition is baked into the captured region.
◆ write()
template<typename SampleType = float>
Record n frames into the ring (call every block, always).
The documentation for this class was generated from the following file: