Open ghost opened 3 years ago
Thanks for sharing, yeah this looks super useful! I'd love to integrate the delay line and interpolation code into what I've already got in this repo, so it may take a little time to work out exactly how to integrate everything, but I do plan to do it.
Thanks, Jatin
I don't know if you've already have this idea ? Long time ago, I've work on my own implementation of a waveguide (bi-directional, / multi-dimensionnal) that is an extension of the Julis Orion Smith historical implementation. It's not very modern but it's efficient and extensible. The code is not framework ready but that can be a starting point if you want to integration this kind of feature in your framework.
The main class is
waveguide.hpp
and consist of a multi-dimensionnal bi-directional two-rails (delaylines) with random access and two terminations :the
delay.hpp
is a simple old-school shared aligned memory with moving-head-pointer, the code include the well-know crossfade-trick that allow fast & click-free resize of the delay as experimental feature (fixed period / samplerate in constructor).the
lagrange.hpp
is a underrated technique of interpolation/deinterpolation that allow the random access over the delay line at any fractional point. This is a N-order Lagrange Interpolation based on faust code with some trick from some scientific litterature. Default is 5th order initialized by the template parameters.the
pointer.hpp
is a naive implementation of a bidirectional moving pointer allowing to selected the 'true' propagation direction. This is the most efficient way to simulate signal move inside a delay-line and this is a special case (bidirectional) for me to keep the code logical and coherent with the theory.the
crossfade.hpp
is using to state-crossfader moving around a lookup-table of a S-shape curve (sigmoid) and is used for the 'legato' trick.To finish a
memory.hpp
helpers is here to workaround the aligned_memory for microsoft visual studio compiler. Don't know if it's always pertinent since latest VS2019 version includes the std::aligned_memory method.Now, how to use the classes ? The most simples example is the JOS digital waveguide example (
string.hpp
) that is a simple bidirectional waveguide with a simple one-pole lowpass at right termination.And this is a very basic code to use it (
main.cpp
):OK, this is a old code that take dust in my hard-drive since long date. I hope that will inspire you, at least for future plugins, at best for a rewrite and an inclusion in your framework. In any case, it's shared and it makes me happy.
Sincerely, Max