about

Gamma is a cross-platform, C++ library for doing generic synthesis and filtering of signals. It is oriented towards real-time sound and graphics applications, but is equally useful for non-real-time tasks. Gamma is designed to be "light-footed" in terms of memory and processing making it highly suitable for plug-in development or embedding in other C++ projects.

examples

Bassline pattern: code
Chirp tank: code
Counting in a room: code

More code examples ...

download

Source code can be found on GitHub. The 'master' branch is the latest stable version and the 'devel' branch is bleeding edge. Some older versions can be found under tags.

Other older versions are here: 0.9.5, 0.9.4, 0.9.3, 0.9.1, 0.9.0

design overview

Processing algorithms are designed as much as possible to be data type and domain independent. This allows a common set of functions and objects to be used for a variety of modalities, such as sound or graphics, and in arbitrary domains, such as time, space, or frequency. Algorithms are type generic which means they can process any type of data that has the appropriate mathematical operators defined (typically +, -, *, and /).

Whenever appropriate, objects use compile-time strategies for handling different behaviors, such as interpolation.

domains

Sampling domains are abstracted through an observer design pattern. The subject, a Domain object, holds a sampling rate/interval amount and notifies its observers, DomainObserver objects, whenever it changes value.

genericity

Gamma objects are templated on their value type allowing them to be used with any arithmetic data types, such as, scalars, vectors, and complex numbers.

RMul<float     > rMul(0.99);			// decaying envelope
RMul<Vec3<>    > rMul(Vec3<>(0.9,0.8,0.7));	// 3 decaying envelopes
RMul<Complex<> > rMul(Polar<>(1.00, M_2PI/8));	// complex sinusoid
RMul<Complex<> > rMul(Polar<>(0.99, M_2PI/8));	// complex exponential

syntax

Processing objects are typically either a generator or a filter and can be either domain observers or not. Objects adopt a standard processing operator interface similar to functional syntax. Generators return their next value with the () operator and filters return their next value with the (T) operator, where T is a value type.

gen::RAdd rAdd(1, 0);		// recursively add 1 starting at 0
for(int i=0; i<4; ++i)		// prints "1 2 3 4"
	cout << rAdd();		

fil::Delay1 delay1(0);		// 1 element delay starting with 0
for(int i=1; i<5; ++i)		// prints "0 1 2 3"
	cout << delay1(i);	

documentation

API documentation (HTML)
Quick tutorial (PDF)

license

Gamma is distributed under a permissive, non-copyleft BSD-like license under the Regents of the University of California.

Copyright (C) 2006-2008. The Regents of the University of California (REGENTS). 
All Rights Reserved.

Permission to use, copy, modify, distribute, and distribute modified versions
of this software and its documentation without fee and without a signed
licensing agreement, is hereby granted, provided that the above copyright
notice, the list of contributors, this paragraph and the following two paragraphs 
appear in all copies, modifications, and distributions.

IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

contact

putnam.lance at gmail.com