How to quickly draw static waveform?


#1

Hi all,

I’m to draw some static waveform (e.g. from a .wav file) using Juce’s Path class, but it works very slowly with long enough waves (even in release build), when there’re a lot of data/peaks to process. Alternatively, when I take not all data from a wave, but with certain step, according to drawing scale, the resulting wave looks wrong, not reflecting the actual density and peaks of the waveform. What I’m missing here? As I can see, the Tracktion and other apps can draw waveforms really fast and plausible.


#2

eek - no, you really wouldn’t want to draw it as a path! I think tracktion just using Graphics::drawVerticalLine, which lets you have anti-aliased tops but is still very fast.


#3

Yeah, it now looks really fast with it. Thanks, Jules!