# AWEDRV FREQUENTLY ASKED QUESTIONS

FAQ ver.1.24

Takashi Iwai ( iwai@ww.uni-erlangen.de)

Original site: http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/awedrv-faq.html

1. GENERAL NOTES

Q1.1: What is awedrv? What can I do with this?
Q1.2: From where can I download AWE32 sound driver for Linux and FreeBSD?
Q1.3: Does awedrv work on my AWE64 card?
Q1.4: How can I play my midi files using awe driver? What configuration is necessary?
Q1.5: How can I play my .MOD files using awe driver? What configuration is necessary?

2. INSTALLATION

Q2.1*: How to install awedrv on my linux kernel?
Q2.2*: What options should be set to configure sound module for AWE32 on linux?
Q2.3*: The linux sound driver can't detect my SB32-PnP card. Why?
Q2.4*: I installed ISA PnP tools, but still awedrv says "can't detect AWE32".
Q2.5*: Can I load my GM file automatically on the sound driver module?
Q2.6*: I can't install properly on my linux-2.0.0 from Slackware 96.
Q2.7+: How to install awedrv on my FreeBSD kernel?
Q2.8+: How to use my PnP card on FreeBSD system?

3. PLAYING MIDI FILES

Q3.1: I can't hear anything using drvmidi or playmidi. Why?
Q3.2: I have no DRAM in my card - can I still play midi files with it?
Q3.3: How can I play midi files using the default ROM fonts that come with my card?
Q3.4: I have a midi file with a specified SBK file. How can I listen to it?
Q3.5: Drvmidi plays strange sounds when I use an addtional SoundFont file.
Q3.6: I changed chorus and reverb modes using drvmidi, but nothing changed. Why?
Q3.7: Many clicking noises can be heard in some midi files.
Q3.8: Sounds are too loud!
Q3.9: I have GUS patch files. Can I use these samples?
Q3.10: A strange piano sound is heard instead of drum (or other) sounds.
Q3.11: Drum sounds seem smaller than Windows sound.
Q3.12: What is "dynamic loading" of drvmidi? /a>
Q3.13: I want to set up default options.
Q3.14: Can I play a GS midi file for Roland SC88?
Q3.15: Can I play a midi file with Yamaha XG format?
Q3.16: The tone of ver.0.4.3 seems different from others..
Q3.17: What is a virtual bank file?

4. PROGRAMMING & MISCELLANEOUS

Q4.1: The sounds of module player are very weird. Why?
Q4.2*: How can MIDI files be played from Netscape?
Q4.3: I'm planning to write a music player for AWE32. How can I control the AWE32 driver from my program?

The questions with asterisk(*) indicate the Linux specific problems. The questions with plus(+) indicate the FreeBSD specific problems. The minus(-) indicates the obsolete questions spefic for v0.3 or older driver.

## 1. GENERAL NOTES

### Q1.1: What is awedrv? What can I do with this?

Awedrv is the sound driver extension to OSS/Free (aka USS-Lite or VoxWare) for AWE32 and its compatible wave synthesizer cards (SB32 and AWE64 series) by CreativeLabs. This driver provides a basic way to control Emu8000 chip on AWE32 board through `/dev/sequencer` and `/dev/sequencer2` devices as well as other synth drivers like FM-OPL3 and GUS wave drivers. Also from driver v0.3, awedrv behaves as a GUS compatible driver, too. (The module players use this feature.) You can play midi and module files using some sequencer programs listed below.

The current driver is distributed both as a lowlevel driver to OSS/Free with Linux 2.1.x, 2.0.x kernels, and as a patch to OSS/Free-3.0.x (aka VoxWare) with Linux 1.2.x kernels and FreeBSD. Both environments are confirmed to work fine. However a little attention is necessary to use this driver on PnP cards. See Q2.3, Q2.4 and Q2.8 for installation on PnP cards.

The programs supporting awedrv are:

- MIDI Sequencers
  - drvmidi, MIDI player program (`awemidi-0.4.x.tar`)
  - playmidi, supported officially from v2.4
  - Jazz works without any patch (but not perfectly yet)
  - Rosegarden works using MIDI emulation device on awedrv-v0.4.3.
