Timidity + Scummvm PSP MIDI

Subforum for discussion and help with ScummVM's PSP (PlayStation Portable) port

Moderator: ScummVM Team

Post Reply
mills
Posts: 8
Joined: Thu Oct 07, 2010 4:56 pm

Timidity + Scummvm PSP MIDI

Post by mills »

I was testing a homebrew called GmGearMX, (plays MIDI files using timidity) and I realized Timidity is working very well on PSP.

Even at 222 MHZ the app handles MIDI's very well, so I want to suggest if it would be possible to integrate timidity in scummvm for PSP.

Using a 4 MB GUS instrument set, MIDI fles sound great, PSP takes one second or so, to load the required samples but this could be improved setting the sound to 22050Hz.

Adlib emulation could be disabled releasing extra memory and CPU for timidity. Of course The psp wouldn't have to load the 4mb samples, becouse timidity will only load the instruments being used in the songs played in the scene (for example the intro in DOTT).

What do you think?
Bluddy
ScummVM Developer
Posts: 145
Joined: Sun Nov 18, 2007 8:43 am

Post by Bluddy »

I agree that it's a good idea. In fact I've had it on my schedule for a while to use timidity instead of adlib. Right now I'm dealing with a couple of other issues such as the long load times before cd-rip mp3 files can be played, but hopefully I'll get to it soon.
mills
Posts: 8
Joined: Thu Oct 07, 2010 4:56 pm

Post by mills »

Cool!

A set of instruments could be included in the app, I created one using a yamaha XG soundfont :),I think is free, but I don't really know... there are always trouble with these things...
I tried other sound fonts but the xg sound is the best if you compare small soundfonts. There is an AWE rom, just 1 MB but the sound is a bit strange, some instruments are duplicated.
digiday
Posts: 9
Joined: Sat Jan 15, 2011 4:36 am

Post by digiday »

I am writing to mills, who posted a message about using Timidity on October 7th, 2010, about 3 months and a week ago.

I am posting on this forum after finding the ScummVM forum via a Google search while looking for information about TiMidity... I thought someone, or anyone here may be an expert about things that have to do with TiMidity.

I have downloaded the newest version of TiMidity that I can find, version 2.13.2, but it is dated 3/01/2004, and after looking at the files and reading the "SETUP.txt" file which is the "TiMidity++ Installation guide" I can't quite figure out where to get all of the necessary files to make TiMidity work.

The very first URL that is provided in this installation guide is one of the URLs to download a necessary file... but http://www.stardate.bc.ca/eawpatches/html/default.htm is a dead URL, so it seems that it would be nearly impossible to configure TiMidity without this first necessary "Eawpatch" file.

There is an email address included in this installation guide <iz@onicos.co.jp> but it is to a Japanese email address so I'm not sure how successful I would be at getting any advice from the person who wrote this installation guide to begin with, especially since it seems that one must find so many files from across the internet to make TiMidity run.

Based on experience, can you tell me how to make Timidity work and how to gather the necessary files to make it work... or better yet, is there a way that I could somehow get the files from you to make TiMidity run?

All I'm trying to do is to use TiMidity to convert MIDI files to another audio format that can be edited in Audacity.

I'd sure appreciate it...

Thanks,

digiday
mills
Posts: 8
Joined: Thu Oct 07, 2010 4:56 pm

Post by mills »

digiday wrote:...Based on experience, can you tell me how to make Timidity work and how to gather the necessary files to make it work... or better yet, is there a way that I could somehow get the files from you to make TiMidity run?...
You just need an instrument set and a timidity.cfg that points to the instruments.

I created one in case someday there is midi support on scummvm for PSP, it is just 2.4 MB.

Link: http://www.mediafire.com/?pyqiu7duqhn5xqu

To make it work, "MIDI" and "timidity.cfg" must be inside the same folder, and timidity must be configured to read "timidity.cfg".

Hope somebody adds timidity to scummvm for PSP... just 2.4 MB RAM and 10% CPU is needed for the PSP to use this tiny set of instruments and the sound is really much better than adlib emulation.
digiday
Posts: 9
Joined: Sat Jan 15, 2011 4:36 am

Post by digiday »

Hi mills,

Back in January, a few days after I made this post, I figured out the details about installing TiMidity and making it work. Since then I have published this Master's thesis paper on this subject elsewhere.

Here is that dissertation in case anyone else wants to install and make TiMidity really work.
______________________________________________

MAKING "TiMidity" WORK

