This was just an experiment, and I will step back from further work for now. But there is still a lot to do to improve this further.
- Support for other tracker formats (S3M, XM, IT). I found this project, also called MODplay, quite promising, but the memory footprint is significantly larger (~30kb flash)
- Stream the tracker file from an attached memory, e.g. a serial NOR flash, to allow for even larger files to be used.
- Introduce data compression to reduce memory footprint of the MOD files as the MODfiles are quite a redundant data format.
- Using better digital signal processing techniques to improve audio quality (interpolation, filtering, noise shaping). For example one could go for 8bit PWM resolution at 176kHz sample rate to move all the PWM noise far away from the audio band. Delta-sigma modulation with dithering can then be used to recover the loss in resolution, even going beyond the 11 bit we are using now.
A first estimate of achievable SNR vs bit depth with more advanced audio processing is shown below. The two lines indicate 12bit and 14bit effective number of bits (ENOB) after noise shaping.

MODplay (INT driven) -> Noise shaper -> SRAM (Ring buffer) -> DMA -> Timer PWM -> RC Filter -> Audio Out
Even low end 32bit microcontrollers are in many instances as capable as a homecomputer / PC from the early 90ies. Powerful DMA feature keep the burden of playing samples off the CPU core. A 32 bit single cycle RISC-V CPU core can very well be compared to a 80486 or 68040, with some limitations regarding memory speed (There are waitstates on flash memory access and no cache).
Tim
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.