MIDI music acceptable for games?
I'm unfamiliar with the XM file format. Is that really cross-platform friendly, and does it have an abstract note representation similar to that of MIDI that would allow me to dynamically create and send different note values at run-time to an XM playing library?
XM is a variation on the classic MOD tracker format.
Tracker files are basically a step up from midi. They contain note and pattern data, but instead of relying on the system to provide sounds, each sound used by the song is contained within the file itself.
I have worked out designs for tracker-based adaptive music engines, but to try to do build one, I would likely start with a simpler format, like MOD or S3M. XM has been brutalized a lot since its inception, and since many players/trackers deal with the file differently, it can get confusing to program.
I think that a MOD based adaptive engine is totally feasible, because each song could not only contain all necessary transitional patterns and song segments without the size of the music data file growing linearly with minutes of music, but you could even store extra data within the file itself for extra information to process by the engine. Add in the channel-based polyphony sorting with some smart music creation and you've got yourself a winner in my book.
But Im sure its a dumb idea for some reason. I still intend to build one.
Tracker files are basically a step up from midi. They contain note and pattern data, but instead of relying on the system to provide sounds, each sound used by the song is contained within the file itself.
I have worked out designs for tracker-based adaptive music engines, but to try to do build one, I would likely start with a simpler format, like MOD or S3M. XM has been brutalized a lot since its inception, and since many players/trackers deal with the file differently, it can get confusing to program.
I think that a MOD based adaptive engine is totally feasible, because each song could not only contain all necessary transitional patterns and song segments without the size of the music data file growing linearly with minutes of music, but you could even store extra data within the file itself for extra information to process by the engine. Add in the channel-based polyphony sorting with some smart music creation and you've got yourself a winner in my book.
But Im sure its a dumb idea for some reason. I still intend to build one.
For an example of a .mod/.xm tracker editor download Skale Tracker and go to ModArchive to download some .mod and .xm files and load them in and play them and see what you think.
I have seen MOD and S3M files used before, but I hadn't really looked into their file formats (didn't Deus Ex and Unreal Tournament use the S3M format for its music?). I've skimmed through the S3M file format to see what it can do.
Forgive me if this is ignorant as I'm new to electronic music programming, but with these file formats are the samples just provided for a few key pitches and then frequency shifted to the pitch requested by the notes (specified in some MIDI like format)?
If that's the case, then I could probably knock together my own synthesiser that sums all these samples together myself into a sound stream, and just use OpenAL to provide cross platform functionality. That doesn't sound all that hard to implement.
Forgive me if this is ignorant as I'm new to electronic music programming, but with these file formats are the samples just provided for a few key pitches and then frequency shifted to the pitch requested by the notes (specified in some MIDI like format)?
If that's the case, then I could probably knock together my own synthesiser that sums all these samples together myself into a sound stream, and just use OpenAL to provide cross platform functionality. That doesn't sound all that hard to implement.
If you want to write your own player you're welcome to but there are already freeware players out for module formats. SDL_Mixer supports .mod, .s3m, .xm, .it, and .ogg . It internally uses a player called MikMod which, in accordance to the LGPL, is open-source and can be examined here.
The format of the notes, however, isn't very MIDI-like. There are blocks of music data which are ordered according to a playlist. Midi is probably more efficient memory-wise but the sound banks vary in quality.
The format of the notes, however, isn't very MIDI-like. There are blocks of music data which are ordered according to a playlist. Midi is probably more efficient memory-wise but the sound banks vary in quality.
Does SDL_Mixer or its MikMod component allow access to the mod file itself?
One could do adaptive MOD music purely based on pattern selection, but I've always felt it could take great advantage from having access to the pattern data, ie, be able to weight and control channels and instruments. Most player middlewares that Ive looked at just have a basic "start song, stop song, go to pattern" api, so for my idea I would at least be deconstructing an opensource player anyway, or writing from scratch.
One could do adaptive MOD music purely based on pattern selection, but I've always felt it could take great advantage from having access to the pattern data, ie, be able to weight and control channels and instruments. Most player middlewares that Ive looked at just have a basic "start song, stop song, go to pattern" api, so for my idea I would at least be deconstructing an opensource player anyway, or writing from scratch.
I'm not quite sure what you're asking but SDL_Mixer and MikMod are written in C not C++ so there is no data hiding. You can directly access the structures any time you want just by adapting the code.
Quote: Original post by krikkit
Does SDL_Mixer or its MikMod component allow access to the mod file itself?
One could do adaptive MOD music purely based on pattern selection, but I've always felt it could take great advantage from having access to the pattern data, ie, be able to weight and control channels and instruments. Most player middlewares that Ive looked at just have a basic "start song, stop song, go to pattern" api, so for my idea I would at least be deconstructing an opensource player anyway, or writing from scratch.
That's pretty much what I was thinking as well; all the APIs that I've used have very limited interfaces and would not be able to have the flexibility that I wanted. It might be easier for me to use MIDI as the basis of my music experiments, but plan on writing a simple player based on samples if I wanted to get consistency across different hardware.
But as I've said before; I'm new to this. I've done some sound processing projects before just for kicks but I haven't played around with music yet.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement