Page 1 of 2

MINIFMOD 1.7 (statically linked XM player library)

Posted: Thu Jan 29, 2004 5:31 pm
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

Re: MINIFMOD 1.7 (statically linked XM player library)

Posted: Thu Jan 29, 2004 7:09 pm
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...

Posted: Thu Jan 29, 2004 8:28 pm
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!

Posted: Sat May 15, 2004 6:51 pm
by OmeCloak
The link is dead, anyone got this file?

Regards, Cloak.

Posted: Sat May 15, 2004 10:01 pm
by thefool
in the bottom of the page that the first link links to.

Posted: Fri Jul 23, 2004 2:30 pm
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.

Posted: Fri Jul 23, 2004 3:27 pm
by gnozal

Posted: Fri Jul 23, 2004 3:32 pm
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.

hm

Posted: Tue Aug 10, 2004 9:24 pm
by Kendrel
i could need this purebasic library if someone has already converted it...
the download link here wont work ;(

Posted: Tue Aug 10, 2004 10:40 pm
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.

hmm

Posted: Wed Aug 11, 2004 9:55 am
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

Posted: Wed Aug 11, 2004 10:31 am
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

ah

Posted: Wed Aug 11, 2004 10:43 am
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 :)

Posted: Wed Aug 11, 2004 3:35 pm
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)

Posted: Sun Dec 18, 2005 9:07 pm
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 :|