HISE Logo Forum
    • Categories
    • Register
    • Login

    Real time pitch shifting with ScriptNode

    Scheduled Pinned Locked Moved ScriptNode
    12 Posts 6 Posters 243 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.
    • A
      aaronventure @FPSzky
      last edited by

      @FPSzky use faust

      Theres this https://github.com/azur1s/elysiera/blob/main/

      And this https://github.com/thedrgreenthumb/faust/blob/master/shimmer.dsp

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

        @aaronventure
        If some external codes are embedded in a Faust dsp code, how can we run it in HISE? For example, like this Shimmer;

        import ("music.lib");
        import("filter.lib");
        import("effect.lib");
        

        It doesn't work: https://github.com/thedrgreenthumb/faust/blob/master/shimmer.dsp

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

          @JulesV go look in the repository with your .dsp code,there will be the .lib files but in many cases these libs are now in stdfaust

          HISE Development for hire.
          www.channelrobot.com

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

            @Lindon Thanks for the info.
            Do I need to copy the lib files to the Faust folder?

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

              @JulesV I look at thr code that is being used in the dsp and copy over the relevant functions from the lib file

              HISE Development for hire.
              www.channelrobot.com

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

                @Lindon Sorry, but I can't see the .lib files in that repository.

                ulrikU LindonL 2 Replies Last reply Reply Quote 0
                • ulrikU
                  ulrik @JulesV
                  last edited by

                  @JulesV I found the libs here:
                  https://github.com/grame-cncm/faust/tree/master-dev/embedded/faust4processing/src/faust-libraries
                  and they seems to be included in the main Faust lib

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

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

                    @JulesV said in Real time pitch shifting with ScriptNode:

                    @Lindon Sorry, but I can't see the .lib files in that repository.

                    yes - as @ulrik suggests your first thing to try is the std lib

                    HISE Development for hire.
                    www.channelrobot.com

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

                      If the .lib files have already been included, then there is something else.

                      The below Shimmer dsp code is not working for me.

                      declare id   "shimmer";
                      declare name "Shimmer";
                      declare category "Reverb";
                      
                      //------------------------------------
                      //Based on:
                      //ValhallaShimmer
                      //------------------------------------
                      
                      import ("music.lib");
                      import("filter.lib");
                      import("effect.lib");
                      
                      //Constrols
                      //PS controls
                      envelope = hslider("envelope", 1, 0.1,3, 0.05);//parametric_controller(control, envelope, speed, depth)*shift
                      speed = hslider("speed", 0.1, 0.1, 10, 0.05);
                      depth = hslider("depth", 0, 0, 1, 0.05);
                      control = hslider("control",0.5, 0, 1, 0.05);
                      shift = hslider("shift", 0, -6, +6, 0.1)*2; //*2 needed to conform with parametric controller output
                      //Reverb controls
                      size = hslider("size", 0.1, 1, 3, 0.05);
                      diffusion =  hslider("diffusion", 0.5, 0.1, 0.7, 0.05);
                      feedback =  hslider("feedback", 0, 0, 0.35, 0.05);
                      hf_damping = hslider("hf damping", 0, 0.005, 0.995, 0.005);
                      //Global 
                      dry_wet = hslider("dry/wet", 0.5, 0, 1, 0.05);
                      
                      //Can be add to .lib
                      mixer(mix) = _*(1 - mix),_*mix:>_;
                      
                      //Parametric controller, combinate signals from envelope follower and oscillator, can be added to .lib
                      c_folower_colibration = 6;
                      parametric_controller(mix, envelope_t, freq, depth) = (amp_follower(envelope_t):_*c_folower_colibration:_*depth,osc(freq)*0.5:_,_*depth):mixer(mix):_+0.5;
                      
                      //Can be moved to .lib too
                      X = (_,_)<:(!,_,_,!);
                      opf(a) = (_+_*(1-a)~@(1)*a); 
                      allpass_with_fdelay(dt1,coef,dt2,dt2pos) = (_,_ <: (*(coef),_:+:@(dt1):fdelay(dt2,dt2pos)), -) ~ _ : (!,_);
                      allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
                      dry_wet_mixer(c,x0,y0,x1,y1) = sel(c,x0,y0), sel(c,x1,y1)
                      	with { 
                      			sel(c,x,y) = (1-c)*x + c*y; 
                      		 };
                      
                      APFB(dt1,fb1,dtv,dtvpos,dt2,fb2) = _:allpass_with_fdelay(dt1,fb1,dtv,dtvpos):allpass(dt2,fb2);
                      
                      //PS constants, can be changed to decrease effect delay 
                      c_samples = 2048;
                      c_xfade   = 1024;
                      //PS implementation, copy-pasted from faust repository, see ./examples/pitch_shifter.dsp
                      transpose (w, x, s, sig)  =
                      	fdelay1s(d,sig)*fmin(d/x,1) + fdelay1s(d+w,sig)*(1-fmin(d/x,1))
                      	   	with {
                      			i = 1 - pow(2, s/12);
                      			d = i : (+ : +(w) : fmod(_,w)) ~ _;
                      	        };
                      
                      process(x,y) = x,y:(_,_:
                      	(_,X,_:(
                      	(_*feedback+_*0.3:>APFB(601*size,0.7*diffusion,50,49*(osc(1)+1)/2,613*size,0.75*diffusion):opf(hf_damping)),
                          (_*feedback+_*0.3:>APFB(2043*size,0.75*diffusion,50,49*(osc(1.5)+1)/2,2087*size,0.75*diffusion):opf(hf_damping))
                      	):X)~(
                      	(_*feedback:dcblockerat(80)
                      	:@(4325):
                      	APFB(2337*size,0.7*diffusion,50,49*(osc(0.7)+1)/2 ,2377*size,0.4*diffusion):@(2969):transpose(c_samples,c_xfade,	 
                          (x:parametric_controller(control, envelope, speed, depth):_*shift))),
                      	(_*feedback:dcblockerat(80)
                      	:@(4763):
                      	APFB(1087*size,0.7*diffusion,50,49*(osc(1.3)+1)/2,1113*size,0.4*diffusion):@(3111):transpose(c_samples,c_xfade,	 			   
                      	(y:parametric_controller(control, envelope, speed, depth):_*shift)))))
                      	:dry_wet_mixer(dry_wet,x,_,y,_);
                      
                      
                      
                      
                      
                      
                      LindonL 1 Reply Last reply Reply Quote 0
                      • LindonL
                        Lindon @JulesV
                        last edited by

                        @JulesV try adding the line;

                        import("stdfaust.lib");

                        at the start..

                        HISE Development for hire.
                        www.channelrobot.com

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

                          @JulesV Try to use online faust editor and let's see if it does the same error or not

                          develop Branch / XCode 13.1
                          macOS Monterey / M1 Max

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

                          17

                          Online

                          1.7k

                          Users

                          11.8k

                          Topics

                          102.7k

                          Posts