Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What do you think of adding MIDI music to Liberal Crime Squad?

Yes, let's do this, retro MIDI music would go perfectly with this game's retro look plus it would be great for modding and hardly add anything to the game's disk space and be easy to disable and work on all platforms.
- 43 (81.1%)
No, because I don't want music added, period, even if there is an easy option to disable it and even if the file size for music files is incredibly tiny and even if it's cross-platform and even if modders can customize it with their own music.
- 2 (3.8%)
No, because I'm an audiophile and don't like the MIDI format, I prefer stuff like hi-fi lossless 5.1 surround sound, even if that means huge music files, it's either that or no music at all, and anyone who listens to MIDI music has bad taste.
- 3 (5.7%)
Maybe, I don't care, whatever, I have no opinion on this, leave me alone, I don't like having to answer these stupid polls and I could care less what you do with the game.
- 4 (7.5%)
Other, my opinion on this is different from any of the ones above, stop trying to pigeonhole me, I have a very unique, insightful viewpont on this which your poll failed to anticipate (leave details about your "Other" vote in a comment).
- 1 (1.9%)

Total Members Voted: 52


Pages: 1 [2] 3

Author Topic: Idea: add MIDI music to LCS  (Read 8287 times)

a1s

  • Bay Watcher
  • Torchlight Venturer
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #15 on: August 26, 2014, 09:19:59 am »

I'm not an expert on MIDI law, but can't recordings/arrangements of public domain music still be copyrighted? (There's pretty much no MIDI that's 75 years old, so...)

edit: you haven't said either way, so I'll ask: did you make the MIDIs? I'm 75% sure you putting it in a  GNU GPL  game makes it also  GNU GPL (eliminating the problem)
« Last Edit: August 26, 2014, 09:24:13 am by a1s »
Logged
I tried to play chess but two of my opponents were playing competitive checkers as a third person walked in with Game of Thrones in hand confused cause they thought this was the book club.

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Idea: add MIDI music to LCS
« Reply #16 on: August 26, 2014, 04:06:50 pm »

I didn't make the MIDIs but they're from public domain MIDI websites where the music is all public domain. The authors made them available for download as public domain. So now they are covered by the GNU GPL as part of the game. Just like SDL is under the zlib license which is GPL compatible, so if you include SDL in a GNU GPL game it switches to being covered by the GNU GPL.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Duuvian

  • Bay Watcher
  • Internet ≠ Real Life
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #17 on: August 26, 2014, 09:42:09 pm »

Here is what the .midi I made sounds like.

https://app.box.com/s/n9qohg7i6u4od4r5sc7e

That's a .mp3 made by a free .midi conversion tool so that I can upload it to box. It's somewhat ironic considering the original song was made for .mp3 or .ogg then changed to .midi then back to .mp3 so box can play it back.
« Last Edit: August 26, 2014, 09:48:50 pm by Duuvian »
Logged
FINISHED original composition:
https://app.box.com/s/jq526ppvri67astrc23bwvgrkxaicedj

Sort of finished and awaiting remix due to loss of most recent song file before addition of drums:
https://www.box.com/s/s3oba05kh8mfi3sorjm0 <-zguit

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Idea: add MIDI music to LCS
« Reply #18 on: August 26, 2014, 11:59:17 pm »

Here is what the .midi I made sounds like.

https://app.box.com/s/n9qohg7i6u4od4r5sc7e

That's a .mp3 made by a free .midi conversion tool so that I can upload it to box. It's somewhat ironic considering the original song was made for .mp3 or .ogg then changed to .midi then back to .mp3 so box can play it back.

Well it sounds kind of ambient and fairly peaceful. Definitely not fighting music. Maybe for... well I don't know what part of the game... right now there's 28 different situations in the game that have their own MIDIs, I'm not sure exactly which one it would fit best. Maybe if more songs are added to different things in base mode this could be one of them. I think probably it would fit best with review mode, when you review squads and move equipment between bases. Currently review mode has the same music as base mode. I wonder what other people think... I'd encourage other people to listen to that song too.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Duuvian

  • Bay Watcher
  • Internet ≠ Real Life
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #19 on: August 27, 2014, 12:21:28 am »

Review screen would work I think. Victory might work too but it may need to be more liberal for that.

