Drawing Sample Properties on a Waveform? [Updated with the Solutions]
-
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?
Thank you, kindly.
-
@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:
(And of course we can also simply change the colour to match your palette.)
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.
-