Monkey Island Sound Files Redux

There is a functional WIN32 console player available which functions with the Monkey Island sound data files. Remember, the full sound data files are available in the Monkey Island demo. With this console player, you can extract useful info from the data files. You simply need to run tfmxplay with the -i flag. Of course, you can actually play them also and individually select each song to track to play.

>tfmxplay -i mdat.MonkeyIsland
4 voice TFMX module: mdat.MonkeyIsland
Date : 02.01.91
Time : 13:33

49 tracksteps at 0×0800
128 patterns at 0×0400
128 macros at 0×0600

Song 0: start 800 end 900 tempo 202
Song 1: start 400 end 500 tempo 144
Song 2: start 600 end 700 tempo 202
Song 3: start a00 end d00 tempo 144
Song 4: start 2800 end 2d00 tempo 176
Song 5: start 1100 end 1200 tempo 172
Song 6: start 1300 end 1400 tempo 98
Song 7: start 1500 end 1600 tempo 200
Song 8: start 1700 end 1800 tempo 88
Song 9: start 1900 end 1a00 tempo 104
Song 10: start 1b00 end 1c00 tempo 210
Song 11: start 1d00 end 1e00 tempo 126
Song 12: start 1f00 end 2000 tempo 90
Song 13: start 2100 end 2200 tempo 71
Song 14: start 2300 end 2400 tempo 142
Song 15: start 2500 end 2600 tempo 148
Song 16: start 2e00 end 2e00 tempo 0
Song 17: start 100 end 300 tempo 5
Song 18: start 2f00 end 2f00 tempo 4
Song 19: start 3000 end 3000 tempo 5
Song 29: start 2900 end 2a00 tempo 176
Song 30: start 2f00 end 2f00 tempo 4
Song 31: start ff01 end ff01 tempo 0

Subversion Mistakes

In an effort to get my ScummVM branch to compile in Visual Studio, I copied some newer project files updated and maintained by other developers who use Visual Studio as well. These updated project files fixed some compilation bugs and warnings. However, the updated project made reference to some non-existent files in my directory structure, specifically in the /engines/gob/ folder. So my solution was to copy the updated code from /engines/gob/ directory of the main trunk to my branch and then update. The updates ending up affecting the entire folder and committing 47 changed files in /engines/gob to my branch. See the update history here. It turns out this is a poor method for taking updates from the trunk. The updates now seem like I was the one committing the code changes which not only messes with the revision history, but also makes it more difficult to re-merge my branch back to the main trunk when the project is completed. This was a silly mistake which will end up causing some trouble which will require some manual fixing.

In order to properly manage updates from the trunk and implement them in my branch, the svnmerge.py tool is necessary. The tool and directions for use can be found here. This tool, when installed in your working directory, will properly manage updates from the trunk. It is also helpful when merging branches back to the trunk.

Development Platform

I’ve decided to settle on Microsoft Visual Studio 2008 Professional as my development platform of choice for this project. I have not made the move to Linux where there are more free tools available by choice since adapting to Linux will take some valuable time out my schedule. Sticking strictly to Windows where I have the most experience and using Visual Studio, which I also use for work, seems like the best idea. The great thing is Microsoft is offering a whole boatload of expensive development software to students for free, including Visual Studio 2008. This is probably a great opportunity for other GSOC students out there so if you didn’t already know, check out Microsoft DreamSpark.

ScummVM is hosted on SourceForge.net like many other open-source projects and uses Subversion for version control. My SourceForge username is marwanhilmi and I’ve been attached to the ScummVM project. You can view the repositories here. A branch was created for my work on the project named “gsoc2008-tfmx” which you can view here.

In order to handle code updates and commits with Subversion, I’ve opted to use TortoiseSVN client for Windows. You can find it here. It is very slick and interfaces directly into Windows right-click context menus. You can update code and make commits with a couple of clicks.

If you are not familiar with Subversion, there is a great O’Reilly book available for free here.

