HISE Logo Forum
    • Categories
    • Register
    • Login

    Pitch Shifting With Timestreching?

    Scheduled Pinned Locked Moved General Questions
    10 Posts 3 Posters 503 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.
    • CasmatC
      Casmat
      last edited by

      Hey!

      I’m kind of stuck in determining how to implement some sort of timestreching into my plugin. The timestretching on hise is pretty unreasonable for my use case since I have three samplers and enabling timestreching on all three would be terrible cpu wise. I’m still open to somehow move to a one sampler solution (I chose three since my plugin revolves around the fact that there’s three sound layer (piano, guitar, etc) slots and each of those slots have their own round robins, hence why I went with three samplers), but I was wondering another possibility in that “classic” pitch shifting also changes the time of the sample and using midi note shifts as compensation. The pitch shift in the sampler does a pitch shift without shifting time of sample, but how would I get it so that pitch shifts causing time to shift?

      Thanks!

      i make music

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        The pitch shift in the sampler does a pitch shift without shifting time of sample, but how would I get it so that pitch shifts causing time to shift?

        I'm not sure I understand what you're asking. Could you reword the question?

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

        CasmatC 1 Reply Last reply Reply Quote 0
        • CasmatC
          Casmat @d.healey
          last edited by Casmat

          @d-healey sorry for the confusion haha, was thinking of the classic/old timestretching/pitchshifting where if you increase pitch, it makes the sample faster and if you decrease pitch, it makes the sample slower. I was thinking to implement this and then a midi shift knob which shifts midi notes such that the pitch would be compensated creating a “timestretch” like feature minus the cpu load. I maybe drastically over complicating things though

          i make music

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Casmat
            last edited by

            @Casmat

            where if you increase pitch, it makes the sample faster and if you decrease pitch, it makes the sample slower.

            That's how pitch shifting has always worked in HISE (up until the new timestretch algorithm was added and gave us a new option).

            I was thinking to implement this and then a midi shift knob which shifts midi notes such that the pitch would be compensated creating a “timestretch” like feature minus the cpu load. I maybe drastically over complicating things though

            I don't see how that would work. Whenever you change pitch you change time.

            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
            • Christoph HartC
              Christoph Hart @d.healey
              last edited by

              What you can do is if you have multiple samples, you'll transpose the note so it picks another sample with a different pitch and then pitch it back to the original note. This way you can change the timbre of the sound pretty drastically from soft to harsh.

              This can all be done with a single script using Message.setCoarseDetune() and Message.setTransposeAmount().

              CasmatC 1 Reply Last reply Reply Quote 1
              • CasmatC
                Casmat @Christoph Hart
                last edited by

                @Christoph-Hart @d-healey

                @d-healey said in Pitch Shifting With Timestreching?:

                That's how pitch shifting has always worked in HISE (up until the new timestretch algorithm was added and gave us a new option).

                Using the pitch parameter in the sample editor tab in the sampler? When the pitch is increased, the sample still plays at the same speed, even when it was supposed to increase.

                @Christoph-Hart said in Pitch Shifting With Timestreching?:

                This can all be done with a single script using Message.setCoarseDetune() and Message.setTransposeAmount().

                Thanks! This could be useful, but its not what I was really looking for...

                I was thinking of pitch shifting that affects tempo. Here's what I was describing in a video I found: video

                i make music

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Casmat
                  last edited by d.healey

                  @Casmat said in Pitch Shifting With Timestreching?:

                  Using the pitch parameter in the sample editor tab in the sampler? When the pitch is increased, the sample still plays at the same speed, even when it was supposed to increase.

                  If you disable the new time stretching stuff then all the pitch shifting options (stretching samples, adjusting the pitch parameters, using the functions Christoph mentioned, pitch modulators) work by changing the speed of the audio. If they didn't then we wouldn't need the new time stretching algorithm to do it independently.

                  You probably won't notice it with the pitch parameter of individual samples because the range is small (-100/+100 cents).

                  With a larger stretch it's clearer

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

                  CasmatC 1 Reply Last reply Reply Quote 0
                  • CasmatC
                    Casmat @d.healey
                    last edited by Casmat

                    @d-healey ahh ok, I understand! However I have samples for mostly every third note, so how would I increase the range of the pitch parameter from the -100-100 cents to something like -12 semitones to 12 semitones?

                    @d-healey said in Pitch Shifting With Timestreching?:

                    I don't see how that would work. Whenever you change pitch you change time.

                    Basically what would happen is that let’s say a person plays C3. Then a handy midi note shift script would take that C3 midi value and instead play C4 (an entirely different sample). Then the C4 would be pitch shifted down to C3, giving the end sound a slowed timestretch effect. The key part is that the midi shift is triggering a different sample that can be lowered by pitch whereas if it was just an one sample instrument, the midi and pitch shifting would cancel out resulting in no timestretch.

                    i make music

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

                      Basically what would happen is that let’s say a person plays C3. Then a handy midi note shift script would take that C3 midi value and instead play C4 (an entirely different sample). Then the C4 would be pitch shifted down to C3, giving the end sound a slowed timestretch effect. The key part is that the midi shift is triggering a different sample that can be lowered by pitch whereas if it was just an one sample instrument, the midi and pitch shifting would cancel out resulting in no timestretch.

                      That is exactly what I wrote here:

                      What you can do is if you have multiple samples, you'll transpose the note so it picks another sample with a different pitch and then pitch it back to the original note. This way you can change the timbre of the sound pretty drastically from soft to harsh.

                      This can all be done with a single script using Message.setCoarseDetune() and Message.setTransposeAmount().

                      CasmatC 1 Reply Last reply Reply Quote 1
                      • CasmatC
                        Casmat @Christoph Hart
                        last edited by

                        @Christoph-Hart I didn’t realize at the moment haha, sorry for the confusion! :flushed_face: :grinning_face_with_sweat:

                        i make music

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

                        30

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.7k

                        Posts