HISE Logo Forum
    • Categories
    • Register
    • Login

    Free Reverse Delay built in RNBO

    Scheduled Pinned Locked Moved Blog Entries
    8 Posts 6 Posters 556 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • HISEnbergH
      HISEnberg
      last edited by HISEnberg

      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 Delay

      Unfortunatley 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:

      1. 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
      2. 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.
      3. 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).
      dc1d3ea7-7801-4355-8210-3761829f2582-image.png

      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=hOX5eg7QCqM

      I 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):

      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

      @DabDab @udalilprofile @treynterrio

      U M 2 Replies Last reply Reply Quote 10
      • DabDabD
        DabDab
        last edited by

        Thank you so much mate.. A very nice Christmas Gift @HISEnberg

        Bollywood Music Producer and Trance Producer.

        1 Reply Last reply Reply Quote 1
        • U
          udalilprofile @HISEnberg
          last edited by

          @HISEnberg Thank you)))))))) 😊 🤩 😍

          1 Reply Last reply Reply Quote 0
          • M
            Mighty23 @HISEnberg
            last edited by Mighty23

            @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);
            };
            

            Free Party, Free Tekno & Free Software too

            LindonL T 2 Replies Last reply Reply Quote 1
            • LindonL
              Lindon @Mighty23
              last edited by

              @Mighty23 you dont appear o be using cuurrent_sr anywhere..

              HISE Development for hire.
              www.channelrobot.com

              M 1 Reply Last reply Reply Quote 1
              • M
                Mighty23 @Lindon
                last edited by

                @Lindon I edited the code in the previous comment.
                The key is to make the delay time scale with the sample rate.

                Free Party, Free Tekno & Free Software too

                1 Reply Last reply Reply Quote 0
                • T
                  treynterrio @Mighty23
                  last edited by

                  @Mighty23 thank you! what's the process to get 2 channels tried to copy paste the process but it still says only 1 Channel

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    Mighty23 @treynterrio
                    last edited by

                    @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;
                    

                    Free Party, Free Tekno & Free Software too

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    37

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    102.7k

                    Posts