~ubuntu-branches/ubuntu/wily/pmidi/wily

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
This is pmidi - a command line midi player for ALSA

Written by Steve Ratcliffe <steve@parabola.demon.co.uk>
Web: http://www.parabola.demon.co.uk/alsa/pmidi.html
Web: http://sourceforge.net/projects/pmidi

See the file COPYING for licence details (GPL).

Build and install
-----------------

See the INSTALL file for full details.  Normally you just need to use the
following commands:

	./configure
	make
	make install

To compile from CVS use the following commands first to create the
configure script:

	aclocal
	autoconf -a
	automake


Before use
----------

1.   First check that the correct sequencer modules are
	 loaded for your sound card:

	 - For a card with an external Midi connection,
	   you need to load snd-seq-midi.
	 - For the OPL2/3 internal synthesizer
	   you need to load snd-synth-opl3.
	 - For the AWE32/64 internal synthesizer
	   you need to load snd-synth-emu8000. 
	 - For the SB Live! internal synthesizer
	   you need to load snd-synth-emu10k1.
	 - (Let me know of any more)

2.a  If you have an AWE32/64 or SB Live! you will need to load the
	 sounds with sfxload in the same way as for the standard kernel
	 drivers. 
2.b  If you have the OPL3 FM synthesizer you will have to load the
	 FM instruments with sbiload.  See note below.

3.   Make sure that the synth in the mixer is turned
	 up and unmuted if appropriate. 


Usage
-----

	pmidi [-p client:port ...] [-l] [-d delay] file ...

	  -p client:port  - A alsa client and port number to send midi to
	  -l              - List possible output ports that could be used
	  -d delay        - Delay after song ends (default 2 sec)


Because you may have more than one sound card and each sound
card may have several MIDI connections, you have to tell pmidi
which one to use.

First find out what the possibilities are for your system:

If you run: 
	
	pmidi -l 

it will give you a list of the possible devices that it
can play to. On my system I get: 
	
	 Port     Client name                       Port name 
	 64:0     0: MIDI Synth                     MIDI 0-0 
	 65:0     AWE Wave Table Synth : 0          Emu8000 port 0 
	 65:1     AWE Wave Table Synth : 0          Emu8000 port 1 
	 65:2     AWE Wave Table Synth : 0          Emu8000 port 2 
	 65:3     AWE Wave Table Synth : 0          Emu8000 port 3 

Any of the port numbers in the first column can be used with pmidi. In
the example above the first one is the external Midi port, and the other
four are the internal wavetable synthesizer.

If you don't see anything listed then check that the correct ALSA modules
are loaded as in the section "Before use".

Running pmidi
-------------

You specify the port or ports to use with the -p option,
or by setting the environment variable ALSA_OUTPUT_PORTS. 

For example to use port 0 on client 65: 
	
	pmidi -p 65:0 song.mid 

or 
	
	export ALSA_OUTPUT_PORTS=65:0 
	pmidi song.mid 


A list of client ports can be supplied, which will be used
if the midi file contains port select sequences. 
	
	pmidi -p 65:0,65:1,65:2,65:3 song.mid 

You can also use spaces to separate with suitable quoting
on the command line. 

OPL3 FM synthesizer
-------------------

(This note was provided by Dmitrii Sadovskii)

This is what has to be done to use the OPL3 FM synthesizer with pmidi
(provided that the ALSA's respective card module is already loaded)

# modprobe -k snd-synth-opl3

> sbiload -l (same as pmidi -l)
 Port     Client name                       Port name
 64:0     External MIDI 0                   MIDI 0-0
 65:0     OPL3 FM synth                     OPL3 Port
> sbiload -p65:0 --opl3 std.o3 drums.o3
> pmidi -p65:0 sample.midi

sbiload:
	alsa-tools/seq/sbiload/
	Written by Uros Bizjak <uros@kss-loka.si>
	Web: http://www.kss-loka.si/~uros/sbiload.html
	sbiload works with ALSA driver 0.9.0beta2 and later.
	Use it with native ALSA sequencers, such as pmidi-1.5.1
	or later.

Laptops:
	the sound card (or the driver?) does not keep the instrument
	patches after suspend so sbiload should be called at resume
	(as well as alsactl restore)

It should be said that ALSA+pmidi plays with better quality than OSS/Free
but that in general FM synthesizers are not great for good midi.


Where to report bugs and feedback
---------------------------------

Please report any problems to steve@parabola.demon.co.uk