BasicSynth Library
|
Directory |
Usage |
Bin |
Executable images |
Lib |
Object file libraries |
Include |
Source include files. Much of the BasicSynth sound generation code is contained in these files |
Documents |
Various documents. |
Doxygen | Script to produce detailed documentation with Doxygen |
Src |
Source code |
Src/Common |
Common source, mostly implementation of sequencers and file I/O |
Src/Instruments |
Source to the BasicSynth instruments collection library. |
Src/Notelist |
Source to the notelist parser and interpreter library. |
Src/Examples |
Source to the example programs. Each sub-directory contains one example program. The theory and algorithm of each program is explained in the associated book chapter. |
Src/Utilities |
Source to the utility programs. Each sub-directory contains one utility program. These are Windows-only GUI programs that use the BasicSynth library and demonstrate various synthesis techniques. |
BSynth |
Command line version of the synthesizer. |
To build your own synthesis program with BasicSynth you need at a minimum the Include files and the Common library (Lib/Common.lib). The Include directory and the Common library provide the sound generation, wave file and sequencer code. The header file BasicSynth.h includes all of the library.
If you want to use the BasicSynth instruments collection in your program, you must also include the header file Src/Instruments/Instruments.h and link the Lib/Instruments.lib library.
To include the Notelist score processor, you must include the header file NLConvert.h from the Src/Notelist directory and link the Lib/Notelist.lib library.
Note: Libraries on Linux have the .a extension instead of .lib
Reference documentation on the libraries is conatined in the Documents directory.
There are several solution files that can be built depending on what you want to do. All solution files are for Visual Studio 2008 (i.e. version 9). If you have a different version of the compiler, you will have to reproduce the project and/or solution files.
To build everything, use the solution file Src/BasicSynth.sln
To build just the libraries, use the solution files in Src/Common, Src/Instruments, and Src/Notelist directories.
To build the Example programs, use the solution file in Src/Examples. This builds all the example programs and libraries.
To build the utilities, use the solution file in Src/Utilities.
To build the stand-alone command line synthesizer, build the project in Src/BSynth.
Each project provides four targets:
Output of the 32-bit release version is in Bin and Lib. The 64-bit version produces output in Bin64 and Lib64
There is a master Makefile located in the Src directory. This will build all of the system. There is also a Makefile in each directory that can be used if you only want to build part of the system. The file BasicSynth.cfg in the Src directory contains the settings for the compiler and linker. Edit this file to point to the appropriate places. Usually you will only need to change the location of BSDIR in case you put the source in a directory other than your home directory. By default, BasicSynth is built with XML support using the libxml2 library. You should install the libxml2-dev package first before building BasicSynth. If you do not need to use the project/instrument file loading code, there is a null implementation of the XmlWrapper class that can be used instead. The file is Src/Common/XmlWrapN.cpp and should be compiled and added to the Common library in place of XmlWrapU.cpp
Output is to the directories Bin and Lib under the BasicSynth install directory. (Note the capitalization!)
Note:I have noticed a problem with the GNU make that causes make to halt when descending three directory levels. Running make with the command line argument --no-print-directory fixes this.
This example program shows a basic oscillator. It produces one second of a sin wave and writes the sound into the file Example01.wav
These examples demonstrate envelope generators. Example02 has in-line code, Example02a uses the BasicSynth Library, Example02b uses a graphics line algorithm.
Program to calculate complex waveforms.
Program to calculate complex waveforms using wavetable oscillators.
Various filters, LP, HP, BP, Reson, using bi-quad filter; FIR and IIR averaging and convolution.
Program to demonstrate mixing and panning.
Using delay lines to implement echo.
Using delay lines to implement reverb.
Using delay lines to implement Flanger/Chorus.
BasicSynth sequencer.
MIDI Sequencer.
Synthesizer Instruments
This program allows setting each of 16 partials to construct a complex waveform using the inverse Fourier transform (sum of sine waves). The resulting waveform can be saved to disk as a WAV file and as a graphic (EMF). Settings can be copied to the clipboard.
This program implements a three oscillator FM synthesizer. Each oscillator is combined with an ADSR envelope generator. Several presets are available as examples. The program can save the sound to a WAV file. The settings can also be copied to the clipboard.
This program implements a Schroeder reverb. The loop times and reverb time can be set from the program to hear how they affect the sound. Sounds can be internally generated or loaded from a WAV file. The processed sound can be saved to disk.
This program implements a Flanger/Chorus effect. The delay times, modulation depth, and amplitudes can be set to hear how they affect the sound. Sounds can be internally generated or loaded from a WAV file. The processed sound can be saved to disk.
This program is a complete synthesizer that runs from a command line. It takes one argument, the name of the project file to process.
BSynth project.xml
The documentation on this program gives the specification for the project file and other related files.
© 2008, Daniel R. Mitchell, All rights reserved except as noted below.
See more synthesis stuff at the BasicSynth Website
The BasicSynth library, instrument library, example and utility programs are licensed under the CC-GNU GPL.