MINIFMOD 1.7 (statically linked XM player library)

Windows specific forum
f0rward3r
New User
New User
Posts: 1
Joined: Thu Jan 29, 2004 5:25 pm

MINIFMOD 1.7 (statically linked XM player library)

Post by f0rward3r »

attached some some XM player library which will statically link to your pb exe.

for more information have a look at 'http://www.fmod.org/fmoddownload.html' (bottom down to the bottom of the page).
MINIFMOD 1.7


This small XM replay system only adds 5k to your exe! Now including FULL SOURCE CODE!!!
FEXP tool to export a header based on your song, which will be compiled into MiniFMOD and exclude whole portions of code!
Pre-buffered output for 0 latency, and high output stability
100% click free.
XM sample callbacks for user generated or compressed XM samples!
File system callbacks so you can specify whatever loading system you like! (disk/wad/memory)
btw: i dont think that official fmod license applies to this module. use it, abuse it. its your problem - not mine :)

ddl: http://www.v40.net/members/minifmod170

copy that file to your userlibrarys and use it as follows:

MFMInit(?xm, 8603)
MFMPlay()
MessageRequester("..", "..")
MFMStop()
MFMClose()

DataSection
xm:
IncludeBinary "chiptune.xm"
EndDataSection


1.) init the library and let it import the xm data. first param=xm data, 2nd: size of xm data

2.) let it play

3.) to stop playing use MFMStop()

4.) use MFMClose() to shutdown the library
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: MINIFMOD 1.7 (statically linked XM player library)

Post by traumatic »

I think you should note that you took out the possibilty to set own IO callbacks.

I did this once (it was v1.4 back then) and let the user choose within purebasic:

Code: Select all

CompilerIf #usememload=1
  ;
  ;----MEMORY CALLBACKS---
  ;
  Structure MEMFILE
   length.l
   pos.l
   mdata.l
  EndStructure

  memfile.MEMFILE


  ;
  Procedure.l modopenmem(name.s)
    Shared memfile
    memfile\mdata = Val(name)
    memfile\length = ?modend - ?mod
    memfile\pos    = 0 

    ProcedureReturn memfile
  EndProcedure

  ;
  Procedure.l modclosemem(handle)
  ;  FreeMemory(0)
  EndProcedure

  ;
  Procedure.l modreadmem(buffer.l, size.l, handle.l)
    Shared memfile
   
    CopyMemory(memfile\mdata+memfile\pos, buffer, size)
    
    memfile\pos + size  ; update filepointer position
    ProcedureReturn size
  EndProcedure

  ;
  Procedure modseekmem(handle.l, pos.l, mode.l)
    Shared memfile
   
    Select mode
      Case #SEEK_SET
        memfile\pos = pos
      Case #SEEK_CUR
        memfile\pos+pos
    EndSelect
    
    If memfile\pos > memfile\length
      memfile\pos = memfile\length
    EndIf
  EndProcedure

  ;
  Procedure.l modtellmem(handle.l)
    Shared memfile

    ProcedureReturn memfile\pos
  EndProcedure


  CompilerElse
  ;
  ;----FILE CALLBACKS---
  ;
  Procedure.l modopen(name.s)
    Shared filptr
    fileptr = ReadFile(0, name.s)
    ProcedureReturn fileptr
  EndProcedure

  ;
  Procedure modclose(handle.l)
    Shared fileptr
    CloseFile(0)
  EndProcedure

  ;
  Procedure.l modread(buffer.l, size.l, handle.l)
    ProcedureReturn ReadData(buffer, size)
  EndProcedure

  ;
  Procedure modseek(handle.l, pos.l, mode.l)
    Select mode
      Case #SEEK_SET
        FileSeek(pos)
      Case #SEEK_CUR
        FileSeek(Loc()+pos)
    EndSelect
  EndProcedure

  ;
  Procedure.l modtell(handle.l)
    ProcedureReturn Loc()
  EndProcedure
CompilerEndIf
Well, just an idea...
Good programmers don't comment their code. It was hard to write, should be hard to read.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

@f0rward3r:

Wow ... cool. I really like it. Used in previous little productions Fred's MXM-Lib, but FMod's quality of xm-playing is far better.

Would it be possible to add functions like setting volume, getting information of the actual sample / row / position which is played !?

Anyway, good work. Thx 4 sharing!
regards,
benny!
-
pe0ple ar3 str4nge!!!
OmeCloak
User
User
Posts: 13
Joined: Sat May 15, 2004 6:27 pm

Post by OmeCloak »

The link is dead, anyone got this file?

Regards, Cloak.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

in the bottom of the page that the first link links to.
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i was searching this library, and i didn't found it, someone can send me the library to my email(balrog@balrogsoftware.com? thanks in advance.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi Gnozal, i downloaded this file, and it is not the static library, this is a .lib library that can be transformed with LibImporter, but it don't have the same commands that the static library.
Kendrel
User
User
Posts: 58
Joined: Fri Apr 25, 2003 7:00 pm

hm

Post by Kendrel »

i could need this purebasic library if someone has already converted it...
the download link here wont work ;(
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i found it on my old computer, i upload it to my site:

http://www.balrogsoftware.com/downloads/Minifmod

I don't found the original pack, i found installed on PB.
Kendrel
User
User
Posts: 58
Joined: Fri Apr 25, 2003 7:00 pm

hmm

Post by Kendrel »

thx...
MFMInit(?xm, 8603)

if i init like that the files wont playback properly... i dunno what the "8603" is used for, but i replaced it with 44100 as i have seen the init similar in the c-example coming with minifmod... anyone knows more about that PB commandset now? i mean whats possible and whats not...

edit:

the 44100 is plain bullshit :)

the higher the number more files are played correctly... strange stuff.. any infos are welcome... thx
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

i dunno what the "8603" is used for, but i replaced it with 44100 as i have seen the init similar in the c-example coming with minifmod
Answer:
MFMInit(?xm, 8603)
first param=xm data, 2nd: size of xm data
--Kale

Image
Kendrel
User
User
Posts: 58
Joined: Fri Apr 25, 2003 7:00 pm

ah

Post by Kendrel »

thx alot...

weird that i didnt get any errors when the value was far to high... hmmm

so the exact size of the xm isnt needed really from what ive testet around... not sure though :)
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

@Kendrel:

I guess you reserve the amount of memory for your module with
the second parameter of MFMInit(). So, if you reserve more memory
than the actual xm-module takes there may be no problems. However,
this isn't very "memory-friendly".

An easy workaround could be this, in DataSection embrace your module
with an Start and End-Label:

Code: Select all

DataSection 
xmStart: 
 IncludeBinary "your.xm" 
xmEnd:
EndDataSection
Then you could use the Init-Command as follows:

Code: Select all

MFMInit(?xmStart, ?xmEnd-?xmStart)
regards,
benny!
-
pe0ple ar3 str4nge!!!
Glow
User
User
Posts: 10
Joined: Sun Dec 18, 2005 9:03 pm

Post by Glow »

Sorry for bringing this old topic back to life, but I could need that library as well. I tried a version of minifmod_pb but it doesnt support the MFMinit() syntax. I have some old Source-Codes were I used this library, but I deleted all my old stuff when I updated PB to V3.94 :(
So if anyone has this library somewhere around, a link would be highly appreciated :)
The link in the first post is more than dead - it redirects me to google :|
Post Reply