HISE Logo Forum
    • Categories
    • Register
    • Login

    SNEX Distortion parameter not responding to ScriptFX knob connection

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 28 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.
    • T
      the red_1
      last edited by

      i’m working on a DSP project in HISE and I’ve run into a problem I’d like to ask your help with.
      Capture d'écran 2025-11-07 181125.png Capture d'écran 2025-11-07 181420.png
      I have created a SNEX node (dsp_disto) in a “SNEX Shaper” block, with an internal parameter (knob) inside the SNEX node that works correctly — when I turn that knob, the distortion effect responds as intended.
      However, I also created a GUI knob in script_fx1 (knob ID = “1”) and wired it to the SNEX node’s parameter (knob ID = “0”). The wiring shows up correctly in the connection graph, but when I turn the script-FX knob the effect does not respond — the SNEX knob works, but the external GUI knob does not trigger the processing change.

      I suspect the issue might be how the SNEX node is receiving the parameter from the external knob (perhaps through setParameter<0>(…) or other template method). I looked through the HISE forums (for example “Linking parameters to SNEX” discussion) and I saw there are subtle requirements for correctly binding external parameters to SNEX.

      Would you be willing to take a look at the relevant parts of my SNEX code and wiring and perhaps point out what I might be missing? I can provide the SNEX code, screenshots of the wiring in HISE, and any additional details. I greatly appreciate any hints or suggestions you might have.

      Many thanks in advance for your time and help — it would mean a lot.

      SNEX CODE :

      template struct dsp_disto
      {
      SNEX_NODE(dsp_disto);

      float parameter0 = 0.0f;      
      float smoothedValue = 0.0f;  
      
      float getSample(float input)
      {
          float drive = 1.0f + parameter0 * 19.0f;
          float x = input * drive;
          float y = Math.tanh(x);
          return y;
      }
      
      
      template <int P> void setParameter(double v)
      {
          if (P == 0)
              parameter0 = (float)v;
      }
      
      template <typename T> void process(T& data)
      {
      
          smoothedValue += (parameter0 - smoothedValue) * 0.01f;
      
          for (auto ch : data)
          {
              for (auto& s : data.toChannelData(ch))
                  s = getSample(s);
          }
      }
      
      template <typename T> void processFrame(T& data)
      {
          smoothedValue += (parameter0 - smoothedValue) * 0.01f;
      
          for (auto& s : data)
              s = getSample(s);
      }
      
      void reset() {}
      void prepare(PrepareSpecs ps) {}
      void setExternalData(const ExternalData& d, int index) {}
      

      };

      ustkU 2 Replies Last reply Reply Quote 0
      • ustkU
        ustk @the red_1
        last edited by

        @the-red_1 said in SNEX Distortion parameter not responding to ScriptFX knob connection:

        However, I also created a GUI knob in script_fx1

        I think here's your problem. When working with a scriptFX network, you cannot use components inside the scriptFX itself.
        Just create the slider in the interface script, and connect it from either the property editor with processorId and parameterId,
        or within a script callback using

        myScriptFxModule.setAttribute(myScriptFxModule.ParameterName, value);
        

        Hise made me an F5 dude, browser just suffers...

        1 Reply Last reply Reply Quote 0
        • ustkU
          ustk @the red_1
          last edited by

          @the-red_1 there is also a

          DspNetwork.setForwardControlsToParameters(bool shouldForward)
          

          method, but I'm confused on when to use it or not as I never used it myself...

          Hise made me an F5 dude, browser just suffers...

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

          14

          Online

          2.0k

          Users

          12.8k

          Topics

          111.1k

          Posts