I'll also work on fixing more sour notes or chords; will it be difficult for you to replace old versions with new once they are coded or otherwise added in or is it simple and easy?
Logged
FINISHED original composition:
https://app.box.com/s/jq526ppvri67astrc23bwvgrkxaicedj

Sort of finished and awaiting remix due to loss of most recent song file before addition of drums:
https://www.box.com/s/s3oba05kh8mfi3sorjm0 <-zguit

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Idea: add MIDI music to LCS
« Reply #20 on: August 28, 2014, 12:33:26 am »

It is very simple and easy to replace .mid files in the art directory. In fact you can do it yourself on your own computer to test it out.

Oh also you don't have to worry about losing rights to any music you donate to the game for the game to use under the GNU GPL. As the original author of music you still own the copyright and can release it under any other license you want too, like for instance selling it on a music CD or selling it on iTunes.

The SDL project (which is what we use to play music, and many other folks also use it for graphics) used to be under the GNU LGPL license up thru version 1.2.x, but now version 2.0.x is under the zlib license, even though normally it's legally impossible to relicense GNU LGPL under zlib, normally you can only relicense in the opposite direction. So why was this possible for them? Because all the programmers involved in writing SDL (the copyright holders) unanimously agreed on the license change, except for a few minor contributors who they were unable to reach, and so they simply rewrote the code written by the minor contributors who they couldn't contact, so that everything could be under the new license.

If you are thinking about releasing music on a CD and selling for profit, or something like that, it probably wouldn't be a good idea to make the music public domain, since public domain means it's no longer copyright by anyone, and anyone (including you but also anyone else) would be able to do whatever they want with it with no restrictions, including other people recording your music and selling it on CDs or iTunes and claiming it's their music and not yours and not sharing the money with you. But the GNU GPL is a generally non-commercial license so stuff licensed under it is never used in any for-profit stuff, except with obvious exceptions like you can still sell a CD or DVD that has GNU GPL software on it for money, because you're charging for the distribution media, not the software. The software itself is free. And you can use GNU GPL software in commercial products, like for instance Linux is used in routers, set-top boxes for TVs, Android phones and tablets, GPS devices for cars, and many other things, but people can still sell those devices for profit, because they are selling the hardware, not the software. The software itself is always free. Unless the original creator decides to relicense it, and still has copyright over it. OK I guess I contradicted myself about whether the GNU GPL is non-commercial or not but you get my point I hope... it's rather a complicated license actually. I guess a better description of the GNU GPL is the "Four Freedoms", which the Free Software Foundation describes here. You might notice their language is a little biased against software sold for-profit by companies, or even software under permissive licenses like the BSD licenses, the FSF folks are very ideological... Elite Liberal, as the game would classify them. Not that there's anything wrong with that, I tend to favor their point of view regarding free software but I'm also more open-minded to other points of view. Like the FSF and GNU project, in their packages, instead of using the abbreviation "win" for MS Windows, as in Win32, use the abbreviation "woe" for windows, because "win" has positive connotations (EPIC WIN) and they don't like Windows so they want to make it sound bad, but I think that is just silliness... not that there's anything wrong with silliness, I'm often silly myself, but if they want to be taken seriously they should try and act more serious and not play word games with using "woe" instead of "win". Plus I use Windows myself, despite using lots of open-source GNU GPL software on it, and I think they can sometimes be a tad too judgmental on anyone who doesn't use nothing but free software. And then there's the whole GNU/Linux naming controversy, where the FSF/GNU people want the operating system called "GNU/Linux" instead of just plain Linux, just because they want to get their own name in there. That is silly too. Besides, GNU does have their own operating system called GNU/Hurd, that they actually did make themselves, so I think they should spend more time on their software projects like the GNU/Hurd operating system and less time on trying to get people to follow their silly naming conventions. GNU/Hurd actually has quite an ambitious design that is more advanced than most of the widely used operating systems... it is like other research operating systems such as MINIX 3, Inferno 4th Edition, Plan 9 from Bell Labs, Singularity, Midori, SSS-PC, and Amoeba in that respect. It would be nice if all the developers of those research operating systems got together and worked together to make the best operating system ever.

But yeah, if you release music in MIDI format under the GNU GPL that doesn't preclude you from releasing the same music for-profit on an audio CD or iTunes or anything, or doing whatever else you want to do with it, if it's your creation, you can do whatever you want with it, legally speaking.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Duuvian

  • Bay Watcher
  • Internet ≠ Real Life
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #21 on: August 28, 2014, 01:01:39 am »

I sent another PM to you. Thanks for your patience in explaining such things to me.
Logged
FINISHED original composition:
https://app.box.com/s/jq526ppvri67astrc23bwvgrkxaicedj

Sort of finished and awaiting remix due to loss of most recent song file before addition of drums:
https://www.box.com/s/s3oba05kh8mfi3sorjm0 <-zguit

himalyya

  • Escaped Lunatic
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #22 on: August 30, 2014, 11:58:35 am »

So I checked out the recent revision (838) of the game and MIDI music works very well with the theme of the game! Especially the opening and character creation tracks are brilliant. However, I feel that there's way too many track changes between different screens. How about reducing the number of tracks so that the music doesn't change all the time? It gets really annoying after 10mins or so.

All tracks could still be included, perhaps there could be a random selection of tracks from which an appropriate track is chosen. For example, how about having music for just safehouse (and its related activities such as activating liberals etc.), district locations and battle (alarmed conservatives, car chases etc.)? This would reduce the number of track changes and make the experience way better IMHO.

A big thanks to all the modders who keep working with this game! You all are awesome!

EDIT: Furthermore, is there a way to disable music? I checked out the init.txt, but there was nothing related to it.
« Last Edit: August 30, 2014, 12:05:36 pm by himalyya »
Logged

KA101

  • Bay Watcher
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #23 on: August 30, 2014, 03:37:05 pm »

KA101 hasn't said anything re music getting added after all, because he has nothing nice to say about it
Logged

Neon Green

  • Bay Watcher
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #24 on: August 31, 2014, 06:43:22 pm »

MIDI sounds bad, and is a bad choice for an audio format. In exchange it has very few advantages. It would be better to use something like OGG, because that opens up a wide selection of permissively-licensed, better-sounding music, and MIDIs can be converted to a different format if there's simply nothing else to use.

The game is a character graphics console game because that was easier to make. Graphics quality was sacrificed to save time for gameplay and other features. MIDI audio is probably no easier to implement than better-sounding alternatives like OGG, so there is no corresponding advantage.

I don't think think bad graphics go better with bad music. Bad graphics and good music can coexist, and ought to.

KA101 hasn't said anything re music getting added after all, because he has nothing nice to say about it
If you say that you don't have anything nice to say, then you're not really saying nothing, so either say something or don't.
Logged

ff2

  • Bay Watcher
  • The Occasional Poster
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #25 on: September 01, 2014, 11:46:20 am »

It is quite obvious you are trying to make people who disagree with you look bad in the pool, and vice versa.
Logged

FinetalPies

  • Bay Watcher
  • Even on the battlefield.
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #26 on: September 01, 2014, 07:10:17 pm »

Composition is more important than format~~~
Logged

KA101

  • Bay Watcher
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #27 on: September 02, 2014, 09:06:44 pm »

Very well.  I have had no luck getting SDL to compile in my work with DDA, and am Not Happy that--so far as I can tell--it's been made a dependency for LCS.  If at some point I found the time to put together the corporate expansion I'd planned, I can't compile it without dealing with a dependency for which I have no use.

So Liberal Elitist has created a Conservative Barrier to my participating Liberally in LCS devI really wish xe hadn't done that.
Logged

SuicideJunkie

  • Bay Watcher
    • View Profile
Re: Idea: add MIDI music to LCS
« Reply #28 on: September 02, 2014, 09:22:47 pm »

You need to add a
Code: [Select]
#define DONT_USE_SDL to includes.h or a similar place, then it will build and run OK
It could be commented out by default, but there should be some SDL install instructions written up.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Idea: add MIDI music to LCS
« Reply #29 on: September 03, 2014, 10:17:21 am »

Apologies in advance for this long post, but a lot of people made comments that I would like to respond to in detail.

I think revision 840 should have it fixed so it builds correctly not just with Code::Blocks and MS Visual C++ on Windows, but with the Autoconf script and Makefiles on Linux/Mac OS X/etc. although I need this verified.