Compiling my ScummVM branch with Visual Studio proved to be a little tricky initially. Fortunately, some of the other ScummVM developers also use Visual Studio and some fixes and updates were already committed to the main trunk. After downloading the new VC-Project files and some other updates, I was able to properly compile and run the code. Some information regarding compiling ScummVM in Visual Studio can be found here.

Monkey Island Sound Files

In order to implement proper support for the AMIGA version of Monkey Island, the TFMX interpreter developed obviously needs to function correctly with Monkey Island’s data files. In turns out, after some poking around, that the demo version of Monkey Island has the complete audio track in it. You can obtain a copy of the demo here. The demo is in .lzh format, a disc image format for the AMIGA. You can actually extract the files from the demo using WinRAR or other command line utilities if you are on Linux. The audio files are music.dat and sample.dat contained in the Rooms sub-directory. Comparing these files to the files from the actual full AMIGA version of Monkey Island shows they are identical. The files from the full version have the same structure, headers, and size.

Demo Files
sample.dat 179,380 bytes
music.dat 46,704 bytes

Full Version Files
sample.dat 179,380 bytes
music.dat 46,704 bytes

If have a copy of the full version you can check them and compare for yourself.

Calm Before the Storm

Time is moving really quickly and the official start of coding is looming ever closer. Progress on my research and planning phase is moving as expected. Thanks to the friendly visitor Triton, I’ve obtained a restructured version of the tfmx-play code. The tfmx-play module floating out there was functional but a nightmare in terms of readability and reusability. This restructured version definitely helps out so much thanks to Triton again. I’ve also spent some time poking around with the PAULA emulator in order to gain a better understanding of the information it requires in order to process audio.

I plan to spend time over the weekend experimenting with the PAULA emulator and the existing audio classes. Big updates to the site are coming over the weekend as well so stay tuned.

We’ve Received Your Order

I decided in order to get a better understanding of the fundamental concepts used in all digital audio systems, I would need to do a little background reading. I searched for the right books until I found what I was looking for; Musimathics: The Mathematical Foundations of Music. Over two volumes, it seems like it covers all the right topics especially regarding the digital sampling of audio. All of this stuff does not directly apply to the coding that needs to get completed, but it will provide some important clarification regarding some key fundamental topics. Check out the links below.

Musimathics, Volume 1: The Mathematical Foundations of Music
Musimathics, Volume 2: The Mathematical Foundations of Music

Playing around with the file structure of the AMIGA Monkey Island demo, I’ve managed to extract the TFMX audio files. Fortunately, from my initial digging around, it seems that the demo actually contains the entire music track for the full game. More on this later.

In the meantime, Grand Theft Auto IV has me a little distracted…

GTA IV

The Summer Begins

Hello folks and welcome to my blog. My name is Marwan Hilmi. I am a 21 year old Computer Engineering student at Concordia University in Montreal, Canada. I’ll be using this site to keep track of progress as my Google Summer of Code project for ScummVM gets underway.

Google Summer of Code aims to encourage students to become involved in open-source software development. I’ve chosen to apply my knowledge of C++ and my love of games to aiding in the development of ScummVM. As a collection of virtual machines, ScummVM allows users to play a variety of classic games on several platforms. As I grew up playing many of the LucasArts classics that ScummVM was built to support, I was immediately drawn to this project. Specifically, my task involves creating an interpreter for two audio formats commonly used in AMIGA games. This interpreter will read TFMX files from “The Secret of Monkey of Island” and MaxTrax files from “The Legend of Kyrandia: Book 1″. This interpreter will be built on top of software emulated PAULA hardware (the native AMIGA audio chip). I’m glad to have been accepted as one of six students and look forward to getting started.

For more information, check out the links below. Feel free to stop by and make comments anytime! Stay tuned because many updates and changes will be coming. You can also reach me at the contact information given below.

EMAIL: mhilmi@gmail.com
MSN: marwanhilmi@hotmail.com
IRC: mhilmi on Freenode

LINK: ScummVM homepage.
LINK: GSOC 2008 homepage.
LINK: GSOC ScummVM profile.
LINK: My proposal.