Community > Project / Coder's Corner

Where can I start learning about programming a module player?

(1/3) > >>

wow25:
Hi! The title is pretty much what I'm asking. I've been looking through the Openmpt source code (https://source.openmpt.org/browse/openmpt/trunk), and specifically openmpt123, to try and understand how it works. However, the complexity of the project has confused me, and I was wondering if there was a more 'simplified' player or guide I could look into.

For background, I'm no stranger to programming (though c++ isn't my strongest language), but I know very little when it comes to audio programming. I'd love to learn this stuff, either to make my own kind of player, or to contribute somehow!

Thanks!

Saga Musix:
There will always be some complexity because the original trackers, typically being written by teenagers and young adults with no industry standard to define formats etc., often lack proper documentation, a lot of implementation details are hidden inside the original assembly code... Getting started is often easy, but you cannot expect that your results will be accurate. OpenMPT's code in particular is complex because
1) it supports dozens of formats.
2) it does its best to emulate the various little quirks of the trackers used to write those formats.
3) it is designed to be used by other software and thus has high standards with regards to security and standard conformance.

It will probably much simpler if you start out with writing a player for a single format, and if you don't care about getting every detail right. Basic understanding of how audio programming works (volume, panning, resampling with interpolation) would be very useful, too.
If you want to start with the ProTracker MOD, you can check out this tiny MOD player source. It will definitely not get every detail of the MOD format right, but it's a good start. 8bitbubsy's ft2play may also be interesting if you want to get into the XM format, as it's a direct port of the original FT2 source (so it's very accurate but might not be easy to follow).

In the end, once you have grasped the basic concepts (which these two examples may help with), writing a player for yet another format will become much easier, as it's the same stuff over and over again, just with some details being different here and there. Those details add a lot of complexity once you want to support all of those formats in a single engine (like OpenMPT does), though.

wow25:
These look perfect! I'll do my best to learn it on my own (and with online resources), but I may come back here with a question or two if I'm having trouble.

Thank you for the help, and thanks for all the hard work you put into this site and OpenMPT!

Saga Musix:
You're welcome. You may also have a look at the OpenMPT development forums and ask technical questions about the source or how to implement certain aspects of a mod player there.

wow25:
So after about a month of diving into your sources I've made a pretty good understanding, though I still think there's stuff I need to learn. I wasn't able to make the tiny mod player work, which was likely my own inexperience. I instead focused mostly on the ft2 player which, as you said, was more difficult to understand.

Do you know of any other simple players that I could look into? This stuff really is cool!

Navigation

[0] Message Index

[#] Next page

Go to full version