HISE Logo Forum
    • Categories
    • Register
    • Login

    Drawing Sample Properties on a Waveform? [Updated with the Solutions]

    Scheduled Pinned Locked Moved Solved Scripting
    2 Posts 1 Posters 186 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.
    • clevername27C
      clevername27
      last edited by clevername27

      Does anyone know how to, with an Audio Waveform component…

      • Draw a specific section of a sample (measured in samples, time, etc.)?
      • Draw specific points such as the SampleStart and SampleStartMod?

      Also, does anyone know what this green line represents, and the translucent areas on either side?

      Screenshot 2023-04-08 at 8.48.47 PM.png

      Thank you, kindly.

      clevername27C 1 Reply Last reply Reply Quote 0
      • clevername27C
        clevername27 @clevername27
        last edited by clevername27

        @clevername27 I've uncovered the answers—for the interested;

        • To draw a specific section of the waveform, use a Viewport, and put the waveform component inside—from there you can scroll and zoom it. All these factors are floats from 0.0 to 1.0; so, to show specific parts of the waveform, simply divide 1 by the sample length (in whatever units you want to use.)
        • The green line is where the sample begins playing from. If you've used the sample start offset, the green bar will reflect that.
        • The translucent areas on either side of the bar don't mean anything—they are there to make the green bar stand out more.
        • So, the active sample start is drawn automatically; if you want to hide it, then make it transparent. To do that, you need to change its colour, which is done in SampleDisplayComponent.cpp:

        Screenshot 2023-04-17 at 1.12.09 PM.png

        (And of course we can also simply change the colour to match your palette.)

        Screenshot 2023-04-17 at 1.14.43 PM.png

        Apparent bugs (noted here and elsewhere on the forum):

        • LAF: Some of the overrides work; some don't. (You won't get an error message; simply nothing changes.) However, there's a lot of flexibility built into the default look and feel, and the most important one (drawThumbnailRange) does work, and you can choose only to override specific drawing routines—the others will use the default ones via the Property Inspector.
        • The playback head (white) sometimes freezes when another note is played.
        1 Reply Last reply Reply Quote 3
        • clevername27C clevername27 has marked this topic as solved on
        • First post
          Last post

        12

        Online

        1.7k

        Users

        11.8k

        Topics

        102.3k

        Posts