chipLÖVE - Getting to LÖVE chip music (with new question)
Posted: Sat Dec 11, 2010 5:33 am
I discovered LÖVE a few weeks back, and fell in love (naturally). After tweaking the NO demo that came with Windows (a ton, to make it suit the Picross addiction that arose from it), I decided to try making a personal project. However, coming short of ideas for something to write, I instead turned to making LÖVE use the music I pumped out of my FamiTracker usage phase.
The goal of chipLÖVE is to add a decoder type that will play chip music files (NSF, GBS, and a few others). The heavy lifting of actual decoding is performed by Game Music Emu, an LGPL library that is made for this. (Right now, I just threw the source in to be built with the rest of the executable, as making it a static library to link against feels like a portability issue.) My work came into writing the actual decoder class, which was (thankfully) a lot less work than I thought it would be.
I managed to get everything to compile, but I've run into a couple issues, which brings me here. First, loading a file in love.load() causes GME to crash. (An assertion fails - I think it has to do with not having decoded enough of the file to play it) However, when loading in the main loop, the song plays, but sped up and choppy. I'm here to abuse the love of the LÖVE community, to entreat the aid of the source maintainers, to ask, WTF?
I have a (rather large) zip of the edited source up here: http://icesoldier.me/filedump/chipLOVE- ... ove070.zip PLEASE NOTE: I've only edited the MSVC2010 project file to use the new items. I tried using the Linux source and MinGW, but there was some disconnect with OpenGL, and ./configure wouldn't see the library. (Even when I told autoconf to look for opengl32 instead of GL.) However, the only things to add are the contents of libraries/gme, and the files modules/sound/lullaby/GMEDecoder.cpp and .h. Buried deep in the MSVC2010 folder is an example LOVE program that (on my system) loads a file and plays sped-up. (The folder platform/msvc2010/Debug/chip-love)
Also, my first post! Hello, all! *sheepish wave*
EDIT to add information:
After stumbling around with Visual Studio's debugger, it seems that when opening the file in love.load(), the decoder's information gets edited in a rather spooky way while emulating the audio. How many threads have access to a Decoder object, and how do I lock out the information in a call? I happened to not pay attention that much when mutexes and semaphores were discussed in one of my classes. (Mostly because the class was in Assembly, but that's beside the point.) Also, why does loading in load() versus later on matter for this?
The goal of chipLÖVE is to add a decoder type that will play chip music files (NSF, GBS, and a few others). The heavy lifting of actual decoding is performed by Game Music Emu, an LGPL library that is made for this. (Right now, I just threw the source in to be built with the rest of the executable, as making it a static library to link against feels like a portability issue.) My work came into writing the actual decoder class, which was (thankfully) a lot less work than I thought it would be.
I managed to get everything to compile, but I've run into a couple issues, which brings me here. First, loading a file in love.load() causes GME to crash. (An assertion fails - I think it has to do with not having decoded enough of the file to play it) However, when loading in the main loop, the song plays, but sped up and choppy. I'm here to abuse the love of the LÖVE community, to entreat the aid of the source maintainers, to ask, WTF?
I have a (rather large) zip of the edited source up here: http://icesoldier.me/filedump/chipLOVE- ... ove070.zip PLEASE NOTE: I've only edited the MSVC2010 project file to use the new items. I tried using the Linux source and MinGW, but there was some disconnect with OpenGL, and ./configure wouldn't see the library. (Even when I told autoconf to look for opengl32 instead of GL.) However, the only things to add are the contents of libraries/gme, and the files modules/sound/lullaby/GMEDecoder.cpp and .h. Buried deep in the MSVC2010 folder is an example LOVE program that (on my system) loads a file and plays sped-up. (The folder platform/msvc2010/Debug/chip-love)
Also, my first post! Hello, all! *sheepish wave*
EDIT to add information:
After stumbling around with Visual Studio's debugger, it seems that when opening the file in love.load(), the decoder's information gets edited in a rather spooky way while emulating the audio. How many threads have access to a Decoder object, and how do I lock out the information in a call? I happened to not pay attention that much when mutexes and semaphores were discussed in one of my classes. (Mostly because the class was in Assembly, but that's beside the point.) Also, why does loading in load() versus later on matter for this?