| 1 |
|
| 2 |
This is pmidi - a command line midi player for ALSA |
| 3 |
|
| 4 |
Written by Steve Ratcliffe <[email protected]> |
| 5 |
Web: http://www.parabola.me.uk/alsa/pmidi.html |
| 6 |
Web: http://sourceforge.net/projects/pmidi |
| 7 |
|
| 8 |
See the file COPYING for licence details (GPL). |
| 9 |
|
| 10 |
Build and install |
| 11 |
----------------- |
| 12 |
|
| 13 |
See the INSTALL file for full details. Normally you just need to use the |
| 14 |
following commands: |
| 15 |
|
| 16 |
./configure |
| 17 |
make |
| 18 |
make install |
| 19 |
|
| 20 |
To compile from a Mercurial checkout, first use the following commands |
| 21 |
first to create the configure script: |
| 22 |
|
| 23 |
aclocal |
| 24 |
autoconf -a |
| 25 |
automake |
| 26 |
|
| 27 |
or if you have autoreconf: |
| 28 |
autoreconf -i |
| 29 |
|
| 30 |
|
| 31 |
Before use |
| 32 |
---------- |
| 33 |
|
| 34 |
1. First check that the correct sequencer modules are |
| 35 |
loaded for your sound card: |
| 36 |
|
| 37 |
- For a card with an external Midi connection, |
| 38 |
you need to load snd-seq-midi. |
| 39 |
- For the OPL2/3 internal synthesiser |
| 40 |
you need to load snd-synth-opl3. |
| 41 |
- For the AWE32/64 internal synthesiser |
| 42 |
you need to load snd-synth-emu8000. |
| 43 |
- For the SB Live! internal synthesiser |
| 44 |
you need to load snd-synth-emu10k1. |
| 45 |
- (Let me know of any more) |
| 46 |
|
| 47 |
2.a If you have an AWE32/64 or SB Live! you will need to load the |
| 48 |
sounds with sfxload in the same way as for the standard kernel |
| 49 |
drivers. |
| 50 |
2.b If you have the OPL3 FM synthesiser you will have to load the |
| 51 |
FM instruments with sbiload. See note below. |
| 52 |
|
| 53 |
3. Make sure that the synth in the mixer is turned |
| 54 |
up and unmuted if appropriate. |
| 55 |
|
| 56 |
|
| 57 |
Usage |
| 58 |
----- |
| 59 |
|
| 60 |
pmidi [-p client:port ...] [-l] [-d delay] file ... |
| 61 |
|
| 62 |
-p client:port - A alsa client and port number to send midi to |
| 63 |
-l - List possible output ports that could be used |
| 64 |
-d delay - Delay after song ends (default 2 sec) |
| 65 |
|
| 66 |
|
| 67 |
Because you may have more than one sound card and each sound |
| 68 |
card may have several MIDI connections, you have to tell pmidi |
| 69 |
which one to use. |
| 70 |
|
| 71 |
First find out what the possibilities are for your system: |
| 72 |
|
| 73 |
If you run: |
| 74 |
|
| 75 |
pmidi -l |
| 76 |
|
| 77 |
it will give you a list of the possible devices that it |
| 78 |
can play to. On my system I get: |
| 79 |
|
| 80 |
Port Client name Port name |
| 81 |
64:0 Rawmidi 0 - EMU10K1 MPU-401 (U EMU10K1 MPU-401 (UART) |
| 82 |
65:0 Emu10k1 WaveTable Emu10k1 Port 0 |
| 83 |
65:1 Emu10k1 WaveTable Emu10k1 Port 1 |
| 84 |
65:2 Emu10k1 WaveTable Emu10k1 Port 2 |
| 85 |
65:3 Emu10k1 WaveTable Emu10k1 Port 3 |
| 86 |
128:0 FLUID Synth (28152) Synth input port (28152) |
| 87 |
129:0 Client-129 TiMidity port 0 |
| 88 |
129:1 Client-129 TiMidity port 1 |
| 89 |
|
| 90 |
Any of the port numbers in the first column can be used with pmidi. In |
| 91 |
the example above the first one is the external Midi port, and the next |
| 92 |
four are the internal wave table synthesiser on the SoundBlaster Live! |
| 93 |
|
| 94 |
If you don't see anything listed then check that the correct ALSA modules |
| 95 |
are loaded as in the section "Before use". |
| 96 |
|
| 97 |
Running pmidi |
| 98 |
------------- |
| 99 |
|
| 100 |
You specify the port or ports to use with the -p option, |
| 101 |
or by setting the environment variable ALSA_OUTPUT_PORTS. |
| 102 |
|
| 103 |
For example to use port 0 on client 65: |
| 104 |
|
| 105 |
pmidi -p 65:0 song.mid |
| 106 |
|
| 107 |
or |
| 108 |
|
| 109 |
export ALSA_OUTPUT_PORTS=65:0 |
| 110 |
pmidi song.mid |
| 111 |
|
| 112 |
|
| 113 |
A list of client ports can be supplied, which will be used |
| 114 |
if the midi file contains port select sequences. |
| 115 |
|
| 116 |
pmidi -p 65:0,65:1,65:2,65:3 song.mid |
| 117 |
|
| 118 |
You can also use spaces to separate with suitable quoting |
| 119 |
on the command line. |
| 120 |
|
| 121 |
OPL3 FM synthesiser |
| 122 |
------------------- |
| 123 |
|
| 124 |
(This note was provided by Dmitrii Sadovskii) |
| 125 |
|
| 126 |
This is what has to be done to use the OPL3 FM synthesiser with pmidi |
| 127 |
(provided that the ALSA's respective card module is already loaded) |
| 128 |
|
| 129 |
# modprobe -k snd-synth-opl3 |
| 130 |
|
| 131 |
> sbiload -l (same as pmidi -l) |
| 132 |
Port Client name Port name |
| 133 |
64:0 External MIDI 0 MIDI 0-0 |
| 134 |
65:0 OPL3 FM synth OPL3 Port |
| 135 |
> sbiload -p65:0 --opl3 std.o3 drums.o3 |
| 136 |
> pmidi -p65:0 sample.midi |
| 137 |
|
| 138 |
sbiload: |
| 139 |
alsa-tools/seq/sbiload/ |
| 140 |
Written by Uros Bizjak <[email protected]> |
| 141 |
Web: http://www.kss-loka.si/~uros/sbiload.html |
| 142 |
sbiload works with ALSA driver 0.9.0beta2 and later. |
| 143 |
Use it with native ALSA sequencers, such as pmidi-1.5.1 |
| 144 |
or later. |
| 145 |
|
| 146 |
Laptops: |
| 147 |
the sound card (or the driver?) does not keep the instrument |
| 148 |
patches after suspend, so sbiload should be called at resume |
| 149 |
(as well as alsactl restore) |
| 150 |
|
| 151 |
It should be said that ALSA+pmidi plays with better quality than OSS/Free |
| 152 |
but that in general FM synthesisers are not great for good midi. |
| 153 |
|
| 154 |
|
| 155 |
Where to report bugs and feedback |
| 156 |
--------------------------------- |
| 157 |
|
| 158 |
Please report any problems to [email protected] |