libgig  4.4.1
libgig

Intro

libgig is a C++ library for accessing audio-sample based instrument files, as they are shipped for various software samplers, hardware sampler devices and synthesizer keyboards. This C++ library was originally created to access Gigasampler files, but in the meantime grew to much more than that. At the moment libgig consists of the following four major parts:

  • 1. gig classes: These provide convenient access to Gigasampler / GigaStudio files (for all known format version, that is from Gigasampler v1 to GigaStudio v4), allowing to load, modify and save existing .gig files, as well as creating new .gig files from scratch.

    Since the gig file format was originally designed based on the DLS Level 2 format, the gig classes in this library are derived from the DLS classes of this library, where the gig classes provide the necessary extensions for the Gigasampler file format.

    Besides the fact that libgig supports all aspects of the original Gigasampler / GigaStudio format, it now also provides some own extensions of that original format. Most notably libgig provides an extension to save real-time instrument scripts with .gig files. Those custom extensions are however currently only supported by the graphical instrument editor application gigedit and by LinuxSampler, those extensions will obviously not work with the original GigaStudio software.
  • 2. sf2 classes: These provide support for loading and modifying SoundFont version 2 files. Even though being an older format, the SoundFont format is still one of the most popular sample based instrument file formats and is widely supported by a variety of hardware and software.
  • 3. Korg classes: These provide support for loading sample based instrument files of KORG's synthesizer keyboard models Kronos, M3, Oasys, Triton and Trinity. There is currently no support for modifying KORG files yet.
  • 4. AKAI classes: These provide support for loading sample based disks (CDROMs, hard disks, ZIP disks) and disk image files of AKAI's hardware sampler series S1000, S01, S2000 and S3000.

    The AKAI classes are a branch of libakai. In the AKAI classes of libgig, libakai's original dependency to the so called Carbon C++ library has been removed and has been replaced by using ordinay C++ STL classes instead. Further, this branch of libakai also provides support for Linux and other POSIX based OSes (the original libakai was limited to Mac and Windows).

    Currently the AKAI classes don't have their own dedicated C++ namespace. Refer to class AkaiDisk as toplevel entry class for accessing AKAI sounds.

Besides the mentioned major parts above, libgig also provides the following three other components:

  • 5. DLS classes: Provide convenient methods to access DLS (Downloadable Sounds) Level 1 and 2 files. The DLS file format has been designed as open file format to be adopted by various keyboard manufacturers for their sounds. However it never really made it to a broad standard. You can use the DLS classes of libgig to load, modify and create DLS files from scratch, however you will probably not find many DLS files and/or software or hardware that supports this file format. The main reason why these classes exist in libgig, is because of the fact that the Gigasampler / GigaStudio file format was designed as extension on top of the DLS file format (with quite some radical modifications though).
  • 6. RIFF classes: Provide convenient methods to parse and access arbitrary RIFF files. The "Resource Interchange File Format" provides universal data containers ordered in a tree-like structure and can be compared to XML, but with the difference that RIFF is binary encoded.

    The DLS file format, the gig file format, the sf2 file format and KORG's file format are all based on RIFF on lowest level of their file format. And consequently all those classes mentioned above are using the RIFF classes for that purpose.
  • 7. Serialization classes: This is a separate framework on its own, which allows efficient and powerful serialization and deserialization of native C++ objects and is used by gig classes and i.e. the gigedit application for implementing a preset system.

License

Most parts of libgig and its tools are released under the terms of the GNU General Public License (GPL). This applies to the gig classes, sf2 classes, Korg classes, DLS classes, RIFF classes and all of their tools and example programs. We may offer you a commercial license for using libgig in commercial products. If you are interested in a commercial license, contact us!

The AKAI classes and their tools / example programs are released under the terms of the GNU Lesser General Public License (LGPL).

If you have any questions regarding license aspects, contact us!

Examples

Beside the actual C++ library, there are the following example applications which demonstrate how to use the library:

  • gigdump: Prints out the content of a .gig file.
  • gigextract: Extracts audio samples from a .gig file as .wav files.
  • gigmerge: Combines multiple .gig files to one .gig file.
  • gig2mono: Converts .gig files from stereo to mono.
  • gig2stereo: Converts .gig files from mono sample pairs to true interleaved stereo.
  • wav2gig: Creates a new .gig file from a set of .wav files.
  • dlsdump: Prints out the content of a DLS file.
  • rifftree: Prints out the RIFF tree of an arbitrary RIFF container file.
  • sf2dump: Prints out the content of a .sf2 file.
  • sf2extract: Extracts audio samples from a .sf2 file as .wav files.
  • korgdump: Prints out the content of KORG sound files (.KSF, .KMP).
  • korg2gig: Converts KORG (.KSF, .KMP) sound files to GigaStudio (.gig) files.
  • akaidump: Dump an AKAI media i.e. from a CDROM drive as disk image file to your HD.
  • akaiextract: Extracts audio samples from an AKAI media or from an AKAI disk image file (as .wav files).

Currently libgig ist most prominently used by LinuxSampler and gigedit.

Portability

This library is developed and optimized for POSIX compliant operating systems like Linux and Mac OS X, as well as for Windows. It is written as cross platform C++ library, so libgig should also compile for other operation systems as well. Due to this it works on all architectures (i.e. 32 bit x86, 64 bit x86, PPC and many more). It works on little endian and big endian systems.

Bugs

Please report bugs on http://bugs.linuxsampler.org/ and/or subscribe to the LinuxSampler developers mailing list.

Outro

For compilation instructions, requirements and further details please refer to the README file et al.

That's all folks. Happy hacking!

– Christian Schoenebeck cuse@.nosp@m.user.nosp@m.s.sou.nosp@m.rcef.nosp@m.orge..nosp@m.net

See also
http://www.linuxsampler.org