HISE Logo Forum
    • Categories
    • Register
    • Login

    FreezeMode Functionality

    Scheduled Pinned Locked Moved General Questions
    9 Posts 4 Posters 286 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.
    • bendursoB
      bendurso
      last edited by

      I love the Freeze Mode function of the Reverb Processor.

      How can I replicate this function (to freeze incoming audio) in ScriptNode? I tried using send and receive nodes, but I keep encountering feedback issues. What I want to achieve is to freeze the audio when pressing a button.

      orangeO HISEnbergH 2 Replies Last reply Reply Quote 0
      • orangeO
        orange @bendurso
        last edited by orange

        @bendurso Maybe this Faust example by @Mighty23

        Link Preview Image
        This is my reverb in FAUST, what do you think?

        @aaronventure import("stdfaust.lib"); // User-controllable parameters decayMs = hslider("Decay[unit:ms][style:knob]", 1000, 100, 10000, 1); preDelayMs = hsl...

        favicon

        Forum (forum.hise.audio)

        develop Branch / XCode 13.1
        macOS Monterey / M1 Max

        bendursoB 1 Reply Last reply Reply Quote 0
        • HISEnbergH
          HISEnberg @bendurso
          last edited by

          @bendurso there's an RNBO effect which does this! Not sure if something exists in scriptnode but it is another case where an audio buffer node would be useful

          1 Reply Last reply Reply Quote 0
          • bendursoB
            bendurso @orange
            last edited by

            @HISEnberg Thanks I will check it.

            @orange Oh yeah, I've been watching this. I was trying only to use the freeze function, but I had bad results.

            Isn't there a way to do it natively in Scriptnode to loop the last 1 or 2 seconds?

            orangeO 1 Reply Last reply Reply Quote 0
            • orangeO
              orange @bendurso
              last edited by orange

              @bendurso said in FreezeMode Functionality:

              Oh yeah, I've been watching this. I was trying only to use the freeze function, but I had bad results.

              Maybe you can keep the decay very short here and just use the freeze parameter in combination with another reverb you like. Use the reverb module before this in the process chain.

              develop Branch / XCode 13.1
              macOS Monterey / M1 Max

              bendursoB 1 Reply Last reply Reply Quote 0
              • bendursoB
                bendurso @orange
                last edited by

                @orange Well, I actually have a series of effects chain before, and I would like to loop/freeze the audio at the end without altering the sound.

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

                  @bendurso
                  The Freeze function in my reverb implementation only affects the delayed signal. If I understand correctly, you're looking for something that repeats the entire signal.

                  If that's the case, the idea would be to start with a tap delay set to 100% wet and feedback just slightly below 1.0. Each tap would play back the sound "stored" in the buffer a defined number of times.

                  Let me know if this captures your intention.

                  Free Party, Free Tekno & Free Software too

                  bendursoB 1 Reply Last reply Reply Quote 0
                  • bendursoB
                    bendurso @Mighty23
                    last edited by

                    @Mighty23 said in FreezeMode Functionality:

                    If that's the case, the idea would be to start with a tap delay set to 100% wet and feedback just slightly below 1.0. Each tap would play back the sound "stored" in the buffer a defined number of times.

                    Mm yeah, something like that could work I think.

                    I was trying to modify (with Claude) your reverb to implement only the freeze function, and I was able to get this:

                    import("stdfaust.lib");
                    
                    // User controls
                    freeze = checkbox("Freeze[style:knob]") : si.smoo;
                    freezeTime = hslider("Freeze Time[unit:s]", 1, 0.1, 2, 0.1);
                    freezeInputMix = hslider("Freeze Input Mix[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
                    
                    // Maximum delay time in samples (2 seconds)
                    maxDelay = int(2 * ma.SR);
                    
                    freezeEffect(x) = x <: (freezeLoop, _) : mixer
                    with {
                        // Create a feedback loop for continuous playback when frozen
                        freezeLoop = (+ : de.delay(maxDelay, int(freezeTime * ma.SR))) ~ (*((freeze)));
                    
                        // Mix between frozen and live input
                        mixer(frozen, live) = (frozen * freeze * freezeInputMix) + 
                                             (live * (1.0 - (freeze * freezeInputMix)));
                    };
                    
                    // Stereo processing - apply freeze effect to both channels
                    process = par(i, 2, freezeEffect);
                    

                    It's functional but the loop is not perfect

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

                      @bendurso
                      What do you think about this?

                      import("stdfaust.lib");
                      
                      declare name "Tap Delay + Freeze mode";
                      declare version "0.1a";
                      
                      process = (_, _) : stereo_delay with {
                          // Global UI group for timing controls
                          timing_group(x) = hgroup("[0]Timing", x);
                          bpm = timing_group(hslider("[0]BPM[style:knob]", 120, 40, 200, 1));
                          subdivision = timing_group(hslider("[1]Note Division[style:knob]", 4, 1, 16, 1));
                          
                          // Global UI group for mix controls
                          mix_group(x) = hgroup("[1]Mix", x);
                          feedback = mix_group(hslider("[0]Feedback[style:knob]", 0.7, 0, 0.95, 0.01));
                          wet_gain = mix_group(hslider("[1]Wet/Dry[style:knob]", 0.5, 0, 1, 0.01));
                          
                          // Freeze controls with smoothing
                          freeze = mix_group(checkbox("[2]Freeze")) : si.smoo;
                          freezeInputMix = mix_group(hslider("[3]Freeze Input Mix[style:knob]", 0.5, 0, 1, 0.01)) : si.smoo;
                          
                          // Calculate timing based on BPM
                          beat_duration = 60.0 / bpm;
                          maxtime = beat_duration * 4;
                          delay_time = beat_duration / subdivision;
                      
                          stereo_delay(l, r) = (dry_l + wet_l, dry_r + wet_r)
                          with {
                              // Dry paths
                              dry_l = l * (1 - wet_gain);
                              dry_r = r * (1 - wet_gain);
                              
                              // Wet paths with delay network
                              wet_l = l * wet_gain : left_delay;
                              wet_r = r * wet_gain : right_delay;
                              
                              // Left and right delay networks
                              left_delay = _ <: tap_process ~ _;
                              right_delay = _ <: tap_process ~ _;
                              
                              // Tap process with freeze
                              tap_process(fb) = de.delay(ma.SR * maxtime, delaylen, processInput) 
                              with {
                                  delaylen = max(1, int(ma.SR * delay_time));
                                  
                                  // Process input based on freeze state
                                  processInput(x) = select2(freeze > 0.5,
                                      x + (fb * feedback),           // Normal operation
                                      fb + (x * freezeInputMix)      // Freeze mode
                                  );
                              };
                          };
                      };
                      

                      Free Party, Free Tekno & Free Software too

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

                      42

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      101.8k

                      Posts