AuLib
1.0beta
|
AuLib is a simple lightweight C++ (ISO C++14) class library for audio DSP.
The library and example programs are built with CMake. The only optional dependencies are libsndfile, portaudio, and portmidi.
The code can be used within any audio processing context and it can be incorporated in plugins and other programs with their own IO.
Documenation can be built using
HTML, latex and manual files are placed in the ./docs subdirectory under the build directory.
A number of simple examples are supplied to demonstrate how the library can be used. However, these are only very simple programs that only hint at the possible applications. Generally speaking, objects of the different processing classes are instantiated and then used to generate or process vectors of audio data, which are kept the library objects.
It is possible to access the output samples of each object directly, and processing functions can take both objects (const AudioObj&) and audio vectors (const double) as inputs (as well as other parameters, depending on the object type). A number of operations can be applied to objects (such as scaling, offsetting, mixing to, etc.).
A minimal example is shown below where an echo effect is applied to an arbitrary input, using SoundIn, SoundOut, Chn, Pan, SigBus and Delay objects.
The library classes can be easily extended. There is quite a bit freedom to do this, as there are not strict prescriptions on the form or signature of processing methods. Usually we would inherit from the AudioBase class to allow easy integration with existing objects, and to avail of basic audio processing facilities provided there. Supplying a processing method that consumes a vector of samples and another that reads from an AudioObj& is the minimum necessary to allow full integration. The recommended approach is to separate interface from implementation, and to provide a means for overriding this.
The following example is a skeleton of an AudioBase-derived class that demonstrates these ideas:
Copyright (C) 2016-7 V Lazzarini
This software is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /