is a cross-platform C++ library for Audio Digital Signal Processing. Aptly named after the "Q factor", a dimensionless parameter that describes the quality of a resonant circuit, the Q DSP Library is designed to be simple and elegant, as the simplicity of its name suggests, and efficient enough to run
on small microcontrollers.
Q leverages the power of modern C++ and efficient use of functional programming techniques, especially function composition using fine-grained and reusable function objects (both stateless and stateful), to simplify complex DSP programming tasks without sacrificing readability.
Q is the host of some experimental Music related DSP facilities the author has accumulated over the years as part of research and development, and will continue to evolve to accommodate more facilities necessary for the fulfillment of various Music related projects.
The library is Open Source and released under the very liberal MIT License.
Status:
mastertracks the latest stable release (currently v1.5.1). The next release, v1.6, is developed ondevelop, where the docs stay in sync as changes land. See NEWS.md for what is new in each release.
Dexter, a high-fidelity Yamaha DX7 emulation, built with QPlug: a library for building audio plugins using the Cycfi Elements GUI library. QPlug is an optional library in the Q ecosystem.
Modern C++
- Type-Safe Units: 440_Hz, 10_ms, -6_dB
- C++20 Concepts and Composable Function Objects
- Highly Reusable, Modular Building Blocks
- Header-Only DSP Core, No Third-Party Dependencies
- MIT License
Desktop to Microcontroller
- macOS, Windows and Linux
- Microcontrollers with an FPU and a C++20 Compiler: Tested on STM32 with Arm GCC 12
MIDI 2.0
- Full MIDI 2.0: UMP, Per-Note Expression, MPE, MIDI-CI
- MIDI 1.0 and 2.0 Translation, Both Ways
- Conformance Tests, Clause by Clause: UMP, MIDI-CI, MPE
- Verified with the MIDI Association Workbench, Including Over USB on a Device Running Q Firmware
Signal Processing
- BACF Pitch Detection: Sub-Cent Accuracy
- Signal Conditioning for Real Instruments
- Biquad Filters
- Resonant Filters: State Variable, Moog and OTA Ladders
- Virtual Analog Synthesis
- FM Synthesis: High-Fidelity DX7 Emulation
- Granular Synthesis
- Delay Lines and Fractional Ring Buffers with Interpolation
- Envelope Followers: Peak, RMS, True RMS
- Dynamics: Compressor, Expander, AGC
- Generators: Envelopes, LFOs, Windows, Noise
- Fast Math: Exp, Log, Pow and Decibel Approximations
Plugins and I/O
- CLAP-First Plugins, Wrapped by clap-wrapper for VST3, AudioUnit and Standalone
- GUI with the Modern Elements C++ GUI Library
- Parameters, Presets, Saved State and HiDPI Zoom, Built In
- Cross-Platform Audio and MIDI I/O, With Audio and MIDI Files
Learning
Q comes in three layers. The core stands on its own; the other two are optional and each builds on it.
Q, the core (q_lib): The DSP library proper: filters, envelopes and dynamics, oscillators and synthesis, pitch detection, MIDI 1.0 and 2.0, and the support facilities they share. It is header-only and needs only the C++ standard library and the header-only Cycfi infra, so it runs on small microcontrollers as readily as on a desktop. See the Q Reference.
QIO (q_io): Audio and MIDI input and output for a desktop application: devices, streams and audio files, built on RtAudio and libremidi. The tests and examples use it; an application with its own I/O, a plugin for one, does without it. See the QIO Reference.
QPlug (q_plug): A framework for building audio plugins: write the DSP, the parameters and an Elements GUI as three plain classes, and get CLAP, VST3 and AudioUnit plugins and a standalone app. It is off by default. See the QPlug Reference.
None is installed by hand: CMake brings each in, pinned, the first time you configure.
Q, the core (q_lib): Only the C++ standard library and the header-only Cycfi infra, a git submodule. A clone without the submodule still builds: CMake fetches infra instead.
QIO (q_io): RtAudio for audio and libremidi for MIDI 1.0 and 2.0, libremidi from a Cycfi fork that carries bug fixes sent upstream.
QPlug (q_plug): Elements for the GUI, CLAP and clap-wrapper for the plugin formats and the standalone app, and nlohmann json for state and presets. Fetched only when QPlug is built.
The compiler, CMake and the few system packages each platform needs are in Q Setup and Installation and QPlug Setup and Installation.
The documentation follows the path through Q:
- Set up. Q Setup and Installation builds Q and QIO with their tests and examples; QPlug Setup and Installation adds what plugins need.
- Learn by example. The Q Tutorials go from a sine oscillator to polyphonic synths, easiest first; the QPlug Tutorials build a plugin.
- Look things up. The Q Reference, which opens with Fundamentals, the QIO Reference and the QPlug Reference.
Joel got into electronics and programming in the 80s because almost everything in music, his first love, is becoming electronic and digital. Since then, he builds his own guitars, effect boxes and synths. He enjoys playing distortion-laden rock guitar, composes and produces his own music in his home studio.
Joel de Guzman is the principal architect and engineer at Cycfi Research. He is a software engineer specializing in advanced C++ and an advocate of Open Source. He has authored a number of highly successful Open Source projects such as Boost.Spirit, Boost.Phoenix and Boost.Fusion. These libraries are all part of the Boost Libraries, a well respected, peer-reviewed, Open Source, collaborative development effort.
Join the Discord channel to discuss Q and chat with the developer.
Copyright (c) 2014-2026 Joel de Guzman. All rights reserved. Distributed under the MIT License