As for how to disable music, it is quite easy. On the main title screen when the game starts it tells you how to enable/disable music. Once you are at your base you can (R)eview your Liberals and squads and move equipment and such and there's an option to enable/disable music. The third place you can enable/disable music is in site mode when you are at a site, you can go to options, and there are 2 options, 1 to enable/disable encounter warnings and another to enable/disable music. So in 3 different places you can enable/disable music, I've tried to make it as easy as possible.

As for MIDI files having bad sound quality, well not only can you disable the sound, but this SDL2 and SDL2_mixer solution is quite good at playing back all different formats of audio, including other formats like MP3 and OGG. Some of the other formats require additional dependencies, for instance libogg, libvorbis, and libvorbisfile are ALL required to play Ogg files (3 different .DLL files on Windows, and for people on UNIX-based systems they are 3 different library dependancies). MP3 requires the smpeg library (1 .DLL). FLAC requires the libFLAC library (1 .DLL). And MOD requires libMikMod and libModPlug (2 .DLLs). MIDI, WAV, VOC, and AIFF are supported by default without external libraries.

So, if you want to add support for Ogg, actually the code for this is very simple, and SDL2_mixer can load support for various sound file formats dynamically at runtime, without having to be built against those libraries as dependencies. Those libraries are just checked for at runtime. SDL2 and SDL2_mixer are quite well done, I think. They support a wide variety of sound file formats, they don't require you to link against those libraries but can dynamically load them at runtime, and so forth.

As for if you are having bad sound quality with MIDIs, well this is a matter of taste, some people like the sound of MIDIs, others can't stand them, and a lot of times it depends on which MIDI synthesizer your computer is using. The BASSMIDI driver version 3.1 is a MIDI soft synthesizer for MS Windows that allows you to use any SoundFont you want. CoolSoft VirtualMIDISynth does the same thing and is quite similar to the BASSMIDI driver. Similarly, the FluidSynth 1.1.6 synthesizer is a cross-platform MIDI soft synthesizer that can be used as your Linux MIDI synthesizer on Linux and lets you use any SoundFont you want. Timidity++ is another cross-platform MIDI soft synthesizer that can be used as a driver on either Windows or Linux and supports not just any SoundFont but also any Gravis UltraSound patchset for MIDI synthesis. And all of these are compatible with SDL2 and SDL2_mixer. There are many excellent free SoundFonts available that can be used with these MIDI synthesizers, such as the Arachno SoundFont, one that I am quite fond of. Personally what I use is the Yamaha S-YXG50 Soft Synthesizer for Windows XP and earlier (doesn't work on later versions, or on other operating systems, although it does work on some earlier versions of Windows like Windows 9x and Windows 2000). It's a proprietary MIDI soft synth driver but the sound quality is unmatched. Listening to MIDI files on it is sheer bliss for me. It's a shame it got discontinued by Yamaha and was never updated to work with operating systems newer than Windows XP. But there is another driver, the VST MIDI Driver that is compatible with VSTi plugins and can use them to playback MIDI music, and you can use it along with a VSTi MIDI software synth plugin, of which there are several by companies like Yamaha and Roland, including the Yamaha S-YXG50, Roland VSC-MP1, the open-source Juce OPL2 VST plugin, and SynthFont, among many others, and you can use it as your MIDI driver on Windows XP/Vista/7/8/8.1. The VST MIDI Driver is the most advanced one but also harder to figure out than the SoundFont-based synths, since you need to find a VSTi plugin for it and only certain ones work; its advantage is that it potentially offers better sound quality than any SoundFont-based MIDI driver, for instance if you use the Yamaha S-YXG50 VSTi plugin or some other Yamaha XG synthesizer plugin (some of them might work on your system and others might not; the VST MIDI Driver is a bit more complicated than the SoundFont stuff but the increased sound quality is well worth it). The VST MIDI Driver only works on Windows though, so users of other operating systems are out of luck, whereas there are SoundFont-based MIDI drivers for all the other operating systems. The CoreAudio system on Mac OS X actually has built-in support for both DLS format soft synths and SoundFonts so you don't even need an alternate sound driver on a Mac, the SoundFont support is built-in to the default MIDI driver.

And of course you can #define DONT_USE_SDL to completely disable the SDL dependencies and music and have it compiled without any of that at all. Actually this line is in common.h, not includes.h, because that's where it needs to be in order to disable SDL from ever being included. Or you could define DONT_USE_SDL using your CFLAGS or CPPFLAGS or using a command-line define option with your compiler ("-D DONT_USE_SDL" with GCC). Right near the top of common.h are these 2 lines:

