Using .Mod Files with Blitzmax. How do you do so?

BlitzMax Forums/BlitzMax Beginners Area/Using .Mod Files with Blitzmax. How do you do so?

WERDNA(Posted 2010) [#1]
Hey everyone!

Is there a module or something that lets you use .mod music files in BlitzMax?


Thanks,


xlsior(Posted 2010) [#2]
Yup, there's multiple options there:

Personally I prefer MaxMod2, but there's also a couple of wrappers for fmod and BASS.

IIRC fmod and bass both require licensing fees to be used in commercial software, though.


WERDNA(Posted 2010) [#3]
Thanks!, I'll poke around for a MaxMod2 link :)


WERDNA(Posted 2010) [#4]
MaxMod2 looks like a lot of trouble to set up without Allegro installed.
I checked the release date for the latest version of MaxMod2, and it was for 2005.
However the oldest available version of Allegro seems to be from early 2009.

So I have 2 questions.

1: Would Allegro still be compatible with MaxMod2 since its much more recent?

2: Do I need Allegro, or can I set MaxMod up anyways without it?


Thanks!


xlsior(Posted 2010) [#5]
There are several releases of Maxmod, and over the years there have been several changes in the sound rendering library.

They've used DUMB, older versions used DirectSound, and I believe that the original MaxMod used yet another engine.

You may have more luck using MaxMod 1, or one of the older releases of MaxMod2? (The older ones may not necessarily be worse. They may not have some of the dependencies of the later versions, but the biggest difference is how it renders the sound. The mod formats are really kind of hard to decode, since a lot of things are simply 'assumed' instead of spelled out. The same module doesn't always sound the same in all players.
However, if your particular modules sound good (and the vast majority of them do) then there is no reason not to just use an older version


WERDNA(Posted 2010) [#6]
Ok, I'll try setting it up today and post back if I have any problems :)

Thanks xlsior!


jkrankie(Posted 2010) [#7]
You can use BASS to play mod files, you can grab it from Brucey's SVN.

Cheers
Charlie


WERDNA(Posted 2010) [#8]
xlsior said BASS charges a licensing fee to use the files in a commercial program, and
since Ping Pong Battle will be a commercial program, I kind of have to stick with
maxmod2 ;(

I am having a bit of trouble setting up maxmod2 by the way, because this is the first
module I've ever used for BlitzMax, other than the built in ones.

If it wouldn't be too much trouble, could someone give me some step by step instructions
to set it up?

Thanks!


WERDNA(Posted 2010) [#9]
Followed the tutorial on the maxmod site, and when I try to import any of the maxmod2
modules, I get an error that says 'Can't find interface for module"Maxmod2.(Whatever I'm trying to load)" '

I can load the blitz modules just fine, just not these. I even ran two of the blitzmax
example programs, and they came up with the same error.

Anyone know whats wrong?

Thanks,


WERDNA(Posted 2010) [#10]
Well I found the problem. looks like I need to 'rebuild' the module.

Following these instructions now :)
http://www.blitzbasic.com/Community/posts.php?topic=87999#998654

Hopefully it will work out ok.


REDi(Posted 2010) [#11]
Hi WERDNA

Sorry mate, been on vacation for the past few weeks, did you get it working in the end?


WERDNA(Posted 2010) [#12]
No. Still working on it ;(

I'm getting a handle on how to set up modules, and know what 'should' fix it, but
it ain't working ;)

Currently I'm trying to set up the older versions. Might need to try a different version
of MiniGW I guess. because the older versions aren't working out so well...

When I try to Import maxmod2.DUMB and then compile my code, I get about
a dozen C++ errors, mainly pointing at 'void' variables. or some STD problems.

So iffy....


REDi(Posted 2010) [#13]
Have you tried that BlitzMax Companion util...

http://www.blitzmax.com/Community/posts.php?topic=79814

It'll install MinGW for you and set the required environment variables


WERDNA(Posted 2010) [#14]
Trying it out now :)

Thanks for the link!


WERDNA(Posted 2010) [#15]
YES!

I think I got it at last!!!!

Was the version of MinGW I had installed. I might not have downloaded the full
version when I first installed it, lol.

I can now Import MaxMod2.Dumb into my project just fine :)


Now all I need to do is figure out how to actually play them, lol.
if someone could just post a quick, simple example of how to load and play a .mod
file, I would really appreciated it!


Thanks for your help so far everyone ;)


Brucey(Posted 2010) [#16]
if someone could just post a quick, simple example of how to load and play a .mod
file, I would really appreciated it!

Doesn't it come with an example??


REDi(Posted 2010) [#17]
Have a look in the module for a folder called "examples" or see the examples in the documentation ;)


MGE(Posted 2010) [#18]
Just use bass. It's cheap for shareware titles. Commercial means "retail" and unless I'm wrong, your pong battle won't be on retail shelves will it?


xlsior(Posted 2010) [#19]
Commercial means "retail"


Since when, exactly?

The BASS license only allows free use for individuals who are not charging for their product.

Digital distribution for compensation also requires a license, even when it's not physically sitting on store shelves somewhere.
BASS charges 100 euro for a shareware license, 950 euro for a single commercial product license, or 2450 euro for an unlimited number of your commercial products.


WERDNA(Posted 2010) [#20]
None of the examples are blitzmax :)
They all appear to be C++.

Since maxmod is nearly ready, I don't want to bother trying to set up another module.
setting up one was hard enough, lol.


WERDNA(Posted 2010) [#21]
Tis works at last. after scouring the forums, I found this old code example, and
modified it a little to load .DUMB instead ot .rtaudio.

Framework MaxMod2.RtAudio
Import MaxMod2.DUMB

SetAudioDriver "MaxMod RtAudio"

Local Channel:TChannel = CueMusic(RequestFile("",MusicExtensions()))
ResumeChannel Channel

While ChannelPlaying(Channel)
Delay 10
Wend

I now shed tears of joy while playing bon jovi music. I FINALLY have it working ;)!!!!!!!!


xlsior(Posted 2010) [#22]
On the bright side, it'll now be trivial to download and compile other modules as well. I'd recommend taking a peek at the massive collection of modules that Brucey has up for download, they add some reall nice features to Blitzmax.


WERDNA(Posted 2010) [#23]
Sounds like a plan. I've heard about how cool some of them are.


MGE(Posted 2010) [#24]
"It's cheap for shareware titles."

"BASS charges 100 euro."

Very inexpensive for a stable reliable solution.


WERDNA(Posted 2010) [#25]
Its kind of a moot point now, unless I can get my hands on some new .mod files.
Just found out the 30+ that had come with 'game programming for teens' are only
royalty free if you don't use them in a commercial product, or packaged bundle of
any kind(Like a game...).


Henry75(Posted 2010) [#26]
:-((

nice to read you got it at least to work with maxmod2.

Sadly my files (even the examples) won't link after compiling, exiting with the message:

Linking:MiniPlayer.exe
D:/Program Files/BlitzMax/bin/ld.exe: cannot find -ldsound
Build Error: Failed to link D:/Program Files/BlitzMax/mod/maxmod2.mod/examples/MiniPlayer.exe

BlitzMax Version is 1.39 / MinGW is 5.1.6

Anyone has an idea what's going wrong?

Henry