HISE Logo Forum
    • Categories
    • Register
    • Login

    can i draw my own wave form?

    Scheduled Pinned Locked Moved Scripting
    7 Posts 3 Posters 323 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 there a way i can draw my own waveform of a sample within a sampler, including playback position and loop points? I know I can use a buffer for drawing one but from my understanding I'd need to manage playback with Engine.playBuffer and I'd lose the advatages of the sampler, like the module chains and looping.

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

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

        @d-healey This you? https://forum.hise.audio//post/17569

        I was looking for IR display and ran into this. Still not familiar with the samples but can you get a return of the loop points? If so, I guess you can just draw them on top manually.

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

          @aaronventure loop player is limited, sampler with custom import is a better choice

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

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

            @d-healey Chris' post right below yours https://forum.hise.audio//post/17658

            Or can you not dynamically generate samplemaps for user-imported stuff (if this works based on samplemaps)?

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

              @aaronventure Oh that's how to display the waveform in the audio wavefrom control. I can already do that (with samplers too). What I'm looking for is how to draw a waveform on a panel using buffer data. I can do this already as I mentioned above but I lose the advantages of the sampler.

              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 Drawing a waveform will quickly get you into performance bottlenecks - I had to apply quite a few performance tricks that are only available on the C++ level (multithreading, under sampling, etc) to make the UI performance of the waveform acceptable for most use cases.

                You can fetch the content of any sample as HiseScript Buffer and draw it yourself, but unless you do a aggressive simplification of the sample data you'll run into performance issues.

                // Grab the first sample
                const var first = DemoSampler.createSelection(".*")[0];
                
                // will give you an array of buffer objects for each channel
                const var bf = first.loadIntoBufferArray();
                
                // Should print the length of the sample (or undefined if you load a mono sample, 
                // but here's where the fun begins).
                Console.print(bf[0].length);
                
                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Christoph Hart
                  last edited by

                  @Christoph-Hart

                  You can fetch the content of any sample as HiseScript Buffer and draw it yourself

                  This is where I had got up to. But I don't get the playback data from the sampler so I can't draw the playback cursor. Given the performance issues you mentioned I think I will abandon this road :)

                  My main goal was to be able to update the waveform when the gain level is changed (like in the waveform editor) and have horizontal and vertical zoom.

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

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

                  62

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.8k

                  Posts