HISE Logo Forum
    • Categories
    • Register
    • Login

    Time Stretching

    Scheduled Pinned Locked Moved Feature Requests
    36 Posts 6 Posters 3.8k 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

      @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
              • clevername27C
                clevername27 @d.healey
                last edited by

                @d-healey Hit me up if you want to discuss further. That goes for any other commercial music software company, as well. It appears I'll be using HISE here, so I'm now invested. 🌈

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

                  @clevername27 said in Time Stretching:

                  I'll be using HISE here

                  Good choice!

                  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 said in Time Stretching:

                    @iamlamprey How did you figure it out?

                    Christoph told me lol

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

                      @d-healey said in Time Stretching:

                      @iamlamprey Any idea why my node won't show up in HISE?

                      If it compiles okay, and doesn't show up in HISE it means there's an error in the code somewhere that the compiler didn't pick up, or you haven't linked the library(s) properly

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

                        @iamlamprey Now I don't feel so bad :p I'm trying to copy what the audio programmer does in the video but he's working directly with JUCE audio buffers. Do we have any access to them within the process function?

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

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

                          @d-healey check out this thread:

                          Link Preview Image
                          Block-Based Processing in Third Party Node

                          Sorry for the dumb question, had a bit of brain fog the last few days template void process(T& data) { static constexpr int NumChannels = getFixChannel...

                          favicon

                          Forum (forum.hise.audio)

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

                            @iamlamprey Thanks, that got me a little further :)

                            @Christoph-Hart 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

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

                              @Christoph-Hart I have it working in Windows, but it still won't show up on my Debian machine. The DLL compiles successfully but it won't show up in the node list and I see this in the hardcoded fx

                              a5264dc3-f31e-4c6f-a6d5-d0f061d555c9-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 d.healey

                                Aha I solved it. I was linking against my distro's rubberband library. I had to compile it myself and link against that instead. actually looks like I can use my distro's library, if I move it into the src folder and point the auto generated jucer project to it.

                                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

                                  @d-healey There's also a Rubberband build configuration where you don't need to link against a prebuilt library and it builds it from the source files directly. I used this method and just threw the entire Rubberband library into ThirdPartyCode/src/Rubberband...

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

                                    @Christoph-Hart Is that a configuration on the HISE side or within the custom node?

                                    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

                                      @d-healey In the Rubberband library

                                      Single-file build. If you want to include Rubber Band in a C++ project and would prefer not to build it as a separate library, there is a single .cpp file at single/RubberBandSingle.cpp which can be added to your project as-is. It produces a single compilation-unit build using the built-in FFT and resampler implementations with no further library dependencies. See the comments at the top of that file for more information.

                                      Although I think I managed to switch to IPP despite what this paragraph said...

                                      Link Preview Image
                                      rubberband/COMPILING.md at default · breakfastquay/rubberband

                                      Official mirror of Rubber Band Library, an audio time-stretching and pitch-shifting library. - rubberband/COMPILING.md at default · breakfastquay/rubberband

                                      favicon

                                      GitHub (github.com)

                                      d.healeyD 2 Replies Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @Christoph Hart
                                        last edited by

                                        @Christoph-Hart Oh interesting, thanks

                                        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 @Christoph Hart
                                          last edited by

                                          @Christoph-Hart Yep that worked, much simpler :)

                                          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

                                            Okay here's what I have so far. Mainly taken from the audio programmer's video, with a little help from some forum members and the RubberBand docs.

                                            It certainly affects the audio but doesn't seem to be controlling the time stretch properly. Just makes everything sound kind of choppy. I tried it with adjusting the pitch instead of the time and that seemed to work much better (still choppy though).

                                            I'm sure I'm missing something important. In the audio programmer's video he's using read and write buffers, but I don't know how to access them in a custom node (do we have access to them? are they necessary?). I'm just using the data pointers.

                                            I also wonder if I need to add some start padding and delay as described here - https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html#a078827068efc609efb4c71bd094d80e9

                                            Any help appreciated.

                                            rubber_band_node.zip

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

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

                                            10

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.2k

                                            Posts