Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: Where can I start learning about programming a module player?  (Read 140 times)

0 Members and 1 Guest are viewing this topic.

wow25

  • Liking the Pie
  • Offline Offline
  • Posts: 2
    • View Profile

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!

Logged

Saga Musix

  • TMA Moderator
  • Too much pie
  • *****
  • Online Online
  • Posts: 2423
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: Where can I start learning about programming a module player?
« Reply #1 on: February 06, 2021, 19:29:18 »

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.
Logged
» My TMA artist profile
» Visit my music site: https://sagamusix.de/ [de, en]
» Visit my programming website: https://sagagames.de/ [de]
» Open ModPlug Tracker

wow25

  • Liking the Pie
  • Offline Offline
  • Posts: 2
    • View Profile
Re: Where can I start learning about programming a module player?
« Reply #2 on: February 06, 2021, 20:59:16 »

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!
Logged

Saga Musix

  • TMA Moderator
  • Too much pie
  • *****
  • Online Online
  • Posts: 2423
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: Where can I start learning about programming a module player?
« Reply #3 on: February 06, 2021, 21:40:54 »

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.
Logged
» My TMA artist profile
» Visit my music site: https://sagamusix.de/ [de, en]
» Visit my programming website: https://sagagames.de/ [de]
» Open ModPlug Tracker
Pages: [1]   Go Up