My name is BASSGMS, I’ll be your interpreter for today

I’ve for a long time found GameMaker‘s audio engine to be too limiting. particularly in the background music department.  That’s why I choose to use an external audio library to handle the background music.

Long story short, GameMaker only allows you to use MP3s for background music, and the only flexibility you have for it is whether you want it to loop back to the beginning or not when it reaches the end.  That’s why I prefer to use MO3 modules for my background music.  MO3s are tracker modules with MP3- or OGG-compressed samples rather than straight PCM samples.  In simpler terms, MO3s combine MP3- or OGG-compressed samples with data on how to play those samples.  Looping is internal to the MO3 itself and is seamless,  allowing you to theoretically have an infinite-length MP3/OGG quality music in a few megabytes, or even less.


The only library I know of is BASS, whose developer, Ian Luck, also created the MO3 module format.  Getting BASS to work with GameMaker isn’t as easy as just importing the DLL into the project.  They can’t communicate with each other due to incompatible data types used in their functions.

I’m sorry, I don’t understand your funny accent.

(For those coders playing at home, GameMaker‘s only two types, real and string, are equivalent to the C types double and char* respectively.)

The solution was to create my own wrapper library, which I dubbed BASSGMS, that translates the functions in BASS in a way that GameMaker can work with.  In the heart of BASSGMS (and any wrapper DLL I may create in the future) lies these magic words that make everything possible:

What is this sorcery?!

To this day, I still only have a vague understanding of how to code DLLs.  All I know is it works like voodoo magic.

Copyright © Quadolor Games. All rights reserved.

Leave a Reply

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