Re: Best drawing technology for audio waveforms, envelopes, etc.?
Re: Best drawing technology for audio waveforms, envelopes, etc.?
- Subject: Re: Best drawing technology for audio waveforms, envelopes, etc.?
- From: "I. Savant" <email@hidden>
- Date: Mon, 25 Jun 2007 13:29:07 -0400
On 6/24/07, Hans Kuder <email@hidden> wrote:
This seems like a pretty reasonable way to go about it. As for the drawing
operation itself, how well would a NSBezierPath handle the hundreds of
segments required to draw a waveform? At least when zoomed out, it seems a
bit overkill to have a "line" between every next pixel on the screen when
it's pretty much guaranteed that the user will only see the join points
between lines rather than the lines themselves. Is there a more efficient
way to do this?
I've never personally plotted a waveform however, it occurs to me
you would want to scale your plot. Your layers should all have a sense
of scale (at normal zoom, 1 sample == 1 pixel, or something sane).
When zoomed out, your scale would change (10 samples == 1 pixel) so
you plot fewer points (samples) ... only every 10th sample or the mean
of those 10 samples. Someone with more experience could probably
explain this better (or give a better approach), but that's the way
I'd design it.
Also, for efficiency, only plot the samples that are visible
on-screen (and the one before and the one after to allow lines to the
previous-and-next clipped points).
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden