flat assembler
Message board for the users of flat assembler.
![]() |
What do you think? | ||||||||||||||
|
||||||||||||||
Total Votes : 5 |
Author |
|
DimonSoft 10 Oct 2018, 23:38
One of my students is currently writing an audio editor in C and WinAPI as his course project. He obviously has some difficulties understanding certain concepts, so it takes some time. I felt bored and decided to write one of the main pieces from the users’ perspective, i.e. drawing waveforms, in plain FASM.
The source code from the attachment actually produces a 24-bit BMP image containing a waveform for the specified 16-bit signed PCM WAVE file. Everything is done at compile time. Since I’m obviously abusing FASM’s features the process is quite slow (and I didn’t bother to optimize it). It took me about 20 seconds to draw waveform for a 1 minute WAVE file, but there’s a SkipFactor parameter that lets you tell the “program” to only use every Nth sample in its calculations. Having its value around 32 or 64 allowed me to decrease the compile time for 1 minute WAVE file to about 6 seconds. All the parameters are at the top of the source, namely: * SourceFile is… path to the source WAVE file * Width is the width of the image to be drawn * Height is the height of the image to be drawn * SkipFactor is for performance vs precision tweaking. Might be useful for some crazy guys out there who want to understand some FASM features along with WAVE and BMP formats.
|
|||||||||||
![]() |
|
revolution 11 Oct 2018, 02:02
I want to vote for both options.
|
|||
![]() |
|
Picnic 11 Oct 2018, 05:20
Wow
![]() Can't wait for: Crazy development 2 |
|||
![]() |
|
Tomasz Grysztar 11 Oct 2018, 10:44
revolution wrote: I want to vote for both options. Definitely both. It is obviously crazy, but it also follows in line of many other similarly insane applications of fasm that were posted here over the years. For example that TGA file with generated image of Mandelbrot set, later extended with compression to GIF. Or a sound file made in the same thread. |
|||
![]() |
|
idle 11 Oct 2018, 16:18
i wonder how reversive img2wav would look
|
|||
![]() |
|
idle 11 Oct 2018, 16:24
DimonSoft the very student of TG, ex me for offtop?
|
|||
![]() |
|
DimonSoft 11 Oct 2018, 19:19
idle wrote: DimonSoft the very student of TG, ex me for offtop? Sorry, don’t get what you ask about. What do you abbreviate as TG? |
|||
![]() |
|
idle 12 Oct 2018, 08:00
Tomasz Grysztar
|
|||
![]() |
|
Tomasz Grysztar 12 Oct 2018, 08:54
DimonSoft wrote: Having some control over the window that shows up while the compilation is in progress might make things a bit better for “users” of such FASM applications. I personally lack two things: |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.