|
Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
|
A monotonic time-warp mapping from source samples to output samples. More...
#include <src/dsp/time_warp_map.h>
Public Member Functions | |
| bool | is_valid () const noexcept |
| Validates the invariants of a well-formed warp map. | |
Data Fields | |
| std::vector< WarpAnchor > | anchors |
| units::sample_t | source_length {} |
| Total source frames (length of the input clip). | |
| units::sample_t | output_length {} |
| Total output frames (length of the stretched result). | |
A monotonic time-warp mapping from source samples to output samples.
This is the single input consumed by every time-stretch engine, regardless of how the mapping was produced (the tempo map for auto-timestretch, or in future user-defined warp markers). Keeping the map in the sample domain means engines never need to know about tempo maps or musical time.
Anchors must be sorted ascending by WarpAnchor::source_frame and strictly increasing in WarpAnchor::output_frame. The first anchor must map 0 → 0 and the last must map source_length → output_length.
Definition at line 42 of file time_warp_map.h.
|
nodiscardnoexcept |
Validates the invariants of a well-formed warp map.
Checks that anchors are non-empty, sorted ascending by source frame, strictly increasing in output frame, and that the endpoints match source_length and output_length (both of which must be positive).
| std::vector<WarpAnchor> zrythm::dsp::TimeWarpMap::anchors |
Definition at line 44 of file time_warp_map.h.
| units::sample_t zrythm::dsp::TimeWarpMap::output_length {} |
Total output frames (length of the stretched result).
Definition at line 50 of file time_warp_map.h.
| units::sample_t zrythm::dsp::TimeWarpMap::source_length {} |
Total source frames (length of the input clip).
Definition at line 47 of file time_warp_map.h.