View Full Version : tclabc and timidity

17th November 2008, 03:53 AM

is it possible to get tclabc and tkabc gui to directly use timidity++, such that i could play a set of notes from tkabc with out manually creating a midi file first?

I found some info that suggests it might work, but the instructions dont seem to detail the process all the way: timidity-howto (http://koti.mbnet.fi/bstrom/filedata/en/my-timidity-howto.html#getting)

$ wish tkabc.tcl
no output MIDI synth
open: No such file or directory
cannot open MIDI in '/dev/midi00'

So id probably like to get timidity linked with that file? Started timidity as ALSA server, but theres still some work to do before its mapped with /dev/midi :confused:

17th November 2008, 05:39 AM
Yes you can do this but you'd probably be better off using something like fluidsynth rather than timidity (which is a bit slow - edit: that's with default settings, eg using -B2,8 helps a lot)

Basically, you create a virtual midi dev /dev/midi1 and use jack to route midi from there to timidity: (or use aconnect, see 2nd post below)

Here goes:

To make this easy you really need the gui frontend for jack, qjackctl

yum install qjackctl

Now you need to load the virtual midi kernel module, creating one midi device, /dev/midi1

modprobe snd_virmidi midi_devs=1

Now start qjackctl, in setup you'll need to disable realtime mode (to use realtime you must add yourself to the jackuser group first and log out/in, it's not worth it for timidity with tkabc which isn't very responsive anyway), then press start.

Now start timidiy as an alsa sequencer client talking to the jack daemon using

timidity -iA -Oj &

Now launch tkabc and go to Options->Preferences -> MIDI, and set MIDI out as '/dev/midi1', restart tkabc.

In Qjackctl, click on Connections and in the Alsa tab ensure 'Virtual Raw Midi 1-0' is connected to 'Timidity'

edit: you can get much better responsiveness from timidity by playing with the various options, eg 'timidity -iAqqq -B2,8 -Oj &' gives far better response on my machine.

17th November 2008, 03:20 PM
Thanks for response :)

I can only test exactly what you said later. But from what i tested before, it seemed the yum version of timidity++ doesnt have the j-option compiled in. Do i have to compile from src or?

17th November 2008, 10:30 PM
the F9 repo version has the j option, I'm sure the F8 version should be the same, the man page may be out of date.

You should probably be upgrading to F10 now (release next week) as F8 repos will not receive any updates after next month.

EDIT: you don't actually have to use the -Oj option anyway! qjackctl lists timidity in the alsa connect tab regardless (I should have realised that, duh)

NB. you have to reconnect the Virtual Raw Midi output to timidity in the 'Connect' dialog of qjackctl (ALSA tab) everytime you restart timidity. (start with 'timidity -iA -B2,8 &' and stop with 'killall timidity')

If you want a more sophisticated notation editor with multi-tracks and polyphony try Rosegarden with fluidsynth (use qsynth and qjackctl gui to setup) and vkeybd (search the forum for howtos)

If you don't want to use jack, then you can just type 'timidity -iA -B2,8 &' and connect the virtual midi port to timidity with aconnect. eg on my machine it's 'aconnect 20:0 128:0', where the port numbers can be found by typing 'aconnect -o' and 'aconnect -i'. I find the qjackctl gui easier to use especially if you have several audio apps running