HISE Logo Forum
    • Categories
    • Register
    • Login

    Sinefold distortion

    Scheduled Pinned Locked Moved Faust Development
    2 Posts 2 Posters 108 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.
    • X
      xander
      last edited by

      For anyone who wants it.
      Here is a simple sinefold distortion, with a hardclip threshold

      //Xander'
      import("stdfaust.lib");
      
      //sinefold function
      distortion(x) = aa.sine(strength * x) 
      with {
      	strength = hslider("strength", 1, 1,100,0.01) : si.smooth(0.999);
      };
      
      //clip function
      clip = min(thresh_linear) : max(0 - thresh_linear)
      with {
      	threshold = hslider("threshold", -0.3, -100,0, 0.01) : si.smooth(0.999);
      	thresh_linear = pow(10, threshold/ 20);
      }; 
      
      //variable for individual input, including effect and input and output gain
      stereo = *(pregain_linear) : (distortion : clip) * postgain_linear
      with {
      
      	pregain = hslider("pregain", 1, -100,20,0.01) : si.smooth(0.999);
      	pregain_linear = ba.db2linear(pregain);
      
      	postgain = hslider("postgain", 0, -100,20,0.01) : si.smooth(0.999);
      	postgain_linear = ba.db2linear(postgain);
      };
      
      process = stereo, stereo;
      
      LindonL 1 Reply Last reply Reply Quote 4
      • LindonL
        Lindon @xander
        last edited by

        @xander maybe put this in the HISE Faust github?

        HISE Development for hire.
        www.channelrobot.com

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

        60

        Online

        1.7k

        Users

        11.7k

        Topics

        102.1k

        Posts