sbiload - Rewritten to use hwdep device

Major rewritten to use hwdep device instead of instrument layer.
Also, more options (-c, -2, -q, -D) and better guess work for
patch types now.
This commit is contained in:
Takashi Iwai 2007-10-30 11:53:40 +01:00
parent 31b5ee97f2
commit e978fc745e
3 changed files with 305 additions and 469 deletions

View file

@ -1,4 +1,4 @@
This is sbiload - an OPL2/3 FM instrument loader for ALSA sequencer
This is sbiload - an OPL2/3 FM instrument loader for ALSA hwdep
Written by Uros Bizjak <uros@kss-loka.si>
Web: http://www.kss-loka.si/~uros/sbiload.html
@ -14,63 +14,61 @@ are in make.conf if you need to change anything.
By default it will install into /usr/local/bin, change INSTDIR in
make.conf to change this.
Before use
----------
Please check that the correct sequencer modules are loaded for your
sound card. You need to load snd-synth-opl3 module.
Usage
-----
loadsbi [-p client:port] [-4] [-l] [-P path] [-v level] instfile drumfile
sbiload [options] [instfile [drumfile]]
sbiload [options] -c
-p, --port=client:port - An ALSA client and port number to use
-D, --device=name - An ALSA hwdep name to use
-c, --clear - Clear patches and exit
-2 --opl2 - Two operators (OPL2) file type
-4 --opl3 - Four operators (OPL3) file type
-l, --list - List possible output ports
-P, --path=path - Specify the patch path
-v, --verbose=level - Verbose level
-q, --quiet - Be quiet, no error/warning messages
-V, --version - Show version
Because you may have more than one sound card and each sound
card may have several MIDI connections, you have to tell sbiload
which one to use.
When you have multiple sound cards and/or there may be multiple OPL2/3
synth devices, you have to tell sbiload which one to use, and pass its
hwdep name via -D option. Otherwise, sbiload will load the data onto
the first found device.
First find out what the possibilities are for your system:
To find out the hwdep name of the OPL devices, check
/proc/asound/hwdep file first. It has the list of hwdep devices
currently available on your system.
If you run:
sbiload -l
% cat /proc/asound/hwdep
00-00: Emux WaveTable
00-01: OPL3 FM
01-00: OPL3 FM
it will give you a list of the devices. On my system I get:
Port Client name Port name
64:0 0: MIDI Synth MIDI 0-0
65:0 OPL3 FM Synth OPL3 FM Synth port
In the example above, you have two OPL3 devices. To the first one
(00-01), which means the first card (00-) and the second device (01),
pass "-D hw:0,1". For the second OPL3 device (01-00), pass "-D
hw:1,0" instead.
Only OPLx FM Synth port can be used with sbiload. In the example above
the first one is the external Midi port, and the second is the internal
four-operator FM synthesizer (OPL3).
If you don't see anything listed then check that the correct ALSA
modules are loaded as in the section "Before use".
For convenience, -D option accepts a string like /dev/snd/hwC0D3.
This is automatically parsed as "hw:0,3".
Running sbiload
---------------
You specify the port to use with the -p option, or by setting the
environment variable ALSA_OUT_PORT.
Pass the instrument and drum file data as arguments.
For example to use port 0 on client 65 to load four-operator FM
instrument
sbiload -p 65:0 --opl3 std.o3 drums.o3
% sbiload std.o3 drums.o3
or
export ALSA_OUT_PORT=65:0
sbiload --opl3 std.o3 drums.o3
Without a file type option (-2 or -4), sbiload will guess the file
type according to the hwdep iface type. If it's not correct, pass -2
or -4 option explicitly.
Also, when the given file isn't found, sbiload tries to load a file
with an appropriate extension, .sb for OPL2 and .o3 for OPL3.
You can omit the instrument and the drum file names, too. In this
case, the default file name "std" and "drums" are chosen.
The option -c is to mean just to clear patches and exit without
loading patches.
Acknowledgements
----------------