Re: [linux-audio-dev] Waveform

From: Paul Davis <paul@email-addr-hidden>
Date: Tue May 10 2005 - 02:02:21 EEST

>Well, I guess the way it's done in most audio editors is that you draw a
>vertical line between the min and max (and maybe also the rms on top of
>that), if a single pixel has to represent multiple samples, and the
>usual connect-the-points-with-lines thingy (or splines, if you prefer
>smooth curves), when zoomed in to the sample or sub-sample level. Is
>there a better way?

the devil is in the details, as gerard and i found out to our mental
health with ardour recently.

if you allow arbitrary zoom scales, then the mapping between pixel
position on screen (or some notional "unit" position as offered by
canvas widgets) and a sample is non-integral, which implies
rounding. that in turn implies errors of several different kinds.

moreover, if you are displaying large audio files, reading the audio
data itself is excrutiatingly slow. hence, peakfiles.

all of this and more, in gruesome detail:

    http://ardour.org/cgi-bin/viewcvs.cgi/*checkout*/ardour/gtk_ardour/canvas-waveview.c?rev=1.47&content-type=text/plain

which is the canvas item used by ardour to draw waveforms. its
lightning fast and awesomely headache inducing.

--p
Received on Tue May 10 04:15:14 2005

This archive was generated by hypermail 2.1.8 : Tue May 10 2005 - 04:15:14 EEST