[linux-audio-user] redirecting pmidi output

Dave Phillips dlphilp at bright.net
Mon Nov 22 13:44:59 EST 2004


Hi Mark:

  Let's see if I can help here...

>With timidity you can specify the output and name a
>file for it; ex. 
>timidiy -P ocarina.pat whistle.mid -Ow whistle.wav
>
>How does one accomplish the same thing with pmidi? 
>I've tried the following variations:
>pmidi (-p 129:0) whatever.mid >> whatever.wav
>pmidi whatever.mid > whatever.wav
>pmidi whatever.mid | whatever.wav
>
>... but none seem to work.  Do I need to try something
>involving 'cat' and '/dev/dsp'?  (I'd try it directly,
>instead of pestering you guys, but I'm not at home on
>that machine right now).
>

I look at 'man pmidi' and find this description:

"The  pmidi  command  reads  in  the specified midi files and plays them 
through the ALSA sequencer.  You can specify on the command line  which 
sequencer  port  that you wish to use.  Use the -l option to get a list 
of possible sequencer ports for your machine."

In other words, pmidi is a player, not a converter. I think you're 
trying to use it for something it won't do.

Of course you can connect it (via aconnect or the alsapatchbay) to any 
sound device and capture the audio output (the PCM channel on your 
mixer) with arecord.

GUI tools are available for all this stuff...

>Alternatively, does timidity allow using a different
>softsynth than the .pat files, such as amsynth or
>fluidsynth? How do you specify the port like you do
>with pmidi?
>  
>
First, you set your TiMidity patch preferences in $HOME/timidity.cfg. 
You can use SF2 soundfonts as well as the Gravis GUS PAT files. Here's 
what my timidity.cfg looks like these days:

soundfont /home/dlphilp/soundfonts/FluidR3_20GM.sf2
# soundfont /home/dlphilp/soundfonts/PC51f.sf2
# soundfont /home/dlphilp/soundfonts/8mbgmsfx.sf2
# soundfont /home/dlphilp/soundfonts/GS_Roland_Sound_Set.sf2

I just uncomment when I want to switch font sets. There's probably some 
TiMidity switch that makes managing soundfonts easier but I haven't 
needed to look for it yet. :)

TiMidity plays MIDI files by using the patches in timidity.cfg, it 
doesn't need a port. However, if you launch it as an ALSA sequencer 
client (-iA) it will acquire a numbered port and can be used as a 
softsynth. TiMidity has dozens of runtime options, see 'man timidity' 
for the details...

Best regards,

dp





More information about the Linux-audio-user mailing list