Mod Reader v000 launched!

It’s here, the thing I’ve been working on for more than a month of countless nights. It’s a PHP mod file reader and it works bloody great!

The project started when I was thinking about hosting my old mod collection so that others could enjoy it. I wanted to make it a bit more informative than a directory listing though. I wanted to display the song title from inside the file, channels and file size.

After reading up on the mod file format and opening my mind to new concepts, I did just that. I created a nice little php script that could open and parse the mod file format and return the info I wanted. But wait… there was more goodies buried in the format. Things like the sample list which frequently contains messages from the author plus there was the holy grail, estimating the song length.

I kept working on more features each night, after a bit I was able to read the sample list messages, sample size, loop info and more. Things were going really well and I was learning a lot of new programming skills reading through these binary files. I decided that I would try to loop through all the pattern data and figure out how long each song is. What a quest it would be.

I started our reading the first note position then move on to different channels, rows and then finally patterns. I kept adding new functionality each night. An order reader, recording speed/bpm changes, delay effects, order jumps, pattern jumps and eventually odd song loops. It took me countless hours of work and quite a few major code changes along the way. Each problem brought with it more puzzles and eventual enlightenment when I figured out what was going on.

I can truly say I feel more like a programmer now more than ever. I’ve taken my lust for knowledge applied to to my beloved music collection and learned a lot of stuff along the way. I feel one step closer to my ultimate dream of becoming a video game programmer. I don’t know how long it will take or if I’ll even be successful but I know I’ll enjoy the quest and I will make a video game one day.

So without further ado please check out the new Music section which contains over 200 mod songs. Enjoy!


Damn it feels good to be a programmer!

At 10:56pm EST I finally accomplished what I thought would take me ages. I successfully used PHP to read in a mod music file, calculate hz/bpm/speed changes and account for special pattern break commands which jump ahead to the next bit of music . When all these complex calculations had finished my beloved, hand crafted, limited edition, mod reader told me the test song was 4:12 minutes long…

So what was the real length of the song as reported in a full mod file player such as Winamp? Yep, you guessed it. 4:12 minutes! Woohoo!

I feel like a programmer now more than ever. I took on a massive challenge and it payed off big time. I also learned a lot along the way including a better understanding of binary+hexadecimal formats, time calculations, C code and an intimate understanding of the mod file format. Oooh sexy.

Music is something I’ve always been in love with and one of the few things I have a really good memory for. To be to use my new programming skills to build a system for sharing that music makes me feel quite giddy inside.

So, what’s next on the agenda? Forging the last few bits of code to handle advanced features like “position jump” and “pattern delay”. These effects are not used in every mod song but I want to create a really complete reader than can tackle my whole collection.

Once those bits are done it’s on to code optimization (I already have some good ideas on this) and beautification before finally launching the new music section.

It’s funny how this litte self created project turned from a simple title/sample listing to a full fleged mod reader.

Ah the passion, she is back.


Mod Madness

I been working like a mad man on the PHP mod file reader. I make really good progress each day, usually adding one major stepping stone to completion and learning a whole bunch of cool stuff on the way.

Tonight’s code stepping stone was reading in the order of the song and then looping through only the patterns that I needed to calculate BPM and song time. Tomorrow I’ll try add some code to tally up all the speed change commands and use it on a test mod to make sure everything gets calculated accurately.

Perhaps when I finish up the reader and post my mod music collection for all, I’ll reward myself with a brain vacation for a few days, not thinking about anything. Hopefully it will include watching TV, playing video games and sleeping a lot. :)