Hello Timidity Developers,
I'm pretty new to Timidity, but have been able to successfully build
and test the rebuilt image under cygwin succesfully on a WinXP based
machine.
My real goal is to be able to build Timidity on a platform which is
linux-like, but
uses a different C compiler than gcc. When I tried to run ./configure
using the tool chain and development environment for my hardware platform
it complained that there was no suitable c compiler available and quit.
Can anyone point me to some documentation regarding porting Timidity
to a new platform and compiler suite, or gone through the experience
themselves?
Is it practical to create a new makefile manually without using the
configure script?
Any help/suggestions are appreciated.
Richard Bagdazian

> Date: Thu, 15 Jan 2009 15:30:31 +0000
> From: Jonathan Gazeley
> <jonathan.gazeley@...>
> Subject: Re: [timidity-talk] Running Timidity as a service
>
> Hi Jimmy,
>
> Thanks for your response. What I don't understand is
> why timidity is
> trying to use jack at all. I want it to use alsa, and so
> when I run
> timidity from the command line by hand I use the -iA
> switches, and it
> all works fine. So I don't know why it is trying to use
> jack as a
> backend when I run it as a service.
>
> I guess if it can't easily be fixed, I will just have
> to write something
> that starts timidity when I start my midi program.
>
> Cheers,
> Jonathan
Jonathan,
If I want to play a midi file directly, asumming Alsa midi kernel module(s) have been loaded:
timidity /some/path/to/some_song.mid
Or, I also use
timidity -A90a,90a -in -Os /some/path/to/some_song.mid
You can lookup the Timidity manual page for some pointers on options I used above.
If I want to have timidity run in server mode (wait for midi input), I would use the -i option. The -iA tells timidity server to use the Alsa midi api to wait for input. For example, I can have timidity or fluidsynth run in server mode, then use kmid, or aplaymidi to send midi events to the Alsa-midi server. Of course, this will need something like aconnect, aconnect-gui or others to connect those Alsa-midi ports together. I can also use vkeybd, or a real midi keyboard/drum to play along, too.
Timidity also needs to know where to send the audio output to, here the -O is used. With -Os, the audio output is sent to Alsa audio device driver. With -Oj, the output is sent to Jackd, which normally is sent to Alsa Audio output on Linux. Although, with jackd, the audio data could be sent to other jackd plugins to process audio (reverb, echo, special effects) before sent to Alsa audio device driver.
So with
timidity -iA -B2,8 -Oj
I have timidity running as an Alsa-midi server, output to jackd.
With
timidity -iA -B2,8 -Os
I have timidity running as an Alsa-midi server, output to Alsa audio device driver.
>From what I understand, Alsa device driver only allows one application to send audio output to it. So If you want to use multiple applications to send multiple audio output streams to Alsa device driver, Alsa doesn't allow it. I think that's why jackd was written for this purpose.
Jackd adds a little bit extra layer into the process, but can mix multiple audo streams, also allow special effects and other jackd capable apps, too.
For example, if I want to play a .WAV, or .MP3 file and play along some midi instruments (keyboard, drums...), then Alsa won't allow those apps to send those outputs concurrently to Alsa device driver, only one app at a time.
Jackd is the app that outputs to Alsa device driver, has its own API to let other apps send audio data to it to send to Alsa. Jackd latency is very good. So I can use some apps like Kaffein to play MP3, WAVE to send audio to jackd. At the same time, plays midi instrument (midi keyboard, midi drums), or midi applications like timidity, kmid, vkeybd, or all of these at the same time sending audio output to jackd.
Recent jackd releases also aims to synchronize midi and audio output using high-resolution timer as a way to mix audio and midi output. Previously, people have had issues with with mixing midi audio output and other audio streams (prerecorded, or live audio), timing wise to achieve near-hardware mixing. Recent jackd releases along with the new jack-midi-api (not the old Alsa-midi api) aim to achieve this. I haven't use these specificly so I don't know how well jackd has delivered on this front.
Jimmy

Ben Fisher <boinjyboing@...> writes:
> ... I develop in Windows but a Linux port should be straightforward
> because I'll write it in Python.
Portability would depend on the GUI toolkit used. I would strongly
advice to use wxWidgets since this toolkit is supported on many
platforms, and well-supported by python.
-- Johan

This sounds like an excellent idea. I've used midi for years and often
wished such a tool was freely available.
I'm not familiar with Python but I'd be glad to help you with testing etc.
Cheers,
Jonathan
Ben Fisher wrote:
> Hi,
>
> I'm a Windows user, but a long time ago (around 8 years) I would use
> Timidity to play midis, using the nice eawpats set and so on.
>
> Now, I'm going to write a program that is a graphical interface for
> converting midi to wav (or mp3), with Timidity++ being the backend. I
> have a collection of midi files of mostly nostalgic value, but since
> the default midi capabilities of new computers sounds bad or at least
> different, I'm making mp3s of the songs to keep as well. The idea of
> the program is to make it easier for people (like me) on Windows to
> convert a midi to mp3, and to specify which patches to use for which
> instruments. The program will also let you change the volume of the
> tracks, with a mixer. I think I'll call it something along the lines
> of "Timidi to mp3", and will be GPLd. I develop in Windows but a Linux
> port should be straightforward because I'll write it in Python.
>
> I realize the project is out of date, but I figure since it won't be
> that much work to do, I might as well. Also, these days computers come
> with pretty bad midi sounds, at least to my ears. It disappoints me
> when I friends talk about how bad MIDI music is, as they don't realize
> that MIDI doesn't inherently sound bad, it's just the bad
> soundcard/default quicktime that sounds cheesy.
>
> I should be able to finish this in about a month (factoring in the
> other things I'm doing), and have some ideas in mind on what features
> it will have, but I thought I would post here to see what others think.
>
> -Ben
> halfhourhacks.blogspot.com

Hi,
I'm a Windows user, but a long time ago (around 8 years) I would use Timidity to play midis, using the nice eawpats set and so on.
Now, I'm going to write a program that is a graphical interface for converting midi to wav (or mp3), with Timidity++ being the backend. I have a collection of midi files of mostly nostalgic value, but since the default midi capabilities of new computers sounds bad or at least different, I'm making mp3s of the songs to keep as well. The idea of the program is to make it easier for people (like me) on Windows to convert a midi to mp3, and to specify which patches to use for which instruments. The program will also let you change the volume of the tracks, with a mixer. I think I'll call it something along the lines of "Timidi to mp3", and will be GPLd. I develop in Windows but a Linux port should be straightforward because I'll write it in Python.
I realize the project is out of date, but I figure since it won't be that much work to do, I might as well. Also, these days computers come with pretty bad midi sounds, at least to my ears. It disappoints me when I friends talk about how bad MIDI music is, as they don't realize that MIDI doesn't inherently sound bad, it's just the bad soundcard/default quicktime that sounds cheesy.
I should be able to finish this in about a month (factoring in the other things I'm doing), and have some ideas in mind on what features it will have, but I thought I would post here to see what others think.
-Ben
halfhourhacks.blogspot.com
PS By the way, it looks like the wiki at http://timidity-docs.sourceforge.jp/cgi-bin/hiki/hiki.cgi?NEWS-2.13.1 is inaccessible now, so I've been using archive.org to read it.

Hi Jimmy,
Thanks for your response. What I don't understand is why timidity is
trying to use jack at all. I want it to use alsa, and so when I run
timidity from the command line by hand I use the -iA switches, and it
all works fine. So I don't know why it is trying to use jack as a
backend when I run it as a service.
I guess if it can't easily be fixed, I will just have to write something
that starts timidity when I start my midi program.
Cheers,
Jonathan
jimmy wrote:
> I use Debian, not Fedora, so there might be some config differences.
> I don't know about the HOME environment thing right off the bat. If someone knows, please answer. Else, someone may have to look into Timidity source code to figure out.
>
> As for server socket error, and "jack server is not running or cannot be started", I think it is one and the same. The problem is the new "jackd" version, the message "jack_client_new: deprecated" points to the real cause.
>
> Timidity code still uses jack_client_new() as a mean to connect to jackd. However, with the new jackd, and libjack0 both are at version 0.116.1-2 in Debian Sid (unstable), the call to jack_client_new() doesn't seem to work.
>
> I tried the following code in jack_a.c
>
> static int detect(void)
> {
> jack_client_t *client;
> jack_status_t status;
> /* ---OLD--- client = jack_client_new(TIMIDITY_JACK_CLIENT_NAME); */
> /* open a connection to the JACK server */
> client = jack_client_open (TIMIDITY_JACK_CLIENT_NAME, JackNullOption, &status);
> if (! client) {
> ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
> "jack_client_open() failed, status = 0x%2.0x\n", status);
> return 0;
> }
>
> jack_client_close(client);
> return 1; /* found */
> }
>
>
> and equivalent code in
>
> static int open_jack(void)
>
> function of the same file. It seems jackd deliberately breaks that old jack_client_new() API call. Otherwise, they could have easily use similar code as shown above to implement jack_client_new(), which is simple enough to keep old apps working without changes. Either that or they don't care for backward compatibility in this case, and force everyone to use new code.
>
> Jimmy
>

> Date: Tue, 13 Jan 2009 19:29:48 +0000
> From: Jonathan Gazeley
> <jonathan.gazeley@...>
> Subject: [timidity-talk] Running Timidity as a service
. . .
> [jonathan@... ~]$ sudo service timidity start
> [jonathan@... ~]$ file mcoputils.cc: line 499 (static
> std::string
> Arts::MCOPUtils::mcopDirectory()): assertion failed: (home
> != 0)
> HOME environment variable not set?
> jack_client_new: deprecated
> Cannot connect to server socket err = No such file or
> directory
> Cannot connect to server socket
> jack server is not running or cannot be started
> no message buffer overruns
> Couldn't open output device
>
>
> I tested that I can successfully run timidity using sudo:
>
> [jonathan@... ~]$ sudo timidity -iA
> TiMidity starting in ALSA server mode
> Opening sequencer port: 128:0 128:1 128:2 128:3
>
> Does anyone have any ideas what might be up?
>
> Cheers,
> Jonathan
I use Debian, not Fedora, so there might be some config differences.
I don't know about the HOME environment thing right off the bat. If someone knows, please answer. Else, someone may have to look into Timidity source code to figure out.
As for server socket error, and "jack server is not running or cannot be started", I think it is one and the same. The problem is the new "jackd" version, the message "jack_client_new: deprecated" points to the real cause.
Timidity code still uses jack_client_new() as a mean to connect to jackd. However, with the new jackd, and libjack0 both are at version 0.116.1-2 in Debian Sid (unstable), the call to jack_client_new() doesn't seem to work.
I tried the following code in jack_a.c
static int detect(void)
{
jack_client_t *client;
jack_status_t status;
/* ---OLD--- client = jack_client_new(TIMIDITY_JACK_CLIENT_NAME); */
/* open a connection to the JACK server */
client = jack_client_open (TIMIDITY_JACK_CLIENT_NAME, JackNullOption, &status);
if (! client) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
"jack_client_open() failed, status = 0x%2.0x\n", status);
return 0;
}
jack_client_close(client);
return 1; /* found */
}
and equivalent code in
static int open_jack(void)
function of the same file. It seems jackd deliberately breaks that old jack_client_new() API call. Otherwise, they could have easily use similar code as shown above to implement jack_client_new(), which is simple enough to keep old apps working without changes. Either that or they don't care for backward compatibility in this case, and force everyone to use new code.
Jimmy

