Open Source Midas alternative - MikMod

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Amiga5k.

Hello all!

Fred, maybe you've heard of this before: I was searching on the net for various tracker formats because I wanted to create a simple mod player (preferably in ASM) that only plays one or two types of mods (to keep it as small as possible) and I came across this open source program called MikMod. It's quite powerful!

Do you think this would be fairly easy to adapt into PB, making the licensing issues with Midas a thing of the past? It can be looked at and downloaded at http://www.mikmod.org

I also found a VERY small (~25k) and fast (written entirely in asm) free mod player with source (useable under the gnu rules) called starplayer which can be found here:
ftp://ftp.it.net.au/pub/people/jedi/sp-code.zip
The only problem is that it's not really portable (written in protected mode asm), and it's for dos.

Anyway, is this something worth looking into? I think the MikMod lib is the way to go, for its overall power and portability, but the other is very fast and may be adaptable to Linux via Fasm? (Amiga would be out of luck, however :wink:

What do you think?

Russell

***Commodore 64 - Over one million cycles per second, 16 vibrant colors, 3 incredible audio channels and 38,911 Basic Bytes Free! Who could ask for anything more?***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I've done a quick conversion of MXMPlayer, not very good included in PB (you can not use the regular sound lib with it) but if you only need module playing (demomakers...) it will be the right choice: 10 kb uncompressed. And it's free. Take a look at http://www.purebasic.com/MXMModule.zip
BTW, the Amiga already has full support for Protracker module.

From the readme file:

Code: Select all

* -------------------------------------------------------------------------------- *

            MXM support for PureBasic - Done by AlphaSND

* -------------------------------------------------------------------------------- *


1. What is it ?
---------------

  This is a quick support of MXM module format support for PureBasic. This
  has be done, as this is actually the smaller module replayer available for
  Windows. This is firtly for the demomaker which can easily do an executable
  under the 32 kb or 64 kb limit with module support. The routine is only 
  11 kb uncompressed and is full featured. The format itself is a variant of
  the XM (Fast Tracker) format and you need to use the tool Xm2MXm.exe 
  to convert them:
  
    C:\>Xm2MXm.exe Module.xm Module.mxm
  
  
2. License
----------

  This replayer can be used freely as nothing against it is stated either in the sources
  or in the main archive.
  
  
3. Limitations
--------------

  This module support is very basic as you could imagine be do its job. Limitations are 
  the following:
  
    - You can not use the regular sound/module library if MXM is used
    - Only one module can be loaded/played at the same time
  
    
4. Credits
----------

  Thanks to ELITEGROUP for this great piece of software !

      Enjoy,
      
          Fred - AlphaSND

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by THCM.

Yes, Fred I must have done something wrong asking You doing it for money! Is should have asked kindly in the forum and ooops you did it again!

Good work Fred! Keep on!

The Human Code Machine / Masters' Design Group
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by THCM.

Fred you should include the Xm2MXm.exe tool to the zip-file, since not all user have the needed tool to convert the tunes to mxm format!

Yours

The Human Code Machine / Masters' Design Group
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Num3.

It can be found here:

http://www.elitegroup.demo.org/demo.html

--
Kind Regards
Rui Carvalho

Old programmers never die... They branch into a subroutine...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.
Originally posted by THCM

Yes, Fred I must have done something wrong asking You doing it for money! Is should have asked kindly in the forum and ooops you did it again!
Yes, I finally found some time to do it.. No need for extra money here :).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by raphael.
Originally posted by fred

I've done a quick conversion of MXMPlayer
this is cool, though mxm isn't fully xm-compatible.
some xms just don't sound right - of course not your fault but a limitation of the mxm format i guess...

btw. you should have said that there're also the two
most needed commands for synchronisation included:

GetMXMModuleRow() and GetMXMModulePosition() !


anyway, thanks for this lib!
any other libs on your hd you might want to share? :wink:
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by raphael.
GetMXMModuleRow() and GetMXMModulePosition()
well, they don't work as aspected. kind of a 'look ahead' function.
i have to decrease the current row by 2 to get the real sync.
maybe that's why you didn't mention those :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by raphael.

ok, i'll stop posting now... :wink:

only one last thing:
leaving the compression entirely to upx shrinks
the exe down to 9.760 bytes wheras your approach
using unpackmemory() raises the size up to 11.296
bytes... funny, isn't it?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

No it's because upx can compress the data and the exe which give a better overall ratio.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Amiga5k.

Good work, Fred! I have a few quetions, etc, though ... Will this player be adapted to the Linux version of PB as well? Is mxmplay 'banging the hardware' directly the reason that the other sound functions can not be used while it's playing? Can this be fixed (probably fine for demo-creation, but not for games :cry:)? Are the other two options in the original post still a possibility? (adapting mikmod, or using the asm source for StarPlayer)

Oh! After MUCH searching, I've gathered a fair amount of documentation on the internet for the major tracker formats (669,mod,s3m,xm,it, etc - many of these docs are very detailed!), as well as the major gfx formats (gif, pcx, iff, jpg, etc) and I was wondering if this would be useful to anyone besides me? :) If so, is there a "PB Tools" area in particular I could upload them to?

Thanks!
Russell

p.s. Num3, I went to http://www.elitegroup.demo.org/demo.html and could not locate the xm2mxm.exe..... Oh, there it is, inside the zip file "e-mxmpw.zip" (although including it with PB would be cool.)

***Commodore 64 - Over one million cycles per second, 16 vibrant colors, 3 incredible audio channels and 38,911 Basic Bytes Free! Who could ask for anything more?***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Num3.

Sorry my mistake :)

The converter is inside the "e-mxmpw.zip" download

--
Kind Regards
Rui Carvalho

Old programmers never die... They branch into a subroutine...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Amiga5k.

I downloaded the whole shmear and it plays decent, but I noticed that the .xm and mxm file sizes were virtually identical. So I wonder why they went through all the trouble of developing a new format with no noticable advantages? Why not just support .xm? Speaking of which, the website http://www.wotsit.org is an excellent source of info for various formats (tracker, music, 3d object, gfx, etc). Looks like I won't need to post my info after all :)

I think I'm still going to write a .mod and/or a .s3m player just for a challenge. First in PB and then, if I'm up to it, in Fasm. Then I promise I'll make the source(s) available for free, including commercial use.

Russell

p.s. Would a .dll or built-in PB function be of more use?

***Commodore 64 - Over one million cycles per second, 16 vibrant colors, 3 incredible audio channels and 38,911 Basic Bytes Free! Who could ask for anything more?***
Post Reply