Author Topic: DIGMID patches (MIDI playback)  (Read 2401 times)

monkey0506

  • Posts: 7,031
  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
DIGMID patches (MIDI playback)
« on: 05 Feb 2016, 20:22 »
The instructions for various ports mentions that MIDI playback requires the DIGMID patches, and recommends using "Richard Sander's GUS patches". The instructions say to rename the "digmid.dat" to "patches.dat" and place it in "/sdcard/ags" (on Android, other locations on other platforms), but this apparently doesn't work. This causes the annoying "Error: DIGMID patches set not found".

I have found that by downloading the Gravis ULTRASND Files and extracting the "Gravis ULTRASND Files/ULTRASNDPPL161/MIDI" folder to "/sdcard/ags", Allegro is able to correctly load the MIDI patches and play back MIDI music! Presumably these patches could be built into a single patches.dat file, but that doesn't seem necessary, I don't believe there is a benefit to doing so, and based on current experiences with patches.dat, it may not even work correctly that way.

Regarding standalone Android apps, I am currently trying to determine the correct location for the MIDI patches, as the engine does not seem to read them back from "/sdcard/ags" nor from the game files' location. I will update this post when I am able to determine the correct location for this situation. :-D

Mehrdad

  • Posts: 422
    • I can help with animation
    • I can help with characters
    • I can help with story design
    • I can help with web design
Re: DIGMID patches (MIDI playback)
« Reply #1 on: 06 Feb 2016, 14:58 »
Nice job. I tested it on my phone (Sony Xperia z1 Android 5.1) and works fine ;-D
Thanks so much Monkey0506 . I'm waiting for other good news from Android port.
« Last Edit: 06 Feb 2016, 15:03 by Mehrdad »

Crimson Wizard

  • Local Moderator
  • Posts: 8,811
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: DIGMID patches (MIDI playback)
« Reply #2 on: 22 May 2016, 11:47 »
A user reported a different solution that worked for them:
https://github.com/adventuregamestudio/ags/pull/330

Quote
I have a Galaxy S5 running Cyanogenmod 13 (Android 6.0.1) and couldn't get AGS Android to play MIDI files despite having the patches.dat file downloaded from this link: http://alleg.sourceforge.net/digmid.html The game I tried was Yahtzee's Five Days a Stranger

I found out that the actual patches.dat is compressed, I opened the file with 7-Zip and found a patches1

So I extracted this patches[1] file, copied it to ags, deleted old patches.dat, renamed patches[1] to patches.dat. From there, I tried running Five Days a Stranger again, and sound worked perfectly. The original patches.dat file is 19MB, but after extracting, it grew to 25MB.


I do not have mobile device capable to test this, so I'll leave this for those who may.

Crimson Wizard

  • Local Moderator
  • Posts: 8,811
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: DIGMID patches (MIDI playback)
« Reply #3 on: 24 May 2016, 15:59 »
I managed to partially test this method out on Atergos Linux, when running AGS game under Wine. It reported problem of DIGMID patches not found, but after I did one of the solutions (either unpacking patches.dat or Gravis MIDI "pat" files in the game folder) it stopped doing that.
Although it still failed to create digital driver, but error was now different, and probably unrelated to DIGMID problem. One thing for sure, both methods mentioned above seem to have similar effect.

EDIT: I should probably also note that when running Linux port itself, it produces no midi-related errors, but MIDI music does not play at all (although digital sounds do). I think there were reports of MIDI not playing on Linux before, but idk if that's a global issue or affects particular users. Putting patches file into game directory produces no effect.
« Last Edit: 28 May 2016, 11:45 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
  • Posts: 8,811
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: DIGMID patches (MIDI playback)
« Reply #4 on: 02 Jun 2016, 16:01 »
I got reply from Mehrdad, whom I asked to test out this new solution, and it seem working.

So, basically, the problem all this time was that the digmid.dat, available by the mentioned download link, was in fact a bzip2 archive, which in turn contained the correct file.

The proper installation steps should be:

For midi music playback, you have to download GUS patches. We recommend "Richard Sanders's GUS patches" from this address:

http://alleg.sourceforge.net/digmid.html

A direct link is here:

http://www.eglebbk.dds.nl/program/download/digmid.dat

Rename that file to patches.dat and place it into the ags directory alongside your games.
* open the digmid.dat you downloaded with any Zip-manager, and unpack the file found inside (it should be named after the name of the archive).
* remove the original archive, and rename the file you unpacked to "patches.dat".
* put this file into ags directory ('/sdcard/ags' for Android).

JanetC

  • Mittens Serf
  • Posts: 117
Re: DIGMID patches (MIDI playback)
« Reply #5 on: 01 Sep 2016, 21:53 »
Thanks for the info, Crimson Wizard! I had exactly the same issue on iOS and the same solution worked (copying patches.dat into the bundle)