What is "TiMidity"?... (that's TiMidity with a capital M)... when I searched for information on it I found data about a psychological complex having to do with shyness... but that's not what I was trying to find out about.

TiMidity is a little application for Windows computers, XP, Vista and Windows 7, that converts MIDI music files in to usable, editable audio WAV files that can then be used in other apps like movie making applications and audio editing applications. TiMidity does not have a normal installer .exe file to use to make it work on your computer... it is a difficult little app that is a pain to get the correct files for and make it work.

If you don't already know what a MIDI song file is, (Musical Instrument Digital Interface) it is akin to the roll of paper that makes a player piano play... your computer has a digital player piano in it, and all operating systems vary a bit in how that digital piano sounds. Or another analogy is that your computer has digital musical instruments in it and downloading a MIDI file is like bringing in the digital musicians to play the digital instruments that already exist on your computer.
.. and there are millions of little free digital musicians with millions of songs in their heads out there on the internet.

There are thousands of websites out there dedicated to MIDI music... there are even live MIDI recording performances that take place in some cities.

See this link for more on MIDI...
http://en.wikipedia.org/wiki/Musical_In ... _Interface

Apparently, TiMidity had more support for development on the Linux platform, but not for Windows, so that is why the installer for Windows is not really an installer, but just some of the files needed to place that make TiMidity a working application.

So one day, I finally had success installing TiMidity and making it convert MIDI files to the editable WAV format that can be converted to MP3 and edited in Audacity and other audio applications... here are the simplest set of instructions possible for this strange little unsupported free app...
__________________________________________________

HOW TO INSTALL TiMidity AND MAKE IT WORK

Download TiMidity++-2.13.2-cvs20100919.win32.zip from here: http://sourceforge.net/projects/timidit ... 2B%2B-CVS/

Download the 8MBGMSFX.SF2 soundfont from here: http://alsa.opensrc.org/8MBGMSFX.SF2

Any general MIDI soundfont will do, but this is a reasonable quality one that's not too big (about 8 MB).

Extract TiMidity++ from the zip file to your hard drive.
Note: TiMidity does not appear to support long file names so place it at the top level of the C:\ drive

Assuming that you now have the path: C:\TiMidity++\
Create a new folder called soundfonts and place it in TiMidity
so you now have the path:
C:\TiMidity++\soundfonts\

Move the 8MBGMSFX.SF2 file that you previously downloaded into the folder C:\TiMidity++\soundfonts\
so you now have the path:
C:\TiMidity++\soundfonts\8MBGMSFX.SF2

Create an empty file in Notepad called 8MBGMSFX.cfg and place it in the soundfonts folder, so you now have the path:
C:\TiMidity++\soundfonts\8MBGMSFX.cfg

Open 8MBGMSFX.cfg in Notepad and enter the following raw text and then save that .cfg file:
dir "soundfonts"
soundfont "8MBGMSFX.SF2"

Create a Desktop shortcut to C:\TiMidity++\timw32g.exe

Double click on the shortcut to launch TiMidity.
There may be an error message about config.cfg not being found - that's normal because you haven't configured it yet... I didn't get that message my first time opening it though.

Click on "Config" and select "Preference"
In the Config File box, press the "Config File" button and select the 8MBGMSFX.cfg file.
Press "Apply" and "OK",
The 8MBGMSFX.cfg file should now be loaded and be the default.

To play a MIDI file
Click "Output > Windows Audio Driver" (it should already be set to this)
Drag and drop a MIDI file onto TiMidity.

To render the MIDI file to a WAV file
Click on "Config" and select "Preference"
Below the "Output" pane, click the "Output File" button to set the output directory and file name. You can select "Output: "RIFF WAVE file" in the "Output" pane above, but this changes the output without changing the "Output" menu choice in the main window, and then further changes in the Output menu have no effect in that TiMidity session. So better to click "OK" now in "Preference", then click "Output: "RIFF WAVE file"

Finally, drag and drop a MIDI file on top of the TiMidity application interface to start rendering the MIDI as a WAV file. The file will be complete when the timer in the display stops running (you won't hear any sound during this process)... this is a faster than real play time process that is pretty quick.

For better or different sound quality, use a different soundfont and create a similar config file for it.

I'll say that I found there are two things that make the difference between TiMidity producing good WAV files that have sound data and TiMidity producing full size WAV files that DO NOT have any sound data.

1) Just choose "RIFF WAVE file" under output to begin with and don't bother choosing "Windows audio driver" first in order to listen to the MIDI file... you already know what it sounds like, though if you do use TiMidity for an audio PLAYER, then DO choose the "Windows audio driver"

2) Then have your settings in "Config>Preference>Output" chosen before hand, before the file is dropped on to TiMidity, with a destination folder and a generic name for new file conversions like "newSONG.wav" or something like that which can then be later changed on the file itself to match the original MIDI song file name... these two steps made the difference in successfully producing WAV audio files out of MIDI song files.

So it is a special, tricky little process to convert something that is a piano, organ, violin and drums player along with all of the instruments that it plays in to an editable audio file format... that's what TiMidity does.


Happy MIDI converting...
digiday

mills
Posts: 8
Joined: Thu Oct 07, 2010 4:56 pm

Post by mills »

Cool, it's a bit difficult to understand timidity the first time, but I was talking about PSP.
Anyway it's also usefull for people to use their own soundfont in case someday PSP can use them... I used a 10 MB soundfont in Timidity-PSP, I think is the largest PSP can load.
Post Reply