TiMidity++ is a softsynth. It takes in a MIDI file, then uses a sound font or sound patch to transform it into normal audio. You can use it to convert MIDI files directly into the WAV format, or you can use it to play the file through the speakers. Another things it can do (the most useful IMHO) is run as a daemon to give you an Alsa port for MIDI playback. This lets all those other audio programs that normally play MIDI files through a port to use Timidity instead. In my case, I use it to let me play MIDI files from Audacious (using the Amidi-plug plugin). I believe it should also work with Rosegarden (a sequencer). The aplaymidi program can also use it. Basically it mimics what would happen if you had and properly configured a soundcard which is MIDI capible. This uses more CPU power than letting the card do it though. Not a huge amount - modern PCs should handle it fine - but if you're also doing some heavy lifting in other programs it could probably get pretty choppy (renicing it to a higher priority should help).

Note: When I compiled this, I didn't enable any interactive interfaces except for ncurses. If playing files with Timidity directly, you can either use it with no interface:

Code:

timidity /path/to/my/midi_file.mid

or you can use ncurses like this:

Code:

timidity -in /path/to/my/midi_file.mid

The best deal though, is to set it up as a daemon to create that Alsa port, then get your normal audio player to send MIDI through that. I don't know if you can do it with Gxine, but I think you can with Mplayer. I know you can with XMMS and Audacious. I just uploaded a version of Audacious with a working 'Amidi-plug' plugin over here. For XMMS you're on your own, but I think there are both 'Amidi-plug' and 'Timidity' plugins, either of which should be fine. The Audacious package I linked to is already configured to use this.

So, how to set Timidity up this way? Easy. I added a script at /etc/init.d/timidity_server to do it automatically at every boot. If you want to disable it, just remove the executable bit on that script (chmod 644 /etc/init.d/timidity_server to remove, and chmod 755 /etc/init.d/timidity_server to make it executable again). There's one catch: when you first install this the daemon won't be started automatically until you reboot. To start it by hand just run this:

Code:

/etc/init.d/timidity_server start

I mentioned that it uses a sound font or sound patch to make the audio from the MIDI file. Sound patches are a bunch of samples of audio from different instruments and what not that Timidity will transform appropriately to match the note which is supposed to be played. Sound fonts are essentially a group of patches combined into a single file, but not as simple as that. They also support more features than patches.

Sound fonts and patch collections can be quite large (up in the 70 megabytes or more). Because we are puppians, I tracked down and included a "very small" (~4 mb) collection put together by Shom. (Shom's TiMidity++ page)

For those who'd like better quality, I also made a package of the ~30 mb 'eawpatches' collection from Gentoo. When installed it will automatically set itself as the default To revert to 'minishom', go to /usr/share/timidity/ and symlink 'minishom/' to 'current/'.

Note: if you are using it as a daemon for Alsa, you'll have to restart it before a change in patches will take effect. The hard way is to reboot. The easy way is /etc/init.d/timidity_server restart

Configuring Timidity to use any old patch or font you download is an exercise left to the reader. I did simplify things a little by setting up Timidity to look in /usr/share/timidity/current/timidity.cfg for the data, where the 'current' directory is actually a symlink. This way you can have multiple sound fonts / patch collections each in their own director of /usr/share/timidity (or elswhere and symlinked in, to save space in the savefile in case you use large ones). Within each directory you'll want to set up a 'timidity.cfg' file to use whatever fonts or patches you put in it. Then to switch, just change where the 'current' directory points. And as above, if you're using it as a daemon you'll need to restart it before the change takes effect._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

This is really great!!! Only half the size of the official version. Thank you Pizzagood!

If you want to use a sf2 soundfont, is all very simple. Add the soundfont to /usr/share/timidity/timidity.cfg. In my attached example of timidity.cfg, The fluidR3_GM is first loaded, then the additions for GS - fluidR3_GS. Then, to get the best piano, the steinberg soundfont will override piano sounds from fluidR3.

Thanks Pizzasgood and Zigbert for addressing these midi problems I have been saddled with for several weeks.Obviously I am not the only newbie who didn't know whether to scratch his watch or wind his arse when it came to getting sound from Rosegarden ,timidity ,Qtractor and several others.Seems I read where another newbie quoted said "I have completely given up trying to get a decent home studio operational in Linux" I suppose he went back to brandx.I can't say I have done as you suggested yet but at least now I have some directions to try.Thanks,bill

It should come with the package I uploaded, which is also the only way to get that particular script since I wrote it myself. Also, it should already be executable, so you won't need to chmod it unless you change it to non-executable. The only step you should have to do manually after installing is:

Code:

/etc/init.d/timidity_server start

And that's optional - it will happen automatically after you reboot (assuming you haven't made the timidity_server script non-executable).

Pretty much all the script does is execute this command which I copied out of Gentoo:

Code:

timidity -iA -B2,8 -Os -EFreverb=0 &

It has some extra logic in there to let you stop or restart it without having to manually kill it, but nothing else. The above command should work with any timidity package, so long as alsa sequencer support was compiled in.

Thanks alot Pizzasgood.Your above post has clarified some questions I had and also opened some other questions I have "Like exactly ,how do you want a application to work (me) I can't recall brandX ever allowing me to do setups as I wish they would work,and this "new choices" is something very foreign to my thinking. I realize of course there are many things I am required to learn and understand but with the help of more experienced users ,the answers are out there.thanks again for your time and effort.cheers,bill

Thank you for the "Timidity pet" Pizzasgood. It works well. I have used the file manager to browse to /usr/bin and dragged the timidity icon to the jwm desktop. Now I can drag and drop a midi file from my midi file directory and it instantly plays the file. I also changed the icon to one of my choice with a right click on the new desktop icon and changed the icon with a further drag and drop (as per the instruction balloon that popped up)

If you want to just click a .mid file to play it, you could right-click a .mid file, go to "file -> set run action", and set it to this:

Code:

timidity "$@"

Make sure the radio button above is set to "Only for the type `MIDI audio' (audio/midi)" so you don't change the setting for all audio files!

BTW, the desktop itself is created by ROX-Filer, not JWM. JWM just does the taskbar and the window decorations (titlebar and borders, but not scrollbars and such, which are usually GTK but could be other things (QT, TK, etc.)). I think in 4.2 JWM also handles those popout trays on the sides and top. Not sure._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Hi Pizzasgood,
Many thanks for timidity++-2.13.pet!
I installed it with PetGet, "all dependecies installed", restart the PC and got a menu entry under Multimedia.
Clicking on it got...nothing happening..?
Re-reading your post a saw:

Quote:

Note: When I compiled this, I didn't enable any interactive interfaces except for ncurses. If playing files with Timidity directly, you can either use it with no interface:

is that to say that there is no GUI?

How could I do to get one ... I remember (may be I am wrong.... that on timidity-2.13.pet there was one..? I uninstalled it before installing timidity++-2.13.pet)

Furthermore, how could timidity start automatically - as defaultmidiplayer - when clicking on a midifilekey found on a musicscore website (i.e. 8notes) to play it without loading it?

This is my version of Timidity that has a gui. Unpack and copy it into /usr/bin (first rename Pizzasgood's version timidity-org). Open a terminal and type timidity -ig. It should come up (GTK gui). Mine looks for config info in /etc and in /usr/share/timidity (timidity.cfg). To get timidity into your menu system, unpack the timidity desktop file and copy it into /usr/share/applications. Then, in a terminal, run fixmenus. After restarting your x server, timidity should appear in your multimedia menu as Timidity++. Good luck.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum