Removing Pointless Features - richardjwild/arctracker GitHub Wiki

During the previous round of refactoring I had noticed a couple of features of Arctracker that seemed pointless to me and that greatly complicated the code. The first thing was that it seemed to support monophonic playback: in hindsight, I doubt that even in 2004 anyone would likely have had audio hardware incapable of stereo, so I removed it. Then immediately I had a moment of doubt: in 2018 there are actually a great number of monophonic playback devices out there, which wasn't the case 14 years ago. Had I just broken compatibility with such a device? So I found an LG bluetooth speaker that was monophonic and tried it out. Fortunately, it worked fine. Obviously the device presented a stereo-capable API and then mixed down to mono itself.

The next thing was sample formats; when initialising the audio device it requests 16 bits signed, little-endian, but then it includes fall-back code that purports to support 16 or 8 bits, signed or unsigned, big or little-endian. None of this code has ever been tested, of course, because every audio device I've run Arctracker on has supported the requested sample format. So I removed the code supporting other formats which was a good refactor, I deleted a lot of code there.

The next thing I did was remove support for the aRts soundserver because I wasn't running KDE any more, and anyway I planned to refactor the sound outputs API to be more like a plugin-style interface.

Finally, while I was in the mood for deleting things, I noticed there was a number of unused things in the arctracker.h header file, so I deleted them all (including two unimplemented function declarations and one commented-out function declaration), except for the unimplemented Desktop Tracker effect commands. Although it seemed unlikely these ever would get implemented now, I left them there because they theoretically exist in some modfiles out there.

Previous: Resampling | Next: How I Learned to Love Floating-point Arithmetic