Code: [Select]
// uncomment this next line if you want to disable SDL (which is for music/sound)
//#define DONT_INCLUDE_SDL

Pretty obvious what to do, if you want to disable SDL as a dependency, and its associated music/sound, completely.

Anyway I've made it possible to disable SDL and music at compile time through a #define or at runtime through menu options that occur in 3 different parts of the game (title screen, review mode screen that you can access in base mode, and settings screen for site mode). So it's easy to disable.

Also there are many options for improving the sound quality of MIDI files, many alternate MIDI synthesizer drivers that I listed above.

If you don't like the included MIDI files you can replace them with other ones that you like better.

If you don't think MIDI music sounds good, SDL and SDL_mixer are perfectly capable of playing other formats like MP3, OGG, and even FLAC if you want super-high-quality lossless audio. And the amount of code you would need to change to switch to those other formats is actually quite small, and it's well-documented in the SDL_mixer documentation online, just look for SDL_mixer on a search engine and you can find the documentation of its API and functions and how to play other types of sound files.

If you have difficulty compiling on other platforms, well I just did revision 840 to fix that and get this dependency working on all platforms, hopefully. If there are any errors or mistakes in my Autoconf script and you are a developer on Linux please fix them.

So, I think I have done everything possible to make this MIDI music feature one that is easy to disable or modify and try and minimize any harm it causes as collateral damage.

As for how the music changes whenever you change from one activity to another... well that is the way I envisioned it, right now there are 34 different situations in the game that have their own music, for instance each of the 5 different curses movies has its own music, I think that adds to the variety of the game. I suppose it could also just play random music out of a selection, and change which music is being played less often, but this would be harder to implement. SDL_mixer allows you to provide a callback function for when a song stops playing but its API documentation says that you shouldn't call any SDL_mixer functions from that callback function, like for instance functions to start playing a different song. Also the current code works allows for music.play() to be called from throughout the code, whether or not SDL is included, and if SDL is not included, it just does nothing. Surrounding every single call to music.play() with #ifdefs and having no music-related code at all when SDL is disabled would be a bit of overkill... way too many #ifdefs throughout the code, the way I implemented it makes disabling SDL simple and easy using a single compiler define without having checks for it all over the place in the code, and I also implemented music as an object-oriented class so that the details would be abstracted away from most of the code and internal to the class itself, and thus all of the #ifdefs would also be only inside the class itself and not pollute the rest of the code.

And yes, the poll at the beginning might be a little biased in favor of including this feature, I am sorry about that, however everything like how it is moddable and easy to disable, that is all true as I have explained, so nothing in the poll is dishonest at all. Anyway if you don't like music in the game at all, you can define DONT_INCLUDE_SDL if you're compiling it, or if you're playing it, there are several different places in the game to easily turn it off, including right at the title screen right when the game starts up, you can turn it off immediately and never hear it again. If you don't like the MIDI files but have other MIDI files you do like you can replace them. There are other MIDI synthesizers with better sound quality than the one that comes with MS Windows which can be used as MIDI drivers. You are not stuck using the MIDI format, as SDL2 and SDL2_mixer support a variety of other formats, the notable ones for people here probably being OGG, MP3, and FLAC, and all you have to do is have the right libraries present at runtime, and call the correct functions as specified in the SDL_mixer API to dynamically load support for the sound file formats you want. Adding support for other sound file formats would require editing the source code, but it's not such a big deal.

Also all of the music I used is public domain and in the code I document what the songs are and who composed them, so if you want to find, for instance, OGG or MP3 or FLAC versions of them, and then change the code to play those instead of MIDI, well this is possible if you edit the source code and doesn't require very much changes.

