SFML community forums

General => Feature requests => Topic started by: Radnen on July 29, 2013, 01:43:23 am

Title: Module music formats
Post by: Radnen on July 29, 2013, 01:43:23 am
I love module music files for their amazing small size to sound quality ratio.

I do propose a solution, not just a request:
I want you to upgrade the sound package of SFML to use audiere since it supports all the current (major) sound types and far, far, far more and it is known to be cross platform and mature, and is opensource/free I think if the license works out for you it would be a great start.

There are other libraries you can use but they have horrendous licensing. I'm using SFML 2.0.Net and I found the supported music/sound types lacking, I can't find any good audio libraries out there. But audiere is great, but no C-sharp bindings exist, plus you'd want to edit the C++ version before you make bindings of it, and so this is again great for that case.
Title: Re: Module music formats
Post by: eXpl0it3r on July 29, 2013, 02:49:10 am
There are other libraries you can use but they have horrendous licensing. I'm using SFML 2.0.Net and I found the supported music/sound types lacking, I can't find any good audio libraries out there. But audiere is great, but no C-sharp bindings exist, plus you'd want to edit the C++ version before you make bindings of it, and so this is again great for that case.
If SFML were to provide playback for mod formats, it would also use an external library, since it's a rather complex thing to get this done properly and SFML's focus is not on reinventing the wheel all over and over again.

You can take a look at libmodplug (http://libmodplug.sourceforge.net/) (GPL) - see my CMake compatible version (https://github.com/eXpl0it3r/libmodplug/blob/master/license.txt) - and for combinding it with SFML, you can take a look at sfMod (http://www.zorexxlkl.com/sfmod/) - or as well take a look at my version (https://github.com/eXpl0it3r/sfMod) with support for CMake.
But since you're using C#, I'm not sure how you'll be using things. Maybe you can port sfMod to C# itself.

If you find a good library that has a more open license let me know.
Title: Re: Module music formats
Post by: Laurent on July 29, 2013, 07:34:07 am
Since Audiere also handles playback, why don't you use it directly? Actually it would be weird to build SFML on top of it, since SFML is more low-level than Audiere.
Title: Re: Module music formats
Post by: Radnen on July 30, 2013, 01:54:46 am
I'm using C sharp, there are no good sound libraries out there for it. I guess I can try to make my own bindings.
Title: Re: Module music formats
Post by: zsbzsb on July 30, 2013, 02:39:19 pm
I'm using C sharp, there are no good sound libraries out there for it. I guess I can try to make my own bindings.

I find that statement very hard to believe, just considering FFMPEG (http://www.ffmpeg.org/) alone and what it can do. Look at my signature for the VideoStreamer I made with FFMPEG and I wrote my own simple bindings, but if you do not want to write your bindings there are already a good number of FFMPEG .NET bindings (http://ffmpegdotnet.codeplex.com/) out there.

And getting past FFMPEG there is irrKlang (http://www.ambiera.com/irrklang/), BASS (http://www.un4seen.com/), NAudio (http://naudio.codeplex.com/), Alvas.Audio (http://alvas.net/), AudioLab (http://www.mitov.com/html/audiolab.html), SoundTouch (http://www.surina.net/soundtouch/faq.html), and how many others out there. But you say there is no good libraries?
Title: Re: Module music formats
Post by: Radnen on July 31, 2013, 09:06:51 am
I'm using C sharp, there are no good sound libraries out there for it. I guess I can try to make my own bindings.

I find that statement very hard to believe, just considering FFMPEG (http://www.ffmpeg.org/) alone and what it can do. Look at my signature for the VideoStreamer I made with FFMPEG and I wrote my own simple bindings, but if you do not want to write your bindings there are already a good number of FFMPEG .NET bindings (http://ffmpegdotnet.codeplex.com/) out there.

And getting past FFMPEG there is irrKlang (http://www.ambiera.com/irrklang/), BASS (http://www.un4seen.com/), NAudio (http://naudio.codeplex.com/), Alvas.Audio (http://alvas.net/), AudioLab (http://www.mitov.com/html/audiolab.html), SoundTouch (http://www.surina.net/soundtouch/faq.html), and how many others out there. But you say there is no good libraries?

They are not free for commercial use. The latter half lack the types of files I want to play. And anything GPL is a nightmare.

I've been looking around for a free to use; open source; multi-format playback; mono compatible library and I have yet to find one. Now I wonder why SFML has such a limited # of types! Outside of wav and ogg you have virtually nothing that fits the bill.

:/
Title: Re: Module music formats
Post by: Laurent on July 31, 2013, 09:23:03 am
Do module files require an external instrument bank, like MIDI?
Title: Re: Module music formats
Post by: Radnen on July 31, 2013, 10:07:20 am
No; they do not. Sometimes you come across large module files since high-quality instruments and other samples were packed in with them. It's a very portable filetype - even though there and hundreds of them. The major players are .it, .mod, .xm, and .s3m

The rest are variations or not often seen.

I mean I'm okay with wav and ogg - you can 'render' midi and module music to those types, but it bloats filesize and I can't force someone to convert their songs if they don't want to - it's not just for me this feature but for a community of game makers.
Title: Re: Module music formats
Post by: Laurent on July 31, 2013, 10:17:24 am
If instruments and samples are packed into the music files directly, they can't be shared right? So how do you keep music files small if instruments and samples are duplicated in each of them?
Title: Re: Module music formats
Post by: Radnen on July 31, 2013, 10:21:17 am
If instruments and samples are packed into the music files directly, they can't be shared right? So how do you keep music files small if instruments and samples are duplicated in each of them?

No they can be shared. The files are small since only the instruments needed (no more than 32, say) are stored and the instruments aren't that huge ~a few kb's in space.

If you want to do a bit of light reading here's a wikipedia page: http://en.wikipedia.org/wiki/Module_file
Title: Re: Module music formats
Post by: Laurent on July 31, 2013, 10:59:09 am
Ok, thanks for the extra information.

I've added a task (https://github.com/SFML/SFML/issues/441) in the tracker.