(resend from other email address)
On Friday 09 January 2009 15:19:37 pe3no wrote:
> Hi,
>
> this is Piotr from Poland (Warsaw) - nice to meet you :)
>
> I have Ubuntu 8.04 with Timidity++ installed by command "sudo apt-get
> install timidity". It works fine, using FreePats, but I need to use
> Contrabass (Double bass) which is missing, as I read in
> http://freepats.opensrc.org/freepats/README
>
>
> " [...] MISSING PATCHES [...] Tone Bank 000: [...] 043_Contrabass.pat"...
>
> I'm trying to add double bass to my instruments samples but with no
> success... After some hours of Googling and many tests I understood
> something but not everything:
You can also use timidity++ with the more complete fluid-soundfont-gm. You can
also install it with "sudo apt-get install fluid-soundfont-gm".
After this you will have to
gunzip /usr/share/doc/fluid-soundfont-gm/fluidr3_gm.cfg.gz somewhere and then
include this config file in the timidity.cfg file.
Joost

Stéphane Rollandin writes:
> in the error message it seems that timidity is looking at 0,43 here,
> while you wrote 0 1 in your /etc/timidity/freepats.cfg. the error
> should then be
> "Couldn't load instrument /etc/timidity/acbass.sf2 (tone bank 0,
> program 1)"
>
> so maybe try again and make sure it is actually looking at the right
> place
>
> regards,
>
> Stef
>
> (I do not have a double bass patch either, sorry)
Hello again, Stéphane
And again thank You very much for Your valuable help :)
I decided to reinstall my Ubuntu (maybe I install a newer version),
so I'd like to do a really good job with my Timidity++
I listened to imis samples and they're really beautiful :) :) :)
I'd really love to use them for my Double Bass midi.
Could You, please, explain me how to do it? I'd be very grateful.
What shoul I place in my config files and where to place the directories
with Double Bass flac files?
Thank You very much in advance.
BestRegards~~Piotrek~~pe3no.

Hi,
this is Piotr from Poland (Warsaw) - nice to meet you :)
I have Ubuntu 8.04 with Timidity++ installed by command "sudo apt-get install timidity".
It works fine, using FreePats, but I need to use Contrabass (Double bass) which is missing,
as I read in http://freepats.opensrc.org/freepats/README
" [...] MISSING PATCHES [...] Tone Bank 000: [...] 043_Contrabass.pat"...
I'm trying to add double bass to my instruments samples but with no success...
After some hours of Googling and many tests I understood something but not everything:
1). I understood that I have to make changes in my "/etc/timidity/timidity.cfg"
Probably I have to hash this line: source /etc/timidity/freepats.cfg
And add another line to use "sf2" or "imis" - but have no idea how to do it :(
2). I found the place where my instruments are kept - /usr/share/midi/freepats/Tone_000/
... but unfortunately "043_Contrabass.pat" is missing ...
Is there a possibility to get a working ready Contrabass.pat from someone of You? :)
This would be the simpliest solution for me, but after reading a lot in Your web site,
I can't understand how to "produce" this file myself... so I ask this file from You :)
3). How could I use "sf2" http://freepats.opensrc.org/sf2/
I'm trying to guess that file http://freepats.opensrc.org/sf2/acbass.sf2 could be maybe
"acoustic bass - sf2" - but I have no success trying to use it...
I tried hashing "source /etc/timidity/freepats.cfg" in my timidity.cfg and I added this line:
"soundfont /etc/timidity/acbass.sf2 order=0", after downloading "acbass.sf2" to /etc/timidity/,
but it didn't work either...
4). How could I use "imis"? http://freepats.opensrc.org/samples/imis/
From what I see there's a subfolder called "DoubleBass" :) :) :)
Where do I have to place the main directory with their subdirectories and "*.flac" files?
How to modify the fimidity.conf file and what other I need to do?
Generally, for me the best solution would be to leave FreePats and add the 043_Contrabass.pat
which is missing, but I'm ready to use also "sf2" or "imis" - with Your valuable help :) :) :)
Thank You in advance.
BestRegards~~Piotrek~~pe3no.