Anyway I am sorry if this has inconvenienced anyone such as KA101, I have tried to make this as easy as possible for everyone and not have it cause problems for anyone. And I am not really interested in making people who disagree with me look bad, ff2, everyone is entitled to their own opinion, and I myself admit this didn't go quite as smoothly as it could have gone and there is still some room for improvement. Yes, if you have a new dependency and you have to change a line of code to not have that dependency anymore it's a little inconvenient. If you want to disable MIDI music when you're playing the game but don't yet know where the option is, that's a little inconvenient. If you don't like MIDI music but like some other format better, and you don't have a good MIDI synthesizer installed or just can't stand MIDI (plenty of people are like that), well then the whole thing is rather annoying, having to listen to this awful music you hate and then try and figure out how to disable it. And if new dependencies are installed and you're trying to compile it on a platform where the project files for your IDE or the Makefiles and Autoconf scripts haven't been fixed yet so you can compile it without errors, well that's a really big problem. But I have done my best to address and solve all of these problems as best as possible. I have also done a lot of play-testing to make sure that the game works with the music and that, at the very least, I enjoy it with the music and like the selection and think that the music tracks for each situation are appropriate for the mood. Nobody is perfect, certainly not me, but still I think I did a pretty good job at this, even if it's not perfect.

Anyway... 2 lines in common.h explain how to disable this completely, 1 is a comment to explain it, the other is the define that you uncomment to disable it. It is not that hard to disable. If you prefer OGG, which is what some other games like Dwarf Fortress and many other open-source games use, well that is another option besides MIDI. OGG, MP3, and FLAC all have better quality than MIDI unless you have a really nice-sounding MIDI soft synthesizer like the ones I mentioned earlier as your default MIDI device... and most people don't have really nice-sounding MIDI soft synthesizers installed as their default MIDI devices. I guess since my computer has an extremely awesome-sounding MIDI soft synthesizer installed, the Yamaha S-YXG50, I kinda take really nice-sounding MIDI for granted and sometimes forget the fact that most people's default MIDI devices sound terrible. So for the majority of people, OGG, MP3, or FLAC would be better sound quality, and the only drawbacks would be increased filesize and even more dependencies (MP3 and FLAC just require 1 additional .DLL file each on Windows, while OGG requires 3). But luckily those aren't compile or link-time dependencies but runtime dependencies so you can compile perfectly fine without them and you only need the .DLLs or libraries there when you run the game, thanks to the advanced modular architecture of SDL, plus SDL has extremely good cross-platform support.

Also, it's actually possible to use multiple different formats of audio in the same program. So we could have some music files that are MIDI, some that are OGG, some that are MP3, and some that are FLAC, and it would be able to work with that, as long as the right .DLLs or libraries were present. Practically speaking, this is a silly idea. Most open-source games just use one music file format. GNU FreeDink, based on Dink Smallwood, is one of the games that uses MIDI, and it also uses SDL and SDL_mixer, just an older version, 1.2 instead of 2.0. The most common format in open-source games is Ogg, used by the vast majority of open-source games that have music. A bunch of open-source games even use OGG files that were all generated from MIDI files using high-quality MIDI synthesizers. That is actually very common. Just one example of this is Vulture NetHack, a GUI version of NetHack that has very nice music which was all originally MIDI and then converted to OGG, all of it under the NetHack General Public License (incompatible with the GNU GPL). This seems ironic to me, because it would use less disk space to simply use the original MIDIs, plus then you could easily edit the MIDI files in a MIDI sequencer to do stuff like change instruments, change notes, change the volume, etc., to make the music file better. But once you convert the MIDI file to OGG you can't do that kind of editing anymore. Plus it takes up more disk space. I'm not sure about the cost/benefit analysis of that... to me, at least, it seems like using MIDI directly is a better idea than using OGG files that were created from MIDI files, and one of the major reasons is because then you are free to edit the MIDI files in a MIDI sequencer at any time to improve them. The sole benefit of OGG files made from MIDI files using a high-quality synthesizer is that people on computers where the MIDI sequencers are low-quality (unfortunately, this includes the vast majority of people) would hear better quality audio. But if the files are kept as MIDI then each person can install a SoundFont-based MIDI driver and pick out their favorite SoundFont to use, for instance, and since every person has different tastes, some people would like one SoundFont better and others would like a different one better, but this way everyone would be able to get the sound quality they like the best and it would sound even better than an OGG using what one person considers a good SoundFont, because it would match the personal tastes of the person listening to it.

