Performs the temporal operation specified by m_operation on the input data. Operations modify the temporal characteristics of the data including timing, duration, ordering, and envelope shaping. Supports both in-place and out-of-place transformations based on transformer settings.
80 {
82
86 });
87
89 const auto fi = get_parameter_or<double>("fade_in_ratio", 0.1);
90 const auto fo = get_parameter_or<double>("fade_out_ratio", 0.1);
93 });
94 }
95
97 const auto factor = get_parameter_or<double>("stretch_factor", 1.0);
100 });
101 }
102
104 const auto samples = get_parameter_or<uint32_t>("delay_samples", 1000);
105 const auto fill = get_parameter_or<double>("fill_value", 0.0);
108 });
109 }
110
112 const auto start = get_parameter_or<double>("start_ratio", 0.0);
113 const auto end = get_parameter_or<double>("end_ratio", 1.0);
116 });
117 }
118
120 const auto target = get_parameter_or<size_t>("target_size", size_t { 0 });
121 const auto cubic = get_parameter_or<bool>("use_cubic", false);
122 if (target == 0)
125 std::vector<double> out(target);
126 if (cubic)
128 else
130 return out;
131 });
132 }
133
134 default:
136 }
137 }
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 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.
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.
void reverse(std::span< double > data) noexcept
Reverse temporal order in-place.
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_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...
@ 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.