HISE Logo Forum
    • Categories
    • Register
    • Login

    Scriptnode pitch-shift a signal

    Scheduled Pinned Locked Moved General Questions
    48 Posts 11 Posters 3.4k 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.
    • Christoph HartC
      Christoph Hart
      last edited by

      Don't worry, I am using them myself too in some older projects, so I won't remove them entirely, but what I might do is to remove them by default and have a preprocessor macro that enables them so that people do not use them in new projects at some point.

      1 Reply Last reply Reply Quote 1
      • giftliftG
        giftlift
        last edited by giftlift

        This doubles the freq of a sign wav.

        HiseSnippet 1334.3oc2X07aaTDEeV6LQwNIp7QgyqBGHEEhrSBTjpfXhcbUf3HSbRZiPnnIqGaOj0yrr6Xm5V3DbfabFN.GgSHtxAjxe.DIjxeAbjagK8.WJya20Y206lFGWURKyAqYdy6s927932amspsvf53HrQZY1pmEEoMEtVOtrUwVDFGsVIj1z3VDyF5NRp0qyQqzyh33PqizzReaPEsLigbGmt7JDSB2fFHBg1QvLnqyZyjARqV3CYllkI0oawZGR6kJrlgfWTXJ5nfSZbNjEw3.RS5FDPsTXj13qVmIE10jDI0AoM1Jh58p0RbH2S+cXNr8Movh7nZpGjm3xBy5.hAonhsXl0q1+X6fTOkpANgzdNgqiqvpyNSdfy3Eb2POvhv9CsTON3kOL7xMzvCEBci4gNEHD06XRjQQFDN72fIhFoViKobGlrW3v0UJbeQbUlznUx3MUB3UEndZiW+f+z3UazfZHC.6X3x28oejVSKtuKKtlgMyRp9+AfLk+R8x2MeD.4IFo8i3U4MYb57F1TEzJ4XsAUdnv9fYmwrS2Ytwszazga.9acKapEwltknpIo2rNj1VlzMU1Lm99lBiCpwtO8FYeP1LY+hrgMxEgq.ZLqQKBmSMchqFTFyk1ByY4cZuO0dN8tDyNAOuXUxoOeGX3J4DheaJ5HY7lUHRa18PZ3M5ztlh.wfVzGcJYZoPfotqyAqgzoZTdc2EORM72LOrVyey782DAGFJWpj66MciV9yUyfPCFqbvfTQcErmnLwPc75UkHaAI6JhMoJahZOuwYYUiCVjGo.7fPcck2MhXszvisO0nG9KJZ2F.EPL5O+Nr5veGVaNkFdoGaphq.MaEmvDsZofmGbJF2GudL8BGCE0LTolGE6DXSmOX+qFXmNfuXKhcSpzuB1hZKYz90PvJEyQZ3LkAusCE3rQ6.Yf.lp1YeSlALCUkXq5sHotkeoOakxr03cUOEuhqJLtuwAjQUH2a.YSTXcwgT6AZ1gPaaYES5DEpoZmBkXgIjqc.8POudXodoJUfvTLTfFdHuTgXP9qOIQHuTgDfrR2vP969VX7qC.4i+7+5leY6icg7j3x1zOqCkazK.2ManFOrYgKAtOc43t5bIh6SWNIWctKoqdJWbquIjjghgETnxkq4Wtn9UkxMPAyqhIbhYOm90LdJ8rTUSnT+HkP9GwLdjZepxWF4fk0iI.jeUbXhzE9xSGLNtXnBoO.2Uvp2uoVYvgLqayO8FvbU6poypqFtq93beh96FL8M5O6VPKMz4PpD1YNIVvo6YILGLW4kvMXlf9y2WgmUcsgoKwOmw8z+OXn3dVzcbRDtmi+cX7ZCf69ZFE2808hw8+78+zCm4u+CWbmF+QIP4L794ENJNW4BI5mW3nj3JWXHvaz1RtWA7IosTRcROc4guSphJODjev0+4a+m2+qF.xOp2OT8kKchepQs1Bgrk5UFCvceytxv8n9F.P1Qbp6D5Ns3+G6NMNtIj9E4jMoW6I2MdNn+TpA5OMEdSpCU5ElikxEtIST6tF7ZtCqogYwSM7o76l.6B3QimxuahrKpaUcgrKumwucbye4UJb9rK6dzSVUZguY3eOcktWLjuP1k3MdfzfsWqDQRfWQw+1kgxKzzJQ6xLndeCfL3RTmCjBq+atraahgsXOCu6uCoHS3JQknwc+NbYvUf054Qc8NgXbt4ygZqti0dFFvGK4MyiPIayBifMKNB1rzHXyaMB171ifM2bDr4cdr1.Wu886HEs89PZJAUW0M4RSaUNYeSupCz+JG.GKN
        
        1 Reply Last reply Reply Quote 0
        • griffinboyG
          griffinboy @hisefilo
          last edited by

          @hisefilo

          Yes I would love to be able to do this as well!
          I've been wanting to program a shimmer reverb.
          Probably quite ambitious.

          A hisefiloH 2 Replies Last reply Reply Quote 0
          • A
            aaronventure @griffinboy
            last edited by aaronventure

            @griffinboy Faust

            Link Preview Image
            misceffects - Faust Libraries

            favicon

            (faustlibraries.grame.fr)

            Plus, scriptnode now has two interpolating delay line nodes which will be of interest here.

            griffinboyG 1 Reply Last reply Reply Quote 1
            • griffinboyG
              griffinboy @aaronventure
              last edited by

              @aaronventure
              Thank you!
              I haven't looked into FAUST yet, this is a good time to start

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @griffinboy
                last edited by

                Link Preview Image
                hise_tutorial/PitchShifting at master · christophhart/hise_tutorial

                The Tutorial project for HISE. Contribute to christophhart/hise_tutorial development by creating an account on GitHub.

                favicon

                GitHub (github.com)

                This uses two delay lines and fades between them. Note that the sound quality is far worse than what you expect from an industry standard pitch shifter (and the pitch shifter in Faust uses the same algorithm with only little sound quality improvement).

                A 1 Reply Last reply Reply Quote 0
                • A
                  aaronventure @Christoph Hart
                  last edited by

                  @Christoph-Hart so what would an industry standard pitch shifter do different, then? What's the catch?

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @aaronventure
                    last edited by

                    @aaronventure I'm not 100% sure, but I guess it involves using a good timestretching library optimized for low latency that can handle live audio input.

                    P 1 Reply Last reply Reply Quote 2
                    • hisefiloH
                      hisefilo @griffinboy
                      last edited by

                      @griffinboy hi mate! Faust is the way for me. Just google shimmer + faust + dsp
                      i.e https://github.com/azur1s/elysiera/blob/main/faust/dsp.dsp

                      1 Reply Last reply Reply Quote 0
                      • P
                        ps @Christoph Hart
                        last edited by

                        @Christoph-Hart 1024 samples (50ms) is what all the "realtime" pitch shifter plugins introduce.

                        the signal smith demo https://signalsmith-audio.co.uk/code/stretch/demo/ set to 50ms block size sounds on monophonic signals pretty much how you would expect "industry standard" rt pitch shifter to sound like .
                        would it be a crazy amount of work to basically replicate the web demo but with an audio stream?

                        the following looks even better for "realtime" processing and has a MIT license:

                        Link Preview Image
                        GitHub - jurihock/stftPitchShift: STFT based real-time pitch and timbre shifting in C++ and Python

                        STFT based real-time pitch and timbre shifting in C++ and Python - jurihock/stftPitchShift

                        favicon

                        GitHub (github.com)

                        used in here:
                        https://github.com/jurihock/stftPitchShiftPlugin

                        I tried to implement it already but failed (I think because it's not c++11)

                        do you want to take a look? I think it opens up really cool currently not possible opportunities straight out of the box.

                        P 1 Reply Last reply Reply Quote 1
                        • P
                          ps @ps
                          last edited by

                          @Lindon @Christoph-Hart after posting this I started to write my own c++ code inspired by all the different algorithms available and can say that for "realtime" pitch shifting there is not really a one fits all solution but it's very doable and I got it up and running (but still optimising) . my use case right now is vocal manipulation and besides the fact that you have to really play around with window sizes, overlapping and so on - there is some other stuff that is needed for a industry standard result. I saw that autotune or little alterboy are reporting very odd latency to the host. so I figured there has to be additional sfft processing happening and it is resonance suppression. so before doing the actual shift I lower the magnitude of bins (above a certain frequency) to avoid resonances hitting the shifting algorithm. formant shifting sounds shit yet but I'm working on this right now.
                          Summary is that I don't see myself coming up with a node that I just use in different projects.
                          and if you go down the road, don't accidentally process per Frame or your computer will explode ;)

                          Christoph HartC 1 Reply Last reply Reply Quote 2
                          • Christoph HartC
                            Christoph Hart @ps
                            last edited by

                            D'oooh, I didn't even think about trying out the signal smith algorithm...

                            The implementation was dead easy and the sound is way way WAY better than the naive pitch shifting from Faust or scriptnode (kind of obvious, that was the entire point of the JUCE talk of the signalsmith developer). However there is a latency of 4096 samples which is kind of huge - you can set the FFT to 2048, but then it will sound very bad on lower notes.

                            A LindonL 2 Replies Last reply Reply Quote 4
                            • A
                              aaronventure @Christoph Hart
                              last edited by

                              @Christoph-Hart will this be replacing or augmenting the timestretch for the sampler as well?

                              Christoph HartC 1 Reply Last reply Reply Quote 0
                              • Christoph HartC
                                Christoph Hart @aaronventure
                                last edited by Christoph Hart

                                @aaronventure No I just took the timestretching algorithm that's already in the sampler and made it a realtime effect that works on any audio signal.

                                d.healeyD 1 Reply Last reply Reply Quote 1
                                • d.healeyD
                                  d.healey @Christoph Hart
                                  last edited by

                                  @Christoph-Hart Does this mean we can have a pitch LFO in effects plugins now?

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  Christoph HartC 1 Reply Last reply Reply Quote 0
                                  • LindonL
                                    Lindon @Christoph Hart
                                    last edited by

                                    @Christoph-Hart well the stftPitchShift looks pretty good - and quick and has a MIT license...

                                    HISE Development for hire.
                                    www.channelrobot.com

                                    P 1 Reply Last reply Reply Quote 0
                                    • P
                                      ps @Lindon
                                      last edited by

                                      @Lindon @Christoph-Hart
                                      stftPitchShift is def the best out there I could find - it can do polyphonic and also formant shift.
                                      2048samples latency is normal for pitch shifting audio (it's also normal that low signals sound bad when pitch shifted in those kind of plugins)
                                      I'd love to see that implemented as well :)

                                      Christoph HartC 1 Reply Last reply Reply Quote 0
                                      • Christoph HartC
                                        Christoph Hart @ps
                                        last edited by

                                        @ps I played around with it yesterday but it always sounded very cheap. I‘m definitely doing something wrong maybe I‘ll try their JUCE example and go from there.

                                        P 2 Replies Last reply Reply Quote 1
                                        • Christoph HartC
                                          Christoph Hart @d.healey
                                          last edited by

                                          @d-healey said in Scriptnode pitch-shift a signal:

                                          @Christoph-Hart Does this mean we can have a pitch LFO in effects plugins now?

                                          A pitch lfo can be made with a simple delay buffer that modulates the delay time (a basic chorus), a pitchshifter would be overkill.

                                          1 Reply Last reply Reply Quote 1
                                          • P
                                            ps @Christoph Hart
                                            last edited by

                                            @Christoph-Hart did you align the pitch shift with the timbre shift and set a timbre frequency to around 2.5 - 3ms?

                                            if the formants are not shifted together with the signal it will sound strange :)

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

                                            51

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts