ANN: MikMod External (mod and mod-like playing library for MacOS X)

Andre Garzia andre at andregarzia.com
Sat Sep 22 17:38:44 EDT 2007


Aloha my friends,
Now I bring to you folks an external that wraps around MikMod <
http://mikmod.raphnet.net/> library. This is aimed at game and multimedia
developers. Mod files are the best format to use in games since you can
change properties and loops inside the music at runtime. They are also very
small.

MikMod is released under LGPL, so I can't profit from this. To respect the
original license I am releasing both the bundle and it's source code.

I've built only for MacOS X because I use Carbon Threads to play the music
(actually to update the music player) in another thread so you can play
songs without any performance penalty (a must for game development).

This external was tricky to build because I had to include a framework
(mikmod framework for core audio) inside the external bundle...

Included in the download are an example stack and some sample songs from
modarchive.org

Page is here: http://andregarzia.com/revmikmod.html

I've exposed just some of the MikMod calls, just enough to get us all
started, the calls are:

RevMikModInit - initialize library.
RevMikModClose - close library.
RevMikModPlay <file> - plays the given file path.
RevMikModStop - stops playing.
RevMikModPause - pauses playing.
RevMikModResume - resumes playing.
RevMikModGetData(<key>) - returns some data based on the key given.
Keys:
songname:   name of the song
modtype:     string type of module loaded
comment:     module comments
  numchn:     number of module channels
numvoices:     max # voices used for full NNA playback
numpos:     number of positions in this song
numpat:     number of patterns in this song
numins:     number of instruments
numsmp:     number of samples
realchn:     real number of channels used
totalchn:   total number of channels used (incl NNAs)
initspeed:   initial song speed
inittempo:     initial song tempo
initvolume:     initial global volume (0 - 128)
  bpm;       current beats-per-minute speed
sngspd:     current song speed
volume:   song volume (0-128) (or user volume)
patpos:   current row number
sngpos:     current song position
sngtime:     current song time in 2^-10 seconds
RevMikModSetVolume <0-128> - sets the volume.
RevMikModSetTempo <1-32> - sets the tempo.
RevMikModSetSpeed <1-255> - sets the speed.

This is my second external... :-)

Cheers
andre



More information about the use-livecode mailing list