libADLMIDI is a free Software MIDI synthesizer library with OPL3
emulation.

Some Key features:

OPL3 emulation with four-operator mode support
FM patches from a number of known PC games, copied from files typical
  to AIL = Miles Sound System / DMX / HMI = Human Machine Interfaces /
  Creative IBK.
Stereo sound
Number of simulated OPL3 chips can be specified as 1-100 (maximum
  channels 1800!)
Pan (binary panning, i.e. left/right side on/off)
Pitch-bender with adjustable range
Vibrato that responds to RPN/NRPN parameters
Sustain (a.k.a. Pedal hold) and Sostenuto enable/disable
MIDI and RMI file support
Real-Time MIDI API support
loopStart / loopEnd tag support (Final Fantasy VII)
111-th controller based loop start (RPG-Maker)
Use automatic arpeggio with chords to relieve channel pressure
Support for multiple concurrent MIDI synthesizers (per-track
  device/port select FF 09 message), can be used to overcome 16 channel
  limit
Support for playing Id-software Music File format (IMF)
Support for custom banks of WOPL format
Partial support for GS and XG standards (having more instruments than
  in one 128:128 GM set and ability to use multiple channels for
  percussion purposes, and a support for some GS/XG exclusive
  controllers)
CC74 "Brightness" affects a modulator scale (to simulate frequency
  cut-off on WT synths)
Portamento support (CC5, CC37, and CC65)
SysEx support that supports some generic, GS, and XG features
Full-panning stereo option (works for emulators only)
