@tomoya @junkato I don't quite remember because I implemented it once two years ago and then just copy-pasted that code through every prototype that followed 😅 But I can send you a link to the source, and I'm happy to help explain how it works to the best of my memory, by text or over a call.
The source is in this folder, in `audio_clip` and `audio_clip.rs`: https://codeberg.org/xlambein/futile/src/branch/main/paw/src/widgets/track
@tomoya @junkato But yeah in short, it's not super simple. IIRC I have two modes depending on whether I'm zoomed in close or not. If I'm far away, I have pre-computed the min/max of samples over a rolling window of say 256 samples, and then I subsample this to compute the visible min/max at the current zoom level. Then I draw a pair of triangles for each pair of consecutive min/max. And there's a lot of caching involved to make this efficient.
Not sure if this made any sense 😅😅