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: Alastair Houghton <email@hidden>
- Date: Mon, 25 Jun 2007 19:51:44 +0100
On 25 Jun 2007, at 19:45, Hans Kuder wrote:
I have a pretty good fix on how to handle these sorts of data- and
perceptual-level operations, but it would be nice to find a drawing
operation that is more efficient/elegant than drawing an
NSBezierPath through each **perceptual** sample. From what you and
Uli have said, it looks like the best process is to start simple
and optimize.
Yes, that's certainly the way to go.
One other thought - rather than drawing one or a few paths
horizontally through each (on-screen) sample, what if I drew each
(on-screen) sample as its own vertical line with height equal to
amplitude? This would essentially be trading one complex path for
hundreds of very simple paths. Can anyone comment on the
performance advantages or disadvantages of this?
Well you might find that NSRectFillList() was faster for that kind of
thing, since all the lines will be vertical.
My guess is that to get really good performance you're going to end
up doing your own drawing into a bitmap, but without actually trying
it to see how fast it goes I can't be certain. Apple's engineers are
very clever and the drawing code is heavily optimised, which is a
very good reason for starting out simpleā¦ it's sometimes hard to
second-guess where the performance bottlenecks will actually be in
practice.
Basically, I think the best way to deal with these types of questions
is to try it and see. It isn't hard to knock up a test app that draws
a few hundred vertical lines.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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
References: | |
| >Best drawing technology for audio waveforms, envelopes, etc.? (From: "Hans Kuder" <email@hidden>) |
| >Re: Best drawing technology for audio waveforms, envelopes, etc.? (From: Alastair Houghton <email@hidden>) |
| >Re: Best drawing technology for audio waveforms, envelopes, etc.? (From: "Hans Kuder" <email@hidden>) |
| >Re: Best drawing technology for audio waveforms, envelopes, etc.? (From: "I. Savant" <email@hidden>) |
| >[OT] Don't draw every 10th sample(!) (Was Re: Best drawing technology for audio waveforms, envelopes, etc.?) (From: Alastair Houghton <email@hidden>) |
| >Re: [OT] Don't draw every 10th sample(!) (Was Re: Best drawing technology for audio waveforms, envelopes, etc.?) (From: "Hans Kuder" <email@hidden>) |