HISE Logo Forum
    • Categories
    • Register
    • Login

    Faust Gate

    Scheduled Pinned Locked Moved Faust Development
    8 Posts 3 Posters 155 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.
    • resonantR
      resonant
      last edited by

      I'm trying to use the Gate library here, what's the mistake here?

      import("stdfaust.lib");
      
      thresh = hslider("Threshold [dB]", -40, -80, 0, 0.1) : ba.db2linear;
      att    = hslider("Attack [ms]", 10, 0, 100, 1) : si.smoo;
      rel   = hslider("Release [ms]", 100, 10, 500, 1) : si.smoo;
      hold    = hslider("Hold [ms]", 10, 0, 100, 1) : si.smoo;
      
      process = _,_ : gate_stereo(thresh,att,hold,rel) : _,_;
      
      

      Link Preview Image
      misceffects - Faust Libraries

      favicon

      (faustlibraries.grame.fr)

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @resonant
        last edited by

        @resonant what error are you getting?

        you might want to try

        process = _,_ : ef.gate_stereo(thresh,att,hold,rel) : _,_;
        

        HISE Development for hire.
        www.channelrobot.com

        resonantR 1 Reply Last reply Reply Quote 1
        • resonantR
          resonant @Lindon
          last edited by resonant

          @Lindon said in Faust Gate:

          @resonant what error are you getting?

          you might want to try

          process = _,_ : ef.gate_stereo(thresh,att,hold,rel) : _,_;
          

          thanks

          1 Reply Last reply Reply Quote 0
          • resonantR
            resonant
            last edited by

            Am I the only one experiencing Standard Faust Gate does not work?

            import("stdfaust.lib");
            
            thresh = hslider("Threshold [dB]", -40, -80, 0, 0.1) : ba.db2linear;
            att    = hslider("Attack [ms]", 10, 0, 100, 1) : si.smoo;
            hold    = hslider("Hold [ms]", 10, 0, 100, 1) : si.smoo;
            rel   = hslider("Release [ms]", 100, 10, 500, 1) : si.smoo;
            
            process = _,_ : ef.gate_stereo(thresh,att,hold,rel) : _,_;
            
            
            M 1 Reply Last reply Reply Quote 0
            • M
              Mighty23 @resonant
              last edited by

              @resonant I haven't tried your script yet, but if you want, I'll leave you my gate in Faust in the meantime. It's still under development, but maybe it could help you put a temporary "patch" on it.

              //-----------------------------------------------
              // High-Gain Guitar Noise Gate (Zuul-inspired)
              // Designed for metal and djent applications
              //-----------------------------------------------
              
              declare name        "Zuul-like Gate";
              declare version     "0.1";
              declare description "High-gain guitar noise gate with sidechain input";
              
              import("stdfaust.lib");
              
              // UI section with all requested parameters
              //-----------------------------------------------
              threshold_db = hslider("threshold[unit:dB]", -40, -80, 0, 0.1) : si.smoo;
              attack_ms = hslider("attack[unit:ms]", 0.1, 0.01, 10, 0.01) : si.smoo;
              hold_ms = hslider("hold[unit:ms]", 50, 0, 500, 1) : si.smoo;
              release_ms = hslider("release[unit:ms]", 100, 10, 1000, 1) : si.smoo;
              hysteresis_db = hslider("hysteresis[unit:dB][tooltip:Amount below threshold before gate closes]", 6, 0, 12, 0.1) : si.smoo;
              key_switch = checkbox("key_input [tooltip:Use right channel as sidechain when ON]") : si.smoo;
              
              // Simple hysteresis implementation
              hysteresis(lower, upper, x) = y
              letrec {
                  'y = (x > upper) | (y & (x > lower));
              };
              
              // Process section - main function implementation
              //-----------------------------------------------
              process(audio_left, audio_right) = audio_left * gate_env, audio_right * gate_env
              with {
                  // Convert time parameters to seconds
                  attack = attack_ms * 0.001;
                  release = release_ms * 0.001;
                  hold_time = hold_ms * 0.001;
                  
                  // Threshold conversion from dB to linear scale
                  threshold = ba.db2linear(threshold_db);
                  lower_threshold = ba.db2linear(threshold_db - hysteresis_db);
                  
                  // Select between main input (audio_left) and sidechain input (audio_right)
                  // When key_switch is off, use audio_left for detection
                  // When key_switch is on, use audio_right as sidechain input
                  detection_input = select2(key_switch, audio_left, audio_right);
                  
                  // Envelope detection for detection input
                  env = abs(detection_input) : si.smooth(ba.tau2pole(0.001));
                  
                  // Gate triggering with hysteresis
                  gate = hysteresis(lower_threshold, threshold, env);
                  
                  // Hold circuit using peakholder
                  hold_samples = int(hold_time * ma.SR);
                  gate_with_hold = gate : ba.peakholder(hold_samples);
                  
                  // Create envelope for smooth transitions
                  gate_env = gate_with_hold : en.asr(attack, 1.0, release);
              };
              

              Free Party, Free Tekno & Free Software too

              resonantR 1 Reply Last reply Reply Quote 1
              • resonantR
                resonant @Mighty23
                last edited by

                @Mighty23 Thank you, it sounds good.

                Is there a possibility to add modulation to this like below?

                Screen Shot 2025-08-01 at 14.29.25.png

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

                  @resonant said in Faust Gate:

                  Is there a possibility to add modulation to this like below?

                  From FAUST documentation: https://faustdoc.grame.fr/manual/syntax/index.html#faust-syntax
                  "The vbargraph primitive implements a vertical bargraph (typically a meter displaying the level of a signal)."

                  I'm not absolutely sure, I would try with a FAUST vbargraph primitive to "visualize the effect" and then connect it to a scriptnode node; like in:
                  https://forum.hise.audio/topic/10619/gain-reduction-meter-on-a-faust-compressor?_=1754048833174

                  Free Party, Free Tekno & Free Software too

                  resonantR 1 Reply Last reply Reply Quote 1
                  • resonantR
                    resonant @Mighty23
                    last edited by

                    @Mighty23

                    Thank you for the explanation. I don't mean a graphic, but a modulation like the one in the image below. Not separate Right and Left, but a single one (like the scriptnode gate, comp...etc.).

                    alt text

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

                    32

                    Online

                    1.9k

                    Users

                    12.2k

                    Topics

                    106.5k

                    Posts