The MOD Object plugin allows you to play module audio files in your game. Module files contain patterns of music data, instruments to play, and timing information. MOD can be considered a hybrid file format; like a combination of a MIDI and WAVE file. A benefit of module files is that they will sound the same on any sound card played, unlike MIDIs. The files supported include .mod, .it, .s3m, and .xm. A popular site for hosting module files is modarchive.org .
Mark the MOD object as Global in its Common properties, and place an instance on the first layout. The object will now appear in all layouts, and will be the only instance you need in your entire application. If you do not use a global MOD object, only use one per layout.
- Plays the current loaded module file.
- Stops playback
- Toggle pause
- Toggles music from playing to pause and back.
- Load file
- Takes one parameter, the name of the file to load. Note that if the file is in the same location as the .cap then you do not require the path. If it is not then make sure to include the relative path from the .exe or .cap. For example, if the audio.xm file is in a "music" sub-directory then specify the parameter as "music\audio.xm". You can only play module files from external resources.
- Skip to the next position in the module file.
- Skip to the previous position in the module file.
- Is paused
- True if the music is currently paused
- Is playing
- True is the music is currently playing
- Get current file (.GetFile)
- Returns the name of the current loaded file
Module audio files can be a unique choice for music because of their synthesized sound. Another benefit is that you can skip ahead and back in the file to different positions. This simple example shows loading, pausing, and moving positions in a module file.