{"id":1276,"date":"2011-05-10T15:13:31","date_gmt":"2011-05-10T15:13:31","guid":{"rendered":"http:\/\/har0ld.com\/playground\/2011\/05\/we-need-a-midi-engine-ii\/"},"modified":"2011-05-10T15:13:31","modified_gmt":"2011-05-10T15:13:31","slug":"we-need-a-midi-engine-ii","status":"publish","type":"post","link":"http:\/\/har0ld.com\/playground\/2011\/05\/we-need-a-midi-engine-ii\/","title":{"rendered":"We need a MIDI engine II"},"content":{"rendered":"<p>The goal would be to provide a toolset a game audio designer could use to:<\/p>\n<p>-Make him able to be free and creative by using his\/her standard sequencer software and export midi\/soundbanks\/scripts in a convenient and efficient way to the game.<\/p>\n<p>-Minimize the programmer\u2019s work who would spend NO time on things he\/she shouldn\u2019t do like fixing sound fxs volume issues (remember, I am not talking about triple A business) and spend more time on better things like polishing.<\/p>\n<h1>What we have<\/h1>\n<p>The tools are a mess. Some tools do some extent of the job, some did it perfectly but are now dead, some survive but are dying\u2026 We\u2019re almost there. And yet so far!<\/p>\n<p>First there\u2019s the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Module_file\" target=\"_blank\">MOD file<\/a> (.s3m, .xm, .it). Yes, it\u2019s MIDI data + samples\/synths. It\u2019s not crazily supported but <a href=\"http:\/\/www.ambiera.com\/irrklang\/features.html\" target=\"_blank\">Irrklang<\/a> does as well as well as the ubiquitous <a href=\"http:\/\/www.fmod.org\/\" target=\"_blank\">Fmod<\/a>.<\/p>\n<p>Where it\u2019s so weird is that it\u2019s only for playback purpose: no way to interact at the lib level with channels and parameters of MIDI data! Why would you absolutely just play a mod file instead of any pcm stream, I don\u2019t know.<\/p>\n<p>To add to the mess there is the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Tracker_(music_software)\" target=\"_blank\">tracker<\/a>, the most annoying and unnatural way to create music. I don\u2019t want to argue about the fact that it can do great music, it does. But we shouldn\u2019t have to deal with the tracker if we want something with MIDI + samples\/synths. Like it or not, we don\u2019t have to enter music on computer keyboard in hexadecimal anymore.<\/p>\n<p>So because the MOD file while supported is definitely depreciated, because the tools are awful, it\u2019s pretty much useless for game development.<\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/OpenAL\" target=\"_blank\">OpenAL<\/a>? No MIDI, bye. <a href=\"http:\/\/en.wikipedia.org\/wiki\/OpenSL_ES\" target=\"_blank\">OpenSL<\/a>? Just started for mobile, there\u2019s MIDI, there\u2019s a <a href=\"http:\/\/www.khronos.org\/files\/opensl-es-1-1-quick-reference.pdf\" target=\"_blank\">mapping of its data<\/a> \u2013I like to read <em>SLMIDIMuteSoloIt<\/em>&#8211; but there\u2019s no designer tools (and what the fuck these profiles mean? 3D Audio for games? On mobile? Please). <a href=\"http:\/\/en.wikipedia.org\/wiki\/Simple_DirectMedia_Layer\" target=\"_blank\">SDL<\/a>? No MIDI.<\/p>\n<p>There\u2019s the <a href=\"http:\/\/www.un4seen.com\/\" target=\"_blank\">BASS audio lib<\/a> that is supporting the playback and manipulation of MIDI files and real-time events through <a href=\"http:\/\/en.wikipedia.org\/wiki\/SoundFont\" target=\"_blank\">soundfonts<\/a>, it\u2019s cross-platform but I\u2019ve never been able to see a game using it. People use BASS to build their own little tracker or MIDI player. Soundfonts are pretty much dead too.<\/p>\n<p>The Miles Sound System seems to do everything right according to this <a href=\"http:\/\/www.radgametools.com\/msssdk.htm#midi\" target=\"_blank\">page<\/a>\u2026 But it\u2019s 4000$ so I never tried it.<\/p>\n<p>That\u2019s it. No widely available tool to help you create sound interactivity with MIDI. Microsoft had this amazing thing called <a href=\"http:\/\/en.wikipedia.org\/wiki\/DirectMusic\" target=\"_blank\">DirectMusic Producer<\/a> but they killed it when they shut down the MIDI part of Windows with Vista\u2019s brand new audio stack. They did that to simplify APIs I guess and also because nobody wanted to use MIDI (I\u2019ll get to that in part 3) but man, that was annoying to witness.<\/p>\n<p>Since then, it\u2019s all about 3D. I never really got this obsession with 3D audio. There\u2019s way too much tools for it compared to the number of people or games actually using this feature (FPS and hardcore gamers, and? Who is playing with a nice 5.1 setup? People spent like crazy for their big ass TV and thought <em>\u201cfuck it\u201d<\/em> for the audio gear, for what I saw).<\/p>\n<p>Main tools and audio engines like Fmod and <a href=\"http:\/\/www.audiokinetic.com\/en\/products\/wwise\/introduction\" target=\"_blank\">Wwise<\/a> are providing designer tools aiming for <em>\u201cvolume\u201d<\/em> features, things helping to manage huge amount of streams and sound fxs, localization files etc. Which is fine but it\u2019s now a very small part of the game development market! Teams, projects are shrinking heavily (for the best) these days.<\/p>\n<h1>What we need<\/h1>\n<p><a title=\"\" href=\"http:\/\/www.flickr.com\/photos\/18828270@N00\/5703007875\/\"><img border=\"0\" alt=\"\" src=\"http:\/\/static.flickr.com\/2659\/5703007875_0d9199ab9a.jpg\" \/><\/a>     <br \/><em>My handwriting sucks, I know<\/em><\/p>\n<p>I tried to get more specific about file formats. <\/p>\n<p>The sequencer of your choice export data in .mid (ubiquitous format), the soundbank for the sampler is provided either with dls (industry standard and there are <a href=\"http:\/\/www.crimsontech.jp\/eng\/dls\/\" target=\"_blank\">tools to edit them<\/a>) or sfz (Cakewalk\u2019s take on soundbanks), the advantage of sfz being that it\u2019s <a href=\"http:\/\/www.cakewalk.com\/DevXchange\/article.aspx?aid=108\" target=\"_blank\">highly flexible<\/a> and completely free. Plus, you just need a text editor to change things, I know programmers would be really happy with that :-) I use this format all the time and it\u2019s really nice.<\/p>\n<p>Then, .mid\/.dls\/.sfz are mixed together and controlled by scripts. I\u2019d go for Python in terms of readability but all of them would probably work perfectly. The output would be a Fmod-like pair of files separating data\/content. It could almost be only done ala command line style!<\/p>\n<p>I added a door in the synth\/filter part of the engine so that if someone wants to throw in their own filters or synths they have already coded, they can (VST format). <\/p>\n<p>Also overall, the GPU could be used to take care of heavy processing synthesis systems or shit like that. <\/p>\n<p>I see many advantages with this MIDI game audio engine:<\/p>\n<p>-A strong personality and interactivity: the game audio designer set up a <em>\u201cband\u201d<\/em> and makes it play \u2013in every way- with the game.<\/p>\n<p>-High scalability: the .mid can be reused with minimum efforts on any platform, only the <em>\u201cband\u201d<\/em> needs re-design. It\u2019s the fun part, it\u2019s like changing textures in an environment. You can have samples in 24bits 192KHz if you want or minimize to 8bits 16KHz for a small game on a phone, no problem.<\/p>\n<p>-Efficiency: .mid are a few Kb, .dll are a few dozens of Kb and soundbanks are the size you want. Between the compression settings and what your <em>\u201cband\u201d<\/em> is, I\u2019m sure an uncompressed 100 Mb soundbank \u2013in RAM- would provide more than enough for a majority of games. Graphic cards have 1 Gb dedicated c<\/p>\n<p>-Stability: editing scripts in a text editor or a free IDE is stable. Editing soundbanks in a text editor is stable. Exporting midi is trivial. Maintenance would be kept at the minimum, only the audio engine would need it. That\u2019s huge!<\/p>\n<p>Anyway, it\u2019s just some thoughts.<\/p>\n<p>Next time I\u2019ll talk about the social-economics of the game audio engine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The goal would be to provide a toolset a game audio designer could use to: -Make him able to be free and creative by using his\/her standard sequencer software and export midi\/soundbanks\/scripts in a convenient and efficient way to the game. -Minimize the programmer\u2019s work who would spend NO time on things he\/she shouldn\u2019t do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/posts\/1276"}],"collection":[{"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/comments?post=1276"}],"version-history":[{"count":0,"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/posts\/1276\/revisions"}],"wp:attachment":[{"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/media?parent=1276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/categories?post=1276"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/har0ld.com\/playground\/wp-json\/wp\/v2\/tags?post=1276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}