Author Topic: [C++] The best/smallest c++ mod player is... ?  (Read 8644 times)

0 Members and 1 Guest are viewing this topic.

Offline Blacksheep8Bit

  • *Custum Title goes here*
  • C= 64
  • **
  • Posts: 91
  • Karma: 36
  • *useless thing to write goes here*
    • View Profile
So, i was wondering, whats the best or smallest xm/mod player? Where i can find it and how to use it with my demo.

I've already asked in pouet forums, but they told me i would get better results posting the question here, and please, no BASSMOD, because the dlls is not small, 34kbs is alot if you want to make 64k demos :D
Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 267
  • Karma: 7
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #1 on: February 07, 2012 »
Welcome BlackSheep8Bit...

  • ufmod
  • minifmod

You may want to check out this thread here for some info.


Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #2 on: February 07, 2012 »
Hi BlackSheep8Bit. I saw the thread on Pouet the other day :)

Personally, I use Minifmod to do what you're trying to do. It's fairly small and allows me to embed both the player and xm file in the exe. You could also do the same with uFmod I believe, but I've never tried uFmod personally. The replayer is probably a tiny bit smaller due to it being ASM rather than C.

I posted a couple of projects with source here for competitions a while back that has minifmod and an embedded XM in it. You can grab them here and here. I store the XM file as a resource in the project. You should find everything you need in that project to get you going.

The compatibility with Minifmod doesn't seem to bad at all to me personally, I've heard people bitch about it not playing all XM files well but it seems to handle everything I've thrown at it so far.

Not sure if anyone else here has used uFmod and can give you some idea of how many bytes you'll save vs minfimod. I understand you're making a 64k intro - good luck! I look forward to seeing it :)

Hope you stick around.

raizor
raizor

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #3 on: February 07, 2012 »
I've never tried uFmod personally. The replayer is probably a tiny bit smaller due to it being ASM rather than C.
uFmod is not only the smaller library, it also converts modules to a minimal and more compressor friendly format.
Although uFmod was originally based on miniFmod, it sometimes sounds rather different - so the mentioned conversion-process probably works a bit too optimistically.
uFmod's source-code is pretty much unmaintainable, though. You're fucked if it doesn't do what you want.
miniFmod on the other hand is all nice and smooth :)

Back in the days there was also mxmplay/w, a windows port of mxmplay (which was a mini-xm spinoff from cubic player) which gave birth to a couple of hacks.
In particular Sagacity/Thressstate included a (somewhat lossy) sample-compressor made by Digisnap/Matrix which was used here.
I doubt that there's any usable version of the player around, though.
« Last Edit: February 08, 2012 by hellfire »
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #4 on: February 07, 2012 »
Welcome aboard BlackSheep8Bit  :)

I made two examples for you to test, one using uFmod and another using miniFmod (a compiled version).

See which one you like more and start coding your demo/intro :)


Challenge Trophies Won:

Offline Blacksheep8Bit

  • *Custum Title goes here*
  • C= 64
  • **
  • Posts: 91
  • Karma: 36
  • *useless thing to write goes here*
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #5 on: February 08, 2012 »
Welcome aboard BlackSheep8Bit  :)

I made two examples for you to test, one using uFmod and another using miniFmod (a compiled version).

See which one you like more and start coding your demo/intro :)

Thank you for those exemples, i will make a good use of it!

Thanks everybody that helped me!
Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 267
  • Karma: 7
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #6 on: February 08, 2012 »
@rbz, ufmod sounds much nicer in your example binary than minifmod imo. I also noticed that the L/R channels are switched between the two.

Decent tune also ;)

Offline Blacksheep8Bit

  • *Custum Title goes here*
  • C= 64
  • **
  • Posts: 91
  • Karma: 36
  • *useless thing to write goes here*
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #7 on: February 09, 2012 »
So, it worked, but after i transformed my music into a .h, and included it, when i compile it i got "undeclared identifier", with both EFF and BIN2C (i also tryed BIN2H but nothing)

I Tried with 10 musics, none of them work.
Currently using Visual c++ 2010

I Tried with uFmod and miniFmod
« Last Edit: February 09, 2012 by BlackSheep8Bit »
Challenge Trophies Won:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #8 on: February 09, 2012 »
Quote
I Tried with 10 musics, none of them work.
Currently using Visual c++ 2010

I Tried with uFmod and miniFmod

so are yu able to post yur project?!
coding: jwasm,masm
hobby: www.scd2003.de

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #9 on: February 09, 2012 »
"undeclared identifier" means that there is no declaration for the particular item.

You need to pass your new song "array name" to ufmod / minifmod

Quote
static unsigned char secret_gardens_xm[] = {
0x45,0x78,0x74,0x65,0x6E,0x64,0x65,0x64,0x20,0x4D,0x6F,...................
};

On the example above, the song array name is "secret_gardens_xm"

So,  just use it like this:
Code: [Select]
HWAVEOUT* hWave = uFMOD_PlaySong(secret_gardens_xm,(void*)sizeof(secret_gardens_xm),XM_MEMORY);
Challenge Trophies Won:

Offline Blacksheep8Bit

  • *Custum Title goes here*
  • C= 64
  • **
  • Posts: 91
  • Karma: 36
  • *useless thing to write goes here*
    • View Profile
Re: [C++] The best/smallest c++ mod player is... ?
« Reply #10 on: February 10, 2012 »
"undeclared identifier" means that there is no declaration for the particular item.

You need to pass your new song "array name" to ufmod / minifmod

Quote
static unsigned char secret_gardens_xm[] = {
0x45,0x78,0x74,0x65,0x6E,0x64,0x65,0x64,0x20,0x4D,0x6F,...................
};

On the example above, the song array name is "secret_gardens_xm"

So,  just use it like this:
Code: [Select]
HWAVEOUT* hWave = uFMOD_PlaySong(secret_gardens_xm,(void*)sizeof(secret_gardens_xm),XM_MEMORY);
I Know, i tried everything and got this error :/



EDIT: I Found the soluction, i have to include first the music, then the part i use for play it ( my resource have 3 parts, 1. Framework, 2. Drawing/playmusic, 3. Music)

Actual order:

Framework
Music
Drawing/playmusic

Thanks everybody! :D
« Last Edit: February 10, 2012 by BlackSheep8Bit »
Challenge Trophies Won: