waveform.h
Waveform peaks, for drawing.
#include <sonore/waveform.h>- 2types
On this page
Design notes
A sampler, a convolver or any plugin that loads a file has to SHOW it. In our architecture the drawing happens in the page, so what the C++ side owes the UI is not pixels but the summary a waveform view is made of: the minimum and maximum of each bucket of samples.
Min/max per bucket rather than an average or a peak: an average flattens a waveform into a grey block, and a single peak per bucket draws a shape that is symmetric even when the material is not. Asymmetry is exactly what a producer is looking at when they check a kick drum's polarity.
Offline: this walks the whole file, so it belongs in prepare() or in a message-thread handler, never in process().
Types 2
One bucket's vertical extent, in the sample range [-1, 1].
A downsampled outline of some audio, one row of buckets per channel.
The count is what the VIEW asks for, not what the file suggests: a 3-minute file drawn into 800 pixels needs 800 buckets whether it is 8 million samples or 80.