HISE Logo Forum
    • Categories
    • Register
    • Login

    Faust waveshaper

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 326 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.
    • JulesVJ
      JulesV
      last edited by

      Hello everyone

      Here is a faust question.

      I could not run the code below to process with the waveshape equation after peak eq. The output is stereo. What am I missing?

      import("stdfaust.lib");
      
      grp (x) = tgroup("", x);
      
      grp_prefltr (x) = grp(hgroup("WaveShaper", x));
      preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01));
      preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01));
      preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01));
      drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01));
      
      shaper(x,drive) = ma.tanh(10 * drive * x);
      
      
      process = _,_ :
      par(i, 2,
               
               // Pre EQ
               fi.peak_eq(preUpGain,preUpFreq,preUpQ) :
      
               // Distortion
               shaper
      
      )
      ;
      
      DabDabD 1 Reply Last reply Reply Quote 0
      • B
        Ben Catman
        last edited by

        @JulesV said in Faust waveshaper:

        import("stdfaust.lib");

        grp (x) = tgroup("", x);

        grp_prefltr (x) = grp(hgroup("WaveShaper", x));
        preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01));
        preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01));
        preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01));
        drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01));

        shaper(x,drive) = ma.tanh(10 * drive * x);

        process = , :
        par(i, 2,

             // Pre EQ
             fi.peak_eq(preUpGain,preUpFreq,preUpQ) :
        
             // Distortion
             shaper
        

        )
        ;

        not so sure, but would that help you ?

        fi.peak is mono, i GUESS

        import("stdfaust.lib");
        
        grp (x) = tgroup("", x);
        
        grp_prefltr (x) = grp(hgroup("WaveShaper", x));
        preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01));
        preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01));
        preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01));
        drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01));
        
        shaper(x,drive) = ma.tanh(10 * drive * x);
        
        
        process = _,_ :> 
        par(i, 2,
                 
                 // Pre EQ
                 fi.peak_eq(preUpGain,preUpFreq,preUpQ) <:  shaper
        
                 
                 
        
        )
        ;
        
        JulesVJ 1 Reply Last reply Reply Quote 0
        • DabDabD
          DabDab @JulesV
          last edited by

          @JulesV

          fi.peak_eq passes 3 parameters. Lfx,fx,B.
          fi.peak_eq(Lfx,fx,B);
          

          Lfx: level (dB) at fx (boost Lfx>0 or cut Lfx<0)
          fx: peak frequency (Hz)
          B: bandwidth (B) of peak in Hz

          You didn't define them.

          Bollywood Music Producer and Trance Producer.

          JulesVJ 1 Reply Last reply Reply Quote 0
          • JulesVJ
            JulesV @Ben Catman
            last edited by

            @Ben-Catman Thanks for the suggestion. But it didn't work. Also I am using the filter in an array or 2 channels.

            1 Reply Last reply Reply Quote 0
            • B
              Ben Catman
              last edited by

              i tried it myself and with my solution above the waveshaper works, but not the filter. sorry , i am quite sick , so i cant check it on my pc yet

              1 Reply Last reply Reply Quote 1
              • JulesVJ
                JulesV @DabDab
                last edited by

                @DabDab said in Faust waveshaper:

                @JulesV

                fi.peak_eq passes 3 parameters. Lfx,fx,B.
                fi.peak_eq(Lfx,fx,B);
                

                Lfx: level (dB) at fx (boost Lfx>0 or cut Lfx<0)
                fx: peak frequency (Hz)
                B: bandwidth (B) of peak in Hz

                You didn't define them.

                Yes I've already defined them, if you look further down the code you can see it. :)

                fi.peak_eq(preUpGain,preUpFreq,preUpQ)

                DabDabD 1 Reply Last reply Reply Quote 0
                • DabDabD
                  DabDab @JulesV
                  last edited by DabDab

                  @JulesV

                  import("stdfaust.lib");
                  
                  grp (x) = tgroup("PeakEQ", x);
                  
                  //grp_prefltr (x) = grp(hgroup("WaveShaper", x));
                  //preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01));
                  //preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01));
                  //preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01));
                  //drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01));
                  
                  //shaper(x,drive) = ma.tanh(10 * drive * x);
                  
                  
                  B = hslider ( "Level[style:knob]", 0,0,1,0.01);
                  Lfx = hslider ( "BandWidth[style:knob]", 20,0,50,0.1);
                  fx = hslider ( "PeakFreq[style:knob]", 1500,150,2500,1);
                  process = fi.peak_eq(Lfx,fx,B),fi.peak_eq(Lfx,fx,B);
                  
                  

                  I have bypassed Waveshaper. Only Filter. Just a basic example. Now you can mod/add more math functions.

                  Bollywood Music Producer and Trance Producer.

                  1 Reply Last reply Reply Quote 1
                  • JulesVJ
                    JulesV
                    last edited by

                    @DabDab @Ben-Catman Thank you so much

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

                    13

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    102.5k

                    Posts