MOD files in python

Started by
6 comments, last by Boder 16 years, 1 month ago
Hi, I'm hoping someone can recommend a way to play module files in python. I'm using Windows and Python-Ogre at the moment. Thanks
Advertisement
pySonic is the only one I know of. It's a wrapper for FMOD.
Thank you very much, it is actually a lot harder to find python libraries than C/C++ libraries I have discovered.

I actually was looking for a FMOD binding, but, you know, with fmod also being float modulus...
Shucks, the last release was for Python 2.4

So I might have to suffer an attempt at compiling the CVS for Python 2.5 and the latest FMOD.

If I understand correctly, the pyd file is just a DLL? and it has to be compiled with the same compiler and C runtime library as the "python.exe" I'm using?

What tool do people use for the automagic windows installer that seems like setup.py?

Maybe someone knows a more active library.
Definitely not as smooth sailing as I thought with Python. Just can't beat the library support with C++, whereas the python wrappers seem rough around the edges.

Not as big a support group, libraries not as supported, lacking or misplaced features (found one in Python-Ogre).

I can't even get OgreAL to play a .ogg and PySonic was exciting at first until I found it is stuck in 2005.

I might have to switch to C# as it seems to have a bigger community and support. But I was really digging the dynamic typing. Somehow Microsoft succeeded with C#.
Well if you went through the trouble to make a python library out of libmodplug i'm pretty sure the open source community would get on board and start maintaining and whatnot, it seems like a pretty important/basic feature for alot of games (i've sorta decided on mod files for filesize and my love of the classic unreal series :-) ) But I guess my point is just that creating wrappers for python can't be terribly hard, and i think it would be worth it in this case.
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by Boder
Definitely not as smooth sailing as I thought with Python. Just can't beat the library support with C++, whereas the python wrappers seem rough around the edges.

Not as big a support group, libraries not as supported, lacking or misplaced features (found one in Python-Ogre).

[...]

I might have to switch to C# as it seems to have a bigger community and support. But I was really digging the dynamic typing. Somehow Microsoft succeeded with C#.


Your findings are true in some way for multimedia libraries, because Microsoft have been able to push things like XNA and DirectX. For other applications, you'll find Python support to be quite mature. Of course, that is probably not much use to you. Obviously C++ is the industry standard and you can't expect the library support in any other language to be comparable, which is a shame.

Quote:I can't even get OgreAL to play a .ogg and PySonic was exciting at first until I found it is stuck in 2005.


Nobody wanting to play .MOD files should be complaining about being stuck in 2005! :P

Out of interest, what's the syntax for FMOD playing a MOD file in C++?
Just a quick cut-and-paste.
//****************************************************************************// "Those Funny Funguloids!"// http://funguloids.sourceforge.net// Copyright (c) 2006-2007, Mika Halttunen//// This software is provided 'as-is', without any express or implied warranty.// In no event will the authors be held liable for any damages arising from the// use of this software.//// Permission is granted to anyone to use this software for any purpose,// including commercial applications, and to alter it and redistribute it// freely, subject to the following restrictions:////  1. The origin of this software must not be misrepresented; you must not//  claim that you wrote the original software. If you use this software in a//  product, an acknowledgment in the product documentation would be//  appreciated but is not required.////  2. Altered source versions must be plainly marked as such, and must not//  be misrepresented as being the original software.////  3. This notice may not be removed or altered from any source distribution.////***************************************************************************/// Play some musicvoid FMODExSoundSystem::playMusic(const std::string& file) {	if(mSoundDisabled) return;	if(String(file).empty()) return;	LogManager::getSingleton().logMessage("Playing '" + String(file) + "'..");	// Release the previously playing music	if(mMusic && mMusicChannel) {		mMusicChannel->stop();		mMusic->release();		mMusic = 0;	}	// Disable the custom file system	FMOD_RESULT result = mSystem->setFileSystem(0, 0, 0, 0, 2048);	errorCheck(result);	// Load	result = mSystem->createStream(file.c_str(), FMOD_HARDWARE | FMOD_LOOP_OFF | FMOD_2D, 0, &mMusic);	if(errorCheck(result)) {		markBadSong();		playMusic(getNextSong());		// Reset the file system		result = mSystem->setFileSystem(fileOpen, fileClose, fileRead, fileSeek, 2048);		errorCheck(result);		return;	}	// Play	result = mSystem->playSound(FMOD_CHANNEL_FREE, mMusic, false, &mMusicChannel);	errorCheck(result);//	String svol = GameApplication::mGameConfig->getSetting("music_volume", "audio");	String svol = GameApplication::mGameConfig->GetValue("audio", "music_volume", "1.0");	Real vol = StringConverter::parseReal(svol);	mMusicChannel->setVolume(vol);	result = mMusicChannel->setCallback(FMOD_CHANNEL_CALLBACKTYPE_END, endCallBack, 0);	errorCheck(result);	// Reset the file system	result = mSystem->setFileSystem(fileOpen, fileClose, fileRead, fileSeek, 2048);	errorCheck(result);}

This topic is closed to new replies.

Advertisement