Free Reverse Delay built in RNBO
-
I know some users were asking about a reverse delay so I wanted to share one I implemented in RNBO quite a while back.
Link:
RNBO Reverse DelayUnfortunatley I am away from my Mac at the moment, but I will update this link when I can. If you can't wait there is also build instructions for Mac.
This project contains three folders:
- RnboExport: This is the .cpp .h files created by RNBO when exporting the patch. You will want to drag these into: YourProject/DspNetworks/ThirdPart/src
- ReverseDelay: This is a HISE project. If you are on Windows, after downloading you can go straight ahead and open this project. You will see the reverse delay embedded in a scriptnode network.
- RevDel3.maxpat: This is the Rnbo project itself which you can open inside of MSP/RNBO.
Once you open the project and the Scriptnode there is a little write up about the reverse delay (just make sure to click on the comment box next to the xfader to see it).
Most of the guts of the patch was taken from this generous homie, so shout out to Taylor Brooks for sharing this on Youtube:
https://www.youtube.com/watch?v=hOX5eg7QCqMI recommend watching it and following along if you want to know how the patch works. My patch essentially operates the same but I added processing to make the left and right channels function independently, added a feedback path, and I also tweaked it to create different windowing functions (triangle, Blackmann, Hann, I can't remember the others). You can also tempo sync it in HISE using the tempo sync node, it's easier then trying to do it in RNBO and communicating that to HISE, then to the DAW.
If you are on Mac, you can build it your own. I am not sure if you need a Max MSP license, but I know you DONT need a RNBO license. You will have to install Max MSP though. A RNBO license will allow you to make changes and save the patch, but I am pretty confident you can open and export patches without a license.
All you will need to do is open the RevDel3.maxpat, then follow the steps to export it to a HISE project (I recommend this video):
https://www.youtube.com/watch?v=64dTcwnP40o&t=1s
Hopefully everything is in working order, its been quite some time that I have looked at this project. Let me know if anyone has questions or recommendations, and happy holidays!
Hisenberg
-
Thank you so much mate.. A very nice Christmas Gift @HISEnberg
-
@HISEnberg Thank you)))))))) 🤩
-
@HISEnberg
I just started a reverse delay idea myself. Since the post was looking for both RNBO and FAUST solutions, here is my implementation:import("stdfaust.lib"); MAX_DELAY = 192000; // Support up to 192kHz // Create phase-shifted phasor for reverse reading only the delayed signal phasor_phase(dtime, phase) = ((os.lf_rawsaw(dtime) + phase) % dtime) : int; phasor(dtime, phase) = phasor_phase(dtime*2, phase) <: <=(dtime), (*(-1) + dtime*2), _ : select2; // Main processing process = _ <: direct, delayed_and_reversed :> _ with { // Get current sample rate for scaling current_sr = ma.SR; // Controls - scale the delay time based on current sample rate delay_base = hslider("Delay Time[style:knob]", 0.5, 0.02, 1, 0.01); // 0-1 range delay_time = min(MAX_DELAY-1, delay_base * current_sr); // Scale to current sample rate dry_wet = hslider("Dry/Wet[style:knob]", 0.5, 0, 1, 0.01); // Direct path direct = *(1-dry_wet); // First delay the signal delayed = de.delay(MAX_DELAY, delay_time); // Then reverse the delayed signal reversed = rwtable(MAX_DELAY, 0.0, phasor(delay_time, 0) : int, // Write the delayed signal _, // Input from delay phasor(delay_time, delay_time/2) : int // Read reversed ); delayed_and_reversed = delayed : reversed : *(dry_wet); };
-
@Mighty23 you dont appear o be using cuurrent_sr anywhere..
-
@Lindon I edited the code in the previous comment.
The key is to make the delay time scale with the sample rate. -
@Mighty23 thank you! what's the process to get 2 channels tried to copy paste the process but it still says only 1 Channel
-
@treynterrio you can use this code if you have 2 inputs and 2 outputs or use the previous one if you have one input and one output.
The first code you can use in scriptnode in case you need to process, for example, mid and side separately.
import("stdfaust.lib"); MAX_DELAY = 192000; // Phase-shifted phasor for reverse reading // dtime: delay time in samples // phase: phase offset for reading position phasor_phase(dtime, phase) = ((os.lf_rawsaw(dtime) + phase) % dtime) : int; phasor(dtime, phase) = phasor_phase(dtime*2, phase) <: <=(dtime), (*(-1) + dtime*2), _ : select2; // Single channel reverse delay processing reverse_delay = _ <: direct, delayed_and_reversed :> _ with { // Get current sample rate for scaling controls current_sr = ma.SR; // User controls with sample rate scaling delay_base = hslider("Delay Time[style:knob]", 0.5, 0.02, 1, 0.01); delay_time = min(MAX_DELAY-1, delay_base * current_sr); dry_wet = hslider("Dry/Wet[style:knob]", 0.5, 0, 1, 0.01); // Direct path with gain direct = *(1-dry_wet); // Delay into reverse buffer implementation delayed = de.delay(MAX_DELAY, delay_time); // Reverse buffer using rwtable reversed = rwtable(MAX_DELAY, 0.0, phasor(delay_time, 0) : int, // Write index _, // Input signal phasor(delay_time, delay_time/2) : int // Read index ); // Process delayed signal through reverse buffer with gain delayed_and_reversed = delayed : reversed : *(dry_wet); }; // Main stereo processing - apply reverse_delay to each channel independently process = reverse_delay, reverse_delay;