HISE Logo Forum
    • Categories
    • Register
    • Login

    Time Stretching

    Scheduled Pinned Locked Moved Feature Requests
    36 Posts 6 Posters 3.6k 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.
    • d.healeyD
      d.healey
      last edited by

      Is this a possibility? :D

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

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

        There is one Timestretching library called Rubberband which may find its way into HISE one day, but it's also dual licensed so it adds some licensing costs for closed source projects (only if they use it of course).

        The other libs (zPlane, Elastique etc.) are way too expensive and / or don't supply a GPL version...

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

          What about the SoundTouch library?

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

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

            It's not actual timestretching (but rather a very simple algorithm that doesn't sound very convincing) plus it comes with a latency of about 100ms so it's not really usable for real time streaming.

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

              aha that's fair enough.

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

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

                Time to dig up this ancient thread.

                What's the latest with getting Rubberband into HISE, can we do it via some scriptnode magic?

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

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @d.healey
                  last edited by

                  @d-healey Third party node should be able to do it, IIRC it has a single .h file that has the entire library inside it for easy importing, I couldn't get it working but I really only tried for about 5 minutes before my goldfish brain kicked in

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @A Former User
                    last edited by

                    @iamlamprey said in Time Stretching:

                    @d-healey Third party node should be able to do it, IIRC it has a single .h file that has the entire library inside it for easy importing, I couldn't get it working but I really only tried for about 5 minutes before my goldfish brain kicked in

                    Oh interesting, I might have to give it a go.

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

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

                      Baby steps. Any idea about this?

                      d695b988-fe61-4edf-9814-37e96eed7dcf-image.png

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

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

                        Ah I think I'm getting a bit further, I forgot about the node template generator!

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

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

                          I think for now this is beyond my C++ level. I'll come back to it again at some point unless someone else implements it first (pleeeeaaaassseeee!!!) :D

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

                          A 1 Reply Last reply Reply Quote 1
                          • A
                            andioak @d.healey
                            last edited by andioak

                            @d-healey said in Time Stretching:

                            I think for now this is beyond my C++ level. I'll come back to it again at some point unless someone else implements it first (pleeeeaaaassseeee!!!) :D

                            Thanks for giving this a go, David! This is indeed an attractive feature for hise! Can't wait for this to work. My C++ is much worse than yours, but perhaps not this guys:

                            The Audio Programmer - "Implementing a TimeStretching Library (RubberBand)":

                            (It's a live stream, so watch in 1.5x speed :) , not sure it gives you more insight than you got cause it's for JUCE. Perhaps the Hise part is more difficult)

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

                              @andioak Ah thanks, I'll check it out!

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

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

                                @d-healey I know somebody is working on it and has already implemented a node with rubberband so yes it‘s definitely possible and not too difficult to pull off.

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

                                  I think I'm making some progress with this, thanks to the video @andioak posted.

                                  However inside HISE, after I've successfully compiled my node, I'm not able to see it in the scriptnode workspace or in the Hardcoded Master FX. It tells me it can't find the dll. Any ideas?

                                  8ea21f83-cff0-4de7-b7a4-c0a5ce36c689-image.png

                                  Edit: If I remove this std::unique_ptr<RubberBandStretcher> rb; from my node it will show up in HISE. I don't know why though, or what to use instead.

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

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

                                    @Christoph-Hart What data is in data and how do I access it?

                                    template <typename T> void processFrame(T& data)
                                    {
                                    }
                                    

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

                                    ? 1 Reply Last reply Reply Quote 0
                                    • ?
                                      A Former User @d.healey
                                      last edited by A Former User

                                      @d-healey

                                      //processFrame is the audiobuffer 1 sample at a time:
                                      
                                      template <typename T> void processFrame(T& data)
                                      		{
                                      			for (auto& sample: data)
                                      			{
                                      				sample *= .5; // Volume @ 50% 
                                      				// do other stuff
                                      			}								
                                      		}
                                      
                                      
                                      //you can also do it this way (the method directly above processFrame):
                                      
                                      		template <typename T> void process(T& data)
                                      		{
                                      			static constexpr int NumChannels = getFixChannelAmount();
                                      			// Cast the dynamic channel data to a fixed channel amount
                                      			auto& fixData = data.template as<ProcessData<NumChannels>>();
                                      			int numSamples = data.getNumSamples();	//data also has some of its own methods you can call, like getNumSamples()
                                      
                                      			for (auto ch : data)
                                      			{
                                      				dyn<float> channel = data.toChannelData(ch);
                                      
                                      				for (auto& sample : channel) //For each sample, same as processFrame
                                      				{
                                      					sample *= .5; // 50% volume					
                                      				}
                                      			}
                                      
                                      			//now we don't really need this stuff, since we did it manually:
                                      
                                      			/*
                                      
                                      			// Create a FrameProcessor object 
                                      			auto fd = fixData.toFrameData();			
                                      
                                      			while (fd.next())
                                      			{
                                      				// Forward to frame processing
                                      				processFrame(fd.toSpan());
                                      			}
                                      			*/
                                      		}
                                      
                                      d.healeyD 1 Reply Last reply Reply Quote 2
                                      • d.healeyD
                                        d.healey @A Former User
                                        last edited by

                                        @iamlamprey Thanks! How did you figure it out? Any idea why my node won't show up in HISE?

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

                                        ? 2 Replies Last reply Reply Quote 0
                                        • clevername27C
                                          clevername27 @Christoph Hart
                                          last edited by

                                          @Christoph-Hart If you're really interested, I could arrange something with zPlane.

                                          d.healeyD 1 Reply Last reply Reply Quote 4
                                          • d.healeyD
                                            d.healey @clevername27
                                            last edited by

                                            @clevername27 Elastique would be a good addition! We'd still need Rubberband as a baseline because the other algorithms don't have compatible licenses.

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

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

                                            54

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts