5 ms·
Just as a point of comparison, here's an FM/AM modulated synth I wrote some years ago [0]. The version linked here is written in 250 lines of plain old C code w
by exDM69 10y ago
Just as a point of comparison, here's an FM/AM modulated synth I wrote some years ago [0]. The version linked here is written in 250 lines of plain old C code with floating point arithmetic and not a single thought has given to performance (but it runs fast enough).
Originally, this synth was designed for a demoscene 4k intro, which was never finished. It was originally implemented with 16.16 fixed point arithmetic using legacy x86 assembly abusing one byte instruction encodings (e.g. using the AX part of RAX as the .16 fractional part). Some of the design decisions of the size-optimized hand-written assembly synth are still visible in the original code.
The original assembly implementation is buried somewhere deep in my hard disk.
[0] https://github.com/rikusalminen/jamtoysynth/blob/master/src/instrument.c https://github.com/rikusalminen/jamtoysynth/blob/master/src/...
- thedjinn 10y agoAlways interesting to see this. Looks a lot like a 4k synth I did myself many years ago. It also amuses me to see that almost everybody was using those RBJ biquad filters.
- exDM69 10y agoI have to confess that I have pretty much no idea how the filter works or the math behind it. I wrote that part with a friend who has some DSP background but it was essentially copied from a signal processing book :) But it sounds alright and was easy to implement, I can see why it's popular.