Adding music to our intros using Protrekkr

For months I’ve been searching for a music player for the 64k intros. There ale lots of tools and players for Windows, but only a few for mac. Nowadays, I’ve only found a modified version of minifmod and some custom players (with very low quality).

I started searching and asking and Gargaj^Conspiracy told me about protrekkr (poüet). Protrekkr is a tracker developed by hitchhikr and the missing Arguru, with some nice features, two of them are: is multiplatform and has a reduced player (ideal for our mac intros!).

So… let’s get to work!

1. First we need to download the package from the Protrekkr page: http://code.google.com/p/protrekkr/

2. Then, we need to do a song. If your music capabilities are so amazing as mines, you should download the modules pack that is available also in the downloads page.

3. Once we got the song open, we should export the song to the PTP format, with the “Save.ptp” button (in “Disk IO” menu). In the following image, I’ve used the “devenirunpoulet” song

This will generate 2 files: one PTP file and another .h file (ptk_properties.h).

4. Now we can close the tracker and move this 2 files to the “replay” folder.

5. Configure the name of the module: go to “test” subfolder and edit the “module.macosx” file:

MODULE = "devenirunpoulet.ptp"

6. Compile the music player: go to “replay” folder and execute the following command in the console:

make -f makefile.macosx

Important NOTE: Depending on the MacOSX version that we have we will need to modify the makefile.macosx file in order to use the right SDK version (I’m talking about the line of the g++ command). For example, for compiling using the snow leopard SDK we need to modify this line:

g++ -o replaytest_x86 -s -isysroot /Developer/SDKs/MacOSX10.6.sdk -L./ $(FLAGS_X86) $(EXEOBJS_X86) $(LIBS_X86)

7. Once the process is finished, we will have some files, some of them are:

  • replaytest_xxx: This executable can be used in order to check how the song sounds. We can send this file to the music, so he can validate that the music sounds good in the “mini” player.
  • module_xxx.o: This is the object of the module. We will use this later in our intro.
  • libptkreplay_xxx.a: the music library, optimized for the song that we have specified.

During this process the player has been customized, using only the necessary methods that our song requires. Saving some space.

8. Now we have to configure the Xcode project:

  • Add 2 frameworks: AudioUnit and CoreAudio.
  • Add the 2 previously generated files into our target: libptkreplay_xxx.a and module_xxx.a (thanks winden and xeleh!)

9. Almost finished! Now we just need to copy the folder replay/include to our project and start using the player (you can find an example of usage in replay/test/test_macosx.cpp), for example:

NOTE: I’ve added one define (I don’t know why, but without this define, it does not work :P)

Finished!! as always, any feedback is welcome! Happy coding!!!

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

spammer, go home! * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.