OK, after messing with it last night and coming tooo close to drop kicking my computer out the window, I decided to take another stab at it today and voila!
Here is a true scope that plots the waveform data as in the C++ version of the TestBed. It’s by no means perfect, could use some spline interpolation to make the waveform look smoother, but although I know what that is, I don’t know how to do it.
I opted to release it as is instead of making changes to be more like the C++ TestBed scope, namely, the math to do on the buffer to plot the waveform. I scaled my values down in the callback instead of in my timer event.
Anyway, I commented the code ( something I really should do more often ) so anyone with some skill in Delphi should be able to get it to work. As with any Delphi code I’ll post, it uses plain standard controsl that ship with every version of Delphi.
So there it is, I hope you like it! I’m proud of it as its the first time I’ve ever done something like this.
here is the link :
- NiteBeast asked 15 years ago
Here is a more CPU intensive version that actually maps just about every sample. Before I was doing a snapshot of every 16th sample in the buffer. Although it doesn’t show a perfect picture of the waveform, it does look fine.
This one shows the true waveform, just about every single bit of info. It may be CPU intensive, I don’t know (I have 1.4 Ghz so its hard to tell).
I have a better one sly, e-mail me and I’ll send you the code (full resolution oscil).
I took the one I did and just upped the PaintBox width to 512 to show the full view, was really tired last night and couldn’t wrap my brain around how to scale a floating point value greater than the width of my canvas to fit correctly. Kept getting squeezed into one X value instead of the range.
I use 512 now, however I was getting a full K byte of data from the buffer, very cool!
anyway, e-mail me and I’ll send you the better one to add to the testbed.
After a few requests via e-mail I decided to up the source to a Full Resolution/Real Time Scope.
This one fires every 25ms, so speed is an issue. I don’t know what the fail point would be, I run a bit of a speed demon myself so I can’t gauge.
Anyway, pretty straight forward code, I cleaned it up a bit (removed crap no one needs).
Please login first to submit.