$ show LancePutnam/Gamma
Gamma is a cross-platform C++ library for real-time audio signal processing, synthesis, and analysis. It provides a modular collection of DSP building blocks including oscillators, envelopes, filters, effects, spectral analysis (FFT/STFT), spatial audio processing, voice management, and audio I/O via PortAudio. The architecture employs template-based design for type flexibility, strategy patterns for algorithm interchangeability, and a node-based system for constructing processing chains. Key entry points are specialized headers like Gamma/Oscillator.h, Gamma/Filter.h, and Gamma/Envelope.h, with Gamma/Gamma.h serving as a convenience aggregator. Data flows through interconnected processing nodes where audio signals move from sources (oscillators, audio input) through modifiers (filters, effects) to outputs (audio output, sound files), with modulation via envelopes and LFOs. External dependencies include PortAudio for audio I/O and optionally libsndfile for sound file handling.
The LLM identified 4 files worth highlighting for reuse:
Provides essential scalar math operations for audio processing (clipping, wrapping, windowing, dB conversion, etc.). These standalone functions have minimal dependencies (only Gamma::Types), are used throughout the library, and can be trivially extracted for any audio or signal processing project due to their independence and focus on fundamental operations.
Implements standard envelope generators (AD, ADSR, decay, segment, etc.) as self-contained template classes. Depending only on Gamma::Types and Gamma::gen (for generator-based envelopes), they follow clean, reusable patterns for modulation and synthesis. The design separates envelope state from audio processing, allowing use in any parameter automation context without requiring the full Gamma node system.
Contains a variety of filter designs (one-pole, two-pole, biquad, reson, allpass, etc.) as template classes. Implementing standard digital filter forms with dependencies only on Gamma::Types and Gamma::scl, these components are self-contained and follow canonical DSP structures. The biquad filter, in particular, is a fundamental, reusable building block applicable to countless audio applications beyond the Gamma ecosystem.
Provides function objects for generating common control signals (constant, line, exponential, sine, noise, etc.). Used for modulation and envelope generation but independent enough for any parameter automation, these lightweight objects depend only on Gamma::Types. The design exemplifies the strategy pattern for interchangeable generators, allowing easy substitution and extension without modifying core synthesis code.