@@ -23,7 +23,24 @@ bool InstantCore::compatible(const int blocksize) const
2323 return static_cast <size_t >(blocksize) == synthesis_window_size;
2424}
2525
26- void InstantCore::process (const std::span<const float > input, const std::span<float > output)
26+ void InstantCore::dry (const std::span<const float > input, const std::span<float > output)
27+ {
28+ process (input, output, [](std::span<double > x, std::span<double > y)
29+ {
30+ std::copy (x.begin (), x.end (), y.begin ());
31+ });
32+ }
33+
34+ void InstantCore::wet (const std::span<const float > input, const std::span<float > output)
35+ {
36+ process (input, output, [&](std::span<double > x, std::span<double > y)
37+ {
38+ stft_pitch_shift (x, y);
39+ });
40+ }
41+
42+ void InstantCore::process (const std::span<const float > input, const std::span<float > output,
43+ std::function<void (std::span<double > x, std::span<double > y)> callback)
2744{
2845 // shift input buffer
2946 std::copy (
@@ -38,8 +55,8 @@ void InstantCore::process(const std::span<const float> input, const std::span<fl
3855 buffer.input .begin () + analysis_window_size,
3956 transform<float , double >);
4057
41- // apply pitch shifting within the built-in STFT routine
42- stft_pitch_shift (buffer.input , buffer.output );
58+ // start processing
59+ callback (buffer.input , buffer.output );
4360
4461 // copy new output samples back
4562 std::transform (
0 commit comments