So really the choice of an audio format is a complex cost-benefit analysis involving a variety of different factors and not all that simple or clear-cut. MP3 is an inferior choice to OGG because MP3 is patent-encumbered and has lower audio quality at the same bitrate than OGG, so really we should only consider MIDI, OGG, and FLAC. FLAC provides the highest quality, losslessly, and is excellent for providing a perfect reproduction of an original audio recording, at the cost of file size, since FLAC is much larger than MIDI, OGG, or MP3. But then there are the legal issues about music that can be used in a GNU GPL game and what is public domain, and the various Creative Commons licenses and the complexities involved with using music licensed under one of them. According to the Free Software Foundation, although Creative Commons licenses other than CC0 are incompatible with the GNU GPL, you can use Creative Commons licensed music, sounds, art, etc. in a game or other software project as long as none of it is source code and it is all art/music type stuff. But this increases the licensing complexity of the program and means some of the program is licensed under the GNU GPL while some music files distributed with it are under various Creative Commons licenses. Right now all of Liberal Crime Squad is under the GNU GPL and that is much simpler. Also MIDI music is legally just a composition and not a performance since it is akin to sheet music, while OGG, MP3, and FLAC are all basically recordings and are akin to performances rather than just compositions so there are potentially many more copyright holders involved according to copyright law. There has never been any litigation from the music industry over MIDI files but they litigate quite a bit over audio in those other formats that people download and share on the Internet in violation of copyright laws. So while OGG and FLAC are both legally safer than MP3 because they aren't patent encumbered, MIDI is even safer legally because it is merely a composition and not a performance so there are less potential copyright holders who could get involved in a dispute.

So my choice of MIDI was made based on a variety of factors: small file size, not needing additional libraries to link against besides SDL and SDL_mixer, being able to easily edit the music, people being able to choose the MIDI soft synthesizer or SoundFont of their choice that they like the sound quality of the best, and absolutely minimal legal risk. But OGG would also be a good choice too, because it would result in better sound quality for a typical player who doesn't have some fancy MIDI synthesizer installed on their computer, the file would sound exactly the same to everyone, the format is totally open and unencumbered by any patents, it is capable of reproducing sounds that MIDI can't reproduce, such as actual audio recordings, and the file size, while bigger than MIDI, is not THAT big, plus there is a wide variety of OGG music available either as public domain or typically under Creative Commons licenses that, according to the Free Software Foundation, can be used for music or artwork bundled with a GNU GPL game even though they are not compatible with the GNU GPL, plus OGG happens to be the most popular music format for open-source GNU GPL games. One of the main reasons I chose MIDI over OGG is that Liberal Crime Squad has always used a very small amount of disk space and I thought if I increased it too much, that would be too radical of a change and controversial with people who want something really small to download. Plus MIDI files, unlike OGG or MP3 or FLAC files, can be compressed further if you put then in ZIP or other compressed files for distribution... if you compress a MIDI file inside a ZIP file it takes almost no space at all, making it easy to distribute the game, even if it has a large number of MIDI files, as a very tiny download. And OGG has several additional dependencies, you need 3 more .DLL files on Windows, and 3 more libraries installed on UNIX-based platforms. So basically it's a cost-benefit analysis involving a wide variety of factors and I went with MIDI although OGG is also a decent choice too... I wouldn't seriously consider MP3 because of the patent issues and its inferiority to OGG in terms of sound quality at the same file size, and I wouldn't seriously consider FLAC either because its file size is excessive compared to OGG for very minimal increase in sound quality compared to high-bitrate OGG that is impossible for the vast majority of people to notice.

Maybe there should be another poll on MIDI vs. OGG and I would try and make it more balanced and list advantages and disadvantages for both, although the polls here limit the amount of characters you can use so I couldn't really give complete rundowns on the pluses and minuses of each of them, I'd just have to list the most important pluses and minuses, which I suppose are MIDI being smaller than OGG on disk, OGG having better sound quality than MIDI for most people, MIDI files being easier to edit than OGG, OGG being able to reproduce any sound while MIDI can only reproduce a standard set of instruments, and OGG files sounding the same on every computer while MIDI files sound different depending on what MIDI synthesizer you use.

But yeah as for KA101 wanting to be able to compile without SDL or music at all, that's an easy option, just uncomment 1 line of code in common.h and you're done. And for the people wanting to disable music while playing the game, that option is in 3 different places, quite easy to find, I already listed where they are, the first place is right on the main title screen when the program starts.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL
Pages: 1 [2] 3