- Games
  - DOOM musserver with a patch file (`musserver+awe0.4.diff`)
- Module Players
  - xmp, officially supporting the AWE driver.
  - gmod, module player (supporting AWEDRV officially from v3.1)
- Others
  - Netscape 3.0 MIDI Plug-in
  - vkbd, a virtual keyboard on X
  - super groove, a unique sequencer program
  - AWEWavePlayer, playing wave samples through Emu8000
  - SFVbm, the soundfont and virtual bank manager

### Q1.2: From where can I download AWE32 sound driver for Linux and FreeBSD?

You can download from my web page:

http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/index.html

Also the following mirroring sites are available:

- UK - Linux Sources - ( http://www.lpsg.demon.co.uk/awe32.html)
- Brasil - Mirror of this page - ( http://www.brasil.enemy.org/~claudio/awedrv)
- Free BSD port - ( http://multiverse.com/~rhh/awedrv/)

### Q1.3: Does awedrv work on my AWE64 card?

Yes. It works as a AWE32 compatible driver, but the software synthesizer is not supported. So only 32 voices (30 voices when DRAM is on board) are available.

### Q1.4: How can I play my midi files using awe driver? What configuration is necessary?

To play a sound using awedrv, you need awesfx utility to load samples on the driver, and midi player programs which support awedrv. Basically, awedrv doesn't have any sound information in it at beginning. So, users must prepare their own SoundFont files using sfxload program (included in awesfx utils). This procedure is necessary even for ROM sounds (see Q3.3). Awesfx utility can be downloaded also from the web site above (Q1.2).

To load the SoundFont file onto the AWE driver, use sfxload utility. For example, to load your GM SoundFont file `synthgm.sbk`,

    	% sfxload synthgm

Note: when you're using the older version of driver and utilities than ver.0.4, the additional option '`-i`' is required. This option means to remove all samples on the driver before loading this sample.

Now you can hear your midi files by a midi player like drvmidi (distributed in awemidi package).

    	% drvmidi sample.mid

See Q3.4 to how to use specified SBK or SF2 files with a midi file.

The new drvmidi (v0.4.0) has a function of "dynamic loaindg" of samples on demand. This enables to play most of MIDI files with 2MB GM/GS soundfonts on only 512kB DRAM soundcards.

    	% drvmidi -L 2mbgmgs sample.mid

See Q3.12 and Q3.13 for details.

### Q1.5: How can I play my .MOD files using awe driver? What configuration is necessary?

So far, some module players are available (see Q1.1). Both xmp and gmod support awedrv as default. See the installation instruction for more details.

Note: both programs watches read selection of the sequencer device. To support this, you need to activate MIDI input interface on SB16 driver when configuring the sound module.

## 2. INSTLLATION

### Q2.1*: How to install awedrv on my linux kernel?

See `INSTALL.awe` file in awedrv source package for details. Basically, you only need to run `install.sh` script on the awedrv source directory as root user.

    	% su
    	# sh ./install.sh

Then, reconfigure the kernel options. See Q2.2 about which options to be set.

    	# cd /usr/src/linux
    	# make xconfig
    		or
    	# make menuconfig

Now, remake and install the kernel and modules.

    	# make
    	# make modules; make modules_install

### Q2.2*: What options should be set to configure sound module for AWE32 on linux?

Basically, to configure awedrv, say Yes only to "lowlevel sound driver support" and "AWE32 wave synth". (If you're using OSS/Free-3.0.x (aka VoxWare), only the latter question will appear.) On AWE32 board, all transfers are done through I/O ports (not DMA), and awedrv probes these I/O ports automatically, so no need to specify any address or IRQ at configuration.

Of course, you may want other functions of SoundBlaster like playing and recording digital sound, FM synthesizer, and mixer support. Awedrv is only an enhancement to control Emu8000 synthesizer, and such functions are supported by other SB drivers. So better to keep Yes for all other SB16 options as well.

In my case, the sound part of `.config` file looks like:

    #
    # Sound
    #
    CONFIG_SOUND=m
    # CONFIG_PAS is not set
    CONFIG_SB=y
    CONFIG_ADLIB=y
    # CONFIG_GUS is not set
    # CONFIG_MPU401 is not set
    # CONFIG_UART6850 is not set
    # CONFIG_PSS is not set
    # CONFIG_GUS16 is not set
    # CONFIG_GUSMAX is not set
    # CONFIG_MSS is not set
    # CONFIG_SSCAPE is not set
    # CONFIG_TRIX is not set
    # CONFIG_MAD16 is not set
    # CONFIG_CS4232 is not set
    # CONFIG_MAUI is not set
    CONFIG_AUDIO=y
    CONFIG_MIDI=y
    CONFIG_YM3812=y
    SBC_BASE=220
    SBC_IRQ=7
    SBC_DMA=1
    SB_DMA2=7
    SB_MPU_BASE=300
    SB_MPU_IRQ=-1
    DSP_BUFFSIZE=65536
    CONFIG_LOWLEVEL_SOUND=y
    # CONFIG_ACI_MIXER is not set
    CONFIG_AWE32_SYNTH=y

BTW, please do not copy these values directly to your kernel. IRQ and DMA numbers of SB card may be different on each machine. In usual cases, MPU base address may be 0x330. I set this value as different one to avoid confliction between SCSI card. (The setting in Q2.3 is 0x330 because this is Neal's machine.)

### Q2.3*: The linux sound driver can't detect my SB32-PnP card. Why?

This is a problem in PnP initialization. Because the original Linux kernels don't support initialization of PnP cards yet, some special treatment is necessary before loading sound driver. There're a couple of ways to solve this:

1. use Linux PnP driver
2. use PnP utilities like ISA PnP Tools.
3. initialize PnP card on DOS and use `loadlin` to boot linux.

The Linux PnP driver enables to configure the PnP devices from kernel. This driver has been originally developed by Tom Lees. The current awedrv (0.4.3) includes the PnP driver interface so that no patch is necessary. See the PnP driver project homepage for more details,

http://www-jcr.lmh.ox.ac.uk/~pnp/

Neal Sanche (neal@nsdev.ocunix.on.ca) summarizes the procedure to install on PnP card by ISAPnP tool that:

#### Setting up SoundBlaster 32 PnP under Linux

The SoundBlaster 32 PnP, like all plug and play devices, requires initialization before the Linux device driver is loaded in order to function properly. This means that some form of initialization is required to hear sound. Currently many PnP projects (one at http://www.redhat.com/linux-info/pnp) are being developed. I use a simple tool called ISAPnP. It is available at:
http://www.redhat.com/linux-info/pnp/other.html

The steps you need to do in order to get sound working:

1. Compile your Linux kernel with module support, and compile the sound driver as a module. This is important because you must load the module after initializing your PnP card under Linux.
2. Somewhere in your startup scripts (in `rc.local`, or `rc.modules` in a recent version of RedHat) you must initialize your sound card with some tool. ISAPnP is easy to configure and seems very reliable.
3. Load the sound module. Set your mixer settings.

For example, this is how I initialize the SB32 PnP in my startup scripts.

    #!/bin/sh

    # initialize PnP devices
    if [ -x /sbin/isapnp ]; then
      echo "Configuring PnP devices"
      /sbin/isapnp /etc/isapnp.conf
    fi

    echo "Loading sound module"
    /sbin/modprobe -a sound

ISAPnP is quite an easy program to configure. Here is a copy of my `isapnp.conf` file. I used all of the defaults (from the SB manual) for ports and IRQ settings.
DON'T FORGET TO ADD TWO I/O PORTS, 0xA20 and 0xe20, for WaveTable! These ports are never detected by pnpdump, but must be initialized. (See Q2.4)

    (READPORT 0x0273)
    (ISOLATE)
    (IDENTIFY *)

    # Card 1: (serial identifier 6d 00 0e b0 52 44 00 8c 0e)
    # CTL0044 Serial No 962642 [checksum 6d]
    # Version 1.0, Vendor version 1.0
    # ANSI string -->Creative SB32 PnP<--
    #
    # Logical device id CTL0031
    #
    # Edit the entries below to uncomment out the configuration required.
    # Note that only the first value of any range is given, this may be changed if required
    # Don't forget to uncomment the activate (ACT Y) when happy

    (CONFIGURE CTL0044/962642 (LD 0
    # ANSI string -->Audio<--
      (INT 0 (IRQ 5 (MODE +E)))
      (DMA 0 (CHANNEL 1))
      (DMA 1 (CHANNEL 5))
      (IO 0 (BASE 0x0220))
      (IO 1 (BASE 0x0330))
      (IO 2 (BASE 0x0388))

      (ACT Y)
    ))

    # Logical device id CTL0021
    #
    # Edit the entries below to uncomment out the configuration required.
    # Note that only the first value of any range is given, this may be changed if required
    # Don't forget to uncomment the activate (ACT Y) when happy

    (CONFIGURE CTL0044/962642 (LD 2
    # ANSI string -->WaveTable<--
      (IO 0 (BASE 0x0620))
      (IO 1 (BASE 0x0a20))
      (IO 2 (BASE 0x0e20))
      (ACT Y)
    ))

    # Logical device id CTL7001
    #
    # Edit the entries below to uncomment out the configuration required.
    # Note that only the first value of any range is given, this may be changed if required
    # Don't forget to uncomment the activate (ACT Y) when happy

    (CONFIGURE CTL0044/962642 (LD 3
    #     Compatible device id PNPb02f
    #     ANSI string -->Game<--
    #     Logical device decodes 16 bit IO address lines
    #         Minimum IO base address 0x0200
    #         Maximum IO base address 0x0200
    #         IO base alignment 1 bytes
    #         Number of IO addresses required: 8
    # (IO 0 (BASE 0x0200))
    # (ACT Y)
    ))

    # Logical device id CTL0051
    #
    # Edit the entries below to uncomment out the configuration required.
    # Note that only the first value of any range is given, this may be changed if required
    # Don't forget to uncomment the activate (ACT Y) when happy

    (CONFIGURE CTL0044/962642 (LD 4
    #     ANSI string -->StereoEnhance<--
    #     Logical device decodes 16 bit IO address lines
    #         Minimum IO base address 0x0100
    #         Maximum IO base address 0x03f8
    #         IO base alignment 8 bytes
    #         Number of IO addresses required: 1
      (IO 0 (BASE 0x0108))
    (ACT Y)))

That's all there is to it. In the future, the Linux kernel source will directory support Plug and Play, and there will be no need for the isapnp tool.

### Q2.4*: I installed ISA PnP tools, but still awedrv says "can't detect AWE32".

Check WaveTable entries in your `/etc/isapnp.conf` file. AWE32 uses three I/O ports, normally 0x620, 0xa20, and 0xe20, but in the default ouput from `pnpdump` is lack of the last two pots (0xa20 and 0xe20). In such a case, you have to add them manually. For example,

    # Logical device id CTL0021
    (CONFIGURE CTL0044/962642 (LD 2
    # ANSI string -->WaveTable<--
      (IO 0 (BASE 0x0620))
      (IO 1 (BASE 0x0A20))
      (IO 2 (BASE 0x0E20))
      (ACT Y)
    ))

See the ISA PnP FAQ page ( http://www.roestock.demon.co.uk/isapnptools/isapnpfaq.html ) for details.

### Q2.5*: Can I load my GM file automatically on the sound driver module?

Yes. You can specify the command to be executed after loading modules in your `/etc/conf.modules` file with `post-install` command. For example,

    post-install sound	/usr/local/bin/sfxload synthgm

Similary, it's possible to set the mixer volume automatically,

    post-install sound	/usr/local/bin/setmix -f /etc/mixrc;\
    			/usr/local/bin/sfxload synthgm

### Q2.6*: I can't install properly on my linux-2.0.0 from Slackware 96.

Slackware 96 initially installs Linux-2.0.0 system. The AWE driver doesn't support this version of sound driver. So please update the kernel version to the newer one. Sorry for incovenience...

### Q2.7+: How to install awedrv on my FreeBSD kernel?

See the document `INSTALL.frbsd` in awedrv source package for details. Also, if you're using a PnP sound card like SB32 PnP or AWE64, refer to Q2.8.

1. Copy all source files to the system directory `/usr/src/sys/i386/isa/sound`.
2. Edit `awe_config.h` if necessary.
   If you're using awedrv ver.0.4 or newer, you don't need to touch `AWE_MAX_SAMPLES` and `AWE_MAX_INFOS`.
3. Append an entry to kernel configuration file.

                 device awe0     at isa? port 0x620

4. Recompile and install a new kernel.

### Q2.8+: How to use my PnP card on FreeBSD system?

See the how-to document by Takuya Koumoto (takuya-k@is.aist-nara.ac.jp) for more details (written in Japanese).

1. Get FreeBSD PnP package (`FreeBSD-ISA_PnP_June8.tar.gz`)
2. Run a program `pnpinfo` in it. You may have an output like following:

       	Checking for Plug-n-Play devices...
       	Trying Read_Port at 203
       	Trying Read_Port at 243
       	.. (snip) ..
       	Card assigned CSN #1
       	Board Vendor ID: CTL009d
       	Board Serial Number: 10005fdc
       	PnP Version: 1.0
       	Vendor Version: 32
       	Device Description: Creative SB AWE64 PnP
       	Logical Device ID: CTL0042 (42008c0e)
       	Device Description: Audio
       	Start Dependent Function
       	.. (snip) ..

   Remember the serial number of your sound card in the message. In this example, it's `10005fdc`. This value must be different on each sound card.
3. Applay a patch (`kernel.patch.2.2-current`) included in the package to kernel source tree.

       	# cd /usr/src/sys
       	# patch -p0 < kernel.patch.2.2-current

4. Edit `/usr/src/sys/i386/isa/pnp.c`:
   Replace the line 34

       	#include "pnp.h"

   with

       	#include "i386/isa/pnp.h"

   and the part from line 50 to 103 with the following

         {
           0x10005fdc,             /* Serial Number */
           2,             /* Logical Device Number */
           {
             { -1, -1 },     /* Primary IRQ Number, Type */
             { -1, -1 }      /* Second  IRQ Number, Type */
           },
           { -1, -1 },               /* DRQ Number */
           {
             0x620,          /* Ports 1 */
             0xa20,          /* Ports 2 */
             0xe20,          /* Ports 3 */
             -1,          /* Ports 4 */
             -1,          /* Ports 5 */
             -1,          /* Ports 6 */
             -1,          /* Ports 7 */
             -1,          /* Ports 8 */
           },
           {
             { -1, -1, -1 }, /* Memory desc0 - base, ctrl, range */
             { -1, -1, -1 }, /* Memory desc1 - base, ctrl, range */
             { -1, -1, -1 }, /* Memory desc2 - base, ctrl, range */
             { -1, -1, -1 }  /* Memory desc3 - base, ctrl, range */
           }
         }

   Please put the serial number of your card on the first item.
5. Copy source files of awedrv. Do it as well as in Q2.7.
6. Edit kernel config file. Append both

       	controller      pnp0

   and

       	device awe0     at isa? port 0x620 conflicts

## 3. PLAYING MIDI FILES

### Q3.1: I can't hear anything using drvmidi or playmidi. Why?

The AWE driver itself doesn't have any sound information in it. You need to load the soundfont file at first. See Q1.4 how to load soundfont files.

### Q3.2: I have no DRAM in my card - can I still play midi files with it?

Chris Wedgwood <chris@cyphercom.com> answers:

Yes. You can use the default ROM fonts that are built into the card. However, it won't necessarily sound very good.

### Q3.3: How can I play midi files using the default ROM fonts that come with my card?

Chris Wedgwood <chris@cyphercom.com> answers:

You have to load the ROM fonts into the card using sfxload. To do this you need a file called '`synthgm.sbk`' (or `synthgm.sf2`) which is installed under Windows95 and presumably Windows 3.1.

There always seems to be a copy in the 'windows system' directory, and often another copy amongst the other installed Creative Labs files. The windows system directory is usually `\WINDOWS\SYSTEM`.

For the 'purists' who don't have Windows installed - you will probably have to try and get this file from elsewhere, as it is not stored on the CDROM in any useful form. (At least not on mine). It appears to be archive in the `win95/sfbank/sfbank.lib` file - but I have no details on the format of this).

To load the ROM fonts type:

    	% sfxload synthgm.sbk

Note: you will have to prepend a path if `synthgm.sbk` is not in the current working directory or search path directories. If drum sounds are small, you can tune it via `-A` option (see Q3.11).

The size of the file is about 35k, it compresses down to about 14k, so obtaining it via FTP or email shouldn't be a big problem - although there maybe copyright issues involved. I wouldn't know, I'm not a lawyer.

### Q3.4: I have a midi file with a specified SBK file. How can I listen to it?

Just load the SBK file after GM (or GS) presets. At first, load GM font. (For the older version (v0.3.x), the option `-i` is necessary.)

    	% sfxload synthgm

Then, append SBK font after it. If you've already loaded other samples, the additional option `-x` is required.

    	% sfxload -b 1 foo.sbk

Don't forget to add a command option "-b 1" in this case (see Q3.5).

Now you can hear your midi file. Enjoy.

    	% drvmidi foo.mid

### Q3.5: Drvmidi plays strange sounds when I use an addtional SoundFont file.

Most of user-defined SoundFont files are designed to be loaded on bank 1. Try the option `-b 1` of `sfxload` for such a sample (see Q3.4).

### Q3.6: I changed chorus and reverb modes using drvmidi, but nothing changed. Why?

To activate chorus and reverb modes, you have to specify non-zero values for these effects at loading samples via `-c` and `-r` options of `sfxload`, respectively.

    	% sfxload -c 30 -r 20 synthgm

### Q3.7: Many clicking noises can be heard in some midi files.

If this happens when panning status changes, it is due to the restriction of Emu8000 chip. Try `-P` option with drvmidi. This option suppress the realtime pan position change. Otherwise, it may be a bug.

### Q3.8: Sounds are too loud!

I think so, too... The total volume of the samples can be changed by using `-V` option at loading.

    	% sfxload -V 40 synthgm

The value is in percent with a default of 70%.

If you're using linux, the mixer volumes can be set at loading the module automatically (see Q2.5).

### Q3.9: I have GUS patch files. Can I use these samples?

Yes. For example, to load a patch `gunshot.pat` onto preset #127, run

    	% gusload -p 127 gunshot.pat

### Q3.10: A strange piano sound is heard instead of drum (or other) sounds.

Some MIDI files use the channel 16 as a drum channel. while only the channel 10 is accepted as a drum in drvmidi as default. (In the case of GS file, it may vary according to system exclusive messages.) To change the drum state, use the option `-D`. The positive argument means to turn on the drum channel, but the negative argument means to turn off. For example, '`-D 16`' option specifies the channel 16 as a drum channel, and '`-D -10`' option reserves the channel 10 as a normal channel.

Another possibility is the problem of multi-part support. Drvmidi treats tracks over 16 as second MIDI part. This feature is suppressed using '`-T -1`' option with drvmidi. Then all tracks are assumed as one MIDI part.

### Q3.11: Drum sounds seem smaller than Windows sound.

If you're using v0.4.2 driver and sfxload, try `-A` option of sfxload program. This is an option to control the sensitivity of attenuation level of each instrument, and it takes a positive (float) digit value. Generally, the smaller value makes drum sounds louder. I feel the value 2.0 is better than the default state, but to keep compatibility with older versions, it's set to 10.0 as default.

    	% sfxload -A 2 synthgm.sbk

The v0.4.3 driver (and sfxload) uses different way of parameter calculation. It sounds more similar to DOS/Windows, but a little bit duller than the former version. The volume calculation method can be switched by `aweset` utility.

    	% aweset newvolume off

Note that drvmidi will change this switch by itself, so aweset doesn't affect its sounds at all. The sound quality via playmidi will be influenced, though. Also, there is a command option `-C` in sfxload to keep the compatibility with the older versions.

### Q3.12: What is "dynamic loading" of drvmidi?

This is a new feature added from ver.0.4.0 to load the required fonts in a soundfont file "on demand" for each MIDI file. drvmidi looks up each instrument used in the file before playing, then it invokes sfxload to load only the required samples. This function enables us to to play with larger samples on samller soundcard RAM size. In most cases, you can play MIDI files via 2MB GM/GS soundfonts (`2mbgmgs.sf2`) on 512kB DRAM. Of course, it's possible to play 8MB fonts on 2MB DRAM, or 12MB fonts on 8MB DRAM (though it'll take a bit long time to load the fonts). Many soundfont files are distributed on web sites. I listed them up on the AWE driver's web page,

http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/index.html#SoundFonts
The 2MB font above is stored on Creative's web site, and on the AWE Hot Spot, too. Also, there're 2MB and 4MB fonts are included in AWE64 distribution. AWE64 users can try it.

To use dynamic loading, the following precodure is necessary.

1. Load ROM fonts previously. (DONT'T FORGET THIS!)

       	% sfxload synthgm

2. Specify the soundfont file to be used via `-L` (or `--dynamic`) option in the command line of drvmidi.

       	% drvmidi -L 2mbgmgs foo.mid

Sometimes, drvmidi fails to load all samples due to out of memeory. In such a case, the following message will appear:

    	preload: couldn't load all fonts.

drvmidi uses ROM fonts instead of the samples which are not loaded successfully.

The dynamic loading fonts can be specified in the default setting file. See Q3.13.

### Q3.13: I want to set up default options.

The command line options of sfxload and drvmidi can be specified in the resource files in advance. The resource file of sfxload are `/etc/sfxloadrc` and `~/.sfxloadrc`, and those of drvmidi are `/etc/drvmidirc` and `~/.drvmidirc`, repsectively. If both files are specified, the latter one is used.

The sfxload resource file has the following format:

    	fontname	options..
    	fontname	options..

The first argument is the soundfont name, and the remaining arguments are command line options to be specified. The font name "`default`" is special, and means that the default options to be used if any font name doesn't match the given soundfont. Both short and long options are available. For example:

    	default	--sense=10 --atten=32 -V100
    	synthgm	--sense=2 -V100

The format of drvmidi resource file is similar to the above. However, the valid font name is only "`default`". Though drvmidi accepts both short and long options, the option editor in tkmidi (featured from v0.4.2) can only handle long options. For example:

    	default --dynamic=2mbgmgs

With this function, you can use dynamic loading without specifying command line options at each time.

### Q3.14: Can I play a GS midi file for Roland SC88?

The new drvmidi ver.0.4.2 can emulate the SC88 specific controls; a couple of sysex controls including multi part, and some controls like TVF and EG. As default, the sysex messages of multi-part mode and master volume control are supported. Regardless of received sysex status, you can turn on the multi part mode by specifying the option `--multipart=on`.

The effect controls to TVF, EG, etc. are not emulated as default status. You need to add an option `--usefx=on` to drvmidi. Note that this function is still experimental and inaccurate. The sound effect varies with the soundfont file, so you should adjust parameters for your using font file.

Also, You can edit the options and effect parameters above via the option editor in tkmidi.

### Q3.15: Can I play a midi file with Yamaha XG format?

The new drvmidi (v0.4.2) accepts the bank control defined in XG format. However, since the drum and sfx presets in XG format are partly different from one in GS, some preset remapping is required to play back properly with the usual GS soundfont file. Drvmidi avoids this problem by assigning the XG drum and sfx presets to the banks which are not used in GS. To enable this feature, add the option `--xgmap=on`.

To play back this new bank, the driver needs to duplicate the sounds from original GS banks. This can be solved easily using the preset mapping, which is newly supported in awedrv-0.4.2. For example, if you're using synthgs.sbk, load two bank files after it. (These bank files are included in the awesfx / sfxload package.)

    	% sfxload synthgs
    	% sfxload -b0 xgsfx.bnk
    	% sfxload -b0 xgdrum.bnk

Then, the XG banks are mapped from the original GS fonts without using any extra DRAM.

The procedure above becomes easy by writing a virtual bank file. For example, using the bank file (xgdefault.bnk) contains the following,

    	default synthgs.sbk
    	include xgsfx.bnk
    	include xgdrum.bnk

just load this bank file once, and all things above will be done.

    	% sfxload xgdefault.bnk

Also, you need to make the similar bank file to use the dynamic loading function in drvmidi:

    	default 2mbgmgs.sf2
    	include xgsfx.bnk
    	include xgdrum.bnk

By specifying this bank file in the option `--dynamic`, drvmidi loads the appropriate fonts automatically even both for GS and XG format.

### Q3.16: The tone of ver.0.4.3 seems different from others..

Yes, the latest version 0.4.3 uses the different volume parameter calculation. Please refer to Q3.11.

### Q3.17: What is a virtual bank file?

The virtual bank file is a text file describing the list of presets, banks and notes from multiple soundfont files. By using a virtual bank file, you can load a part of sounds from one soundfont file and another part from other soundfont files without re-creating a whole soundfont file. On the other words, it enables to replace or add one instrument with other sounds (even one note in drumset!).

The format of virtual bank file is as follows:

    source:destination:file instr-name

The source and destination are the instrument map to specify the instruments to be replaced, and have the following format:

    preset/bank/keynote

The preset is the MIDI program number (from 0 to 127), and the bank is the MIDI bank number (from 0 to 128). The bank #128 is regarded as a drumset. The keynote is the MIDI key note number (from 0 to 127). If keynote is omitted, the whole instrument will be replaced. If bank is omitted, all matching instruments with preset will be replaced. If preset has an asterisk(*) or number -1, the matching bank will be replaced.

The virtual bank will replace the instruments specified by source field with the instruments by destination field. The file field is a soundfont file name to be loaded. Note that if you use the identical soundfont file several times in one virtual bank file, you must give also the identical name here. The files are searched through the path given to sfxload.

The instr-name field is an optional field to specify the name of this instrument. In the current version of sfxload, this field is ignored.

The virtual bank file accepts also the following format:

    source:destination instr-name

Unlike the previous case, this format includes no file field. This enables the preset mapping (linking) and works like a symbolic link of file operation. The source instrument is referred also as the destination instrument. The actual destination instrument needs not exist.

There are two special command directives:

- `include filename`
  This command simply includes the specified file in the current virtual bank file.
- `default filename`
  This command specifies the default soundfont file. The default soundfont is referred when no matching instruments are found in other virtual bank definitions.

## 4. PROGRAMMING & MISCELLANEOUS

### Q4.1: The sounds of module player are very weird. Why?

This happens when not enough DRAM is on the AWE32 card. Please upgrade memories on your card.

Also, the old drivers have a bug in sample loop addresses. Please use the latest driver (v0.3.3e or later).

### Q4.2*: How can MIDI files be played from Netscape?

If you're using..

Netscape 3.0
  The plug-in for Netscape 3.0 is now available. Please install MIDI plug-in package, and check the helper list in Options menu. See the document in this package for more details.

  The plug-in with MIDI control panel causes a bus error when displaying the directory page (i.e. file://directory/). To avoid this, you need to preload the plug-in file before starting Netscape. It would be convenient to replace netscape as a wrapper script like

      #!/bin/sh
      LD_PRELOAD=$HOME/.netscape/plugins/npmidi.so; export LD_PRELOAD
      exec /usr/local/bin/netscape

  This bug doesn't appear on the plug-in without control panel window.

  Also, if you already add mime types as below, you should edit these configuration files manually. Netscape only appends its list.

Other browsers
  Add a new mime type for MIDI files by adding the following to your `~/.mime.types` file:

      audio/x-midi	exts=mid,midi

  Then specify the application for this type by adding to `~/.mailcap`:

      audio/x-midi; drvmidi %s

  Of course, you can choose your favorite MIDI players instead of this.

### Q4.3: I'm planning to write a music player for AWE32. How can I control the AWE32 driver from my program?

See the AWEDRV programming notes for control of awedrv device.

From ver.0.2, awedrv accepts the GUS compatible patches and hardware controls, so you can play module players using GUS driver like gmod by a slight modification.

For example, to use gmod for awedrv, just change the line 62 of `Sequencer.c` for detection of synthesizer card to accept subtype 0x20 like

    if (info.synth_type == SYNTH_TYPE_SAMPLE
        && (info.synth_subtype == SAMPLE_TYPE_GUS||info.synth_subtype==0x20))
        gus_dev = i;

(`0x20` means `SAMPLE_TYPE_AWE32` defined in `awe_voice.h`.)