Hi Martin, Thanks for chiming in. I've received some code from Greg Thompson (THANKS!!!) which is similar which I will give a try as it's easy for me to translate to Java code. I'll also keep your advice in mind! stevn On 9/13/07, martin.peach@sympatico.ca wrote: > Steven Yi wrote: > > > It should certainly be possible and I've seen some code here and there > > and have investigated some but I haven't had a chance to implement. A > > while back I had wanted to implement the same method as Ardour (which > > I think uses a cache file for faster rendering) but I couldn't find > > it's waveform rendering code the last time I looked. If I remember it > > correctly, to show a waveform well it has to do some averaging or > > peaks for all the sample values that the pixel holds, otherwise you > > could get really different waveforms if you happen to hit the wrong > > sample. I'm not sure what's involved, but if someone knows what is > > involved and tells me I'm sure it wouldn't be too bad to figure out an > > implementation. > > I did it a couple of times by figuring out how many samples fit into a pixel width, then scanning that many samples for maximum and minimum, then drawing a vertical line between the maximum and minimum points, and repeat for each pixel column. It's also useful to cache either the bitmap image or the list of min/max pairs as long as the scale and data stay unchanged. Some audio apps seem to be doing that in the background whenever they have idle time. > > Martin > > > -- > Send bugs reports to this list. > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk >