37template <ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
65 for (
const auto& key : config.
keys) {
113 const auto fi = get_parameter_or<double>(
"fade_in_ratio", 0.1);
114 const auto fo = get_parameter_or<double>(
"fade_out_ratio", 0.1);
121 const auto factor = get_parameter_or<double>(
"stretch_factor", 1.0);
128 const auto samples = get_parameter_or<uint32_t>(
"delay_samples", 1000);
129 const auto fill = get_parameter_or<double>(
"fill_value", 0.0);
136 const auto start = get_parameter_or<double>(
"start_ratio", 0.0);
137 const auto end = get_parameter_or<double>(
"end_ratio", 1.0);
144 const auto target = get_parameter_or<size_t>(
"target_size",
size_t { 0 });
145 const auto cubic = get_parameter_or<bool>(
"use_cubic",
false);
149 std::vector<double>
out(target);
182 if (
name ==
"operation") {
183 if (
auto r = safe_any_cast<TemporalOperation>(
value)) {
187 if (
auto r = safe_any_cast<std::string>(
value)) {
188 if (
auto e = Reflect::string_to_enum_case_insensitive<TemporalOperation>(*r.value)) {
210 template <
typename Func>
215 for (
size_t i = 0; i <
channels.size(); ++i) {
216 if constexpr (std::is_void_v<std::invoke_result_t<Func, std::span<double>>>) {
225 for (
size_t i = 0; i <
channels.size(); ++i)
228 OperationHelper::reconstruct_from_double<InputType>(
m_working_buffer, structure_info));
258 template <
typename T>
262 if (!param.has_value())
263 return default_value;
265 auto result = safe_any_cast<T>(param);
266 return result.value_or(default_value);
280 if constexpr (std::is_same_v<InputType, OutputType>) {
Core::GlobalInputConfig input
std::unordered_map< std::string, std::string > metadata
std::vector< float > * out
output_type convert_result(std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata)
Convert processed double data back to OutputType using metadata and optional callback.
static std::tuple< std::vector< std::span< double > >, DataStructureInfo > extract_structured_double(T &compute_data)
Extract structured double data from Datum container or direct ComputeData with automatic container ha...
std::vector< double > delay(std::span< const double > data, uint32_t delay_samples, double fill_value)
Prepend delay_samples zero-valued (or fill_value) samples, returning a new vector.
std::vector< double > time_stretch(std::span< const double > data, double stretch_factor)
Time-stretch via linear interpolation resampling Fast but alias-naive: no anti-aliasing pre-filter is...
void interpolate_cubic(std::span< const double > src, std::span< double > dst) noexcept
Catmull-Rom cubic interpolation from src into dst (caller sizes dst) Branchless boundary clamping; Ho...
std::vector< double > slice(std::span< const double > data, double start_ratio, double end_ratio)
Extract a contiguous slice by ratio, returning a new vector.
void fade(std::span< double > data, double fade_in_ratio, double fade_out_ratio) noexcept
Apply equal-power (cosine) fade-in then fade-out envelope in-place The cosine taper maintains constan...
void reverse(std::span< double > data) noexcept
Reverse temporal order in-place.
void interpolate_linear(std::span< const double > src, std::span< double > dst) noexcept
Linear interpolation from src into dst (caller sizes dst) Branchless inner loop with precomputed step...
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)
TransformationType
Categories of transformation operations for discovery and organization.
@ TEMPORAL
Time-based transformations (time-stretch, reverse, delay)
TemporalOperation
Specific temporal operations supported.
@ SLICE
Extract temporal slice.
@ TIME_REVERSE
Reverse temporal order.
@ TIME_STRETCH
Change playback speed.
@ DELAY
Add temporal delay.
@ FADE_IN_OUT
Apply fade envelope.
@ INTERPOLATE
Temporal interpolation.
Input/Output container for computation pipeline data flow with structure preservation.