Introduction
The deepnote library provides a C++14 header-only implementation of a synthesizer voice inspired by the iconic THX Deep Note sound effect.
Key Features
- Header-only library: No compilation required, just include and use
- Real-time performance: Optimized for audio applications
- Multiple oscillators: Support for up to 16 detuned oscillators per voice
- Bezier curve shaping: Smooth, controllable frequency transitions
- Strong typing: Type-safe API prevents common audio programming errors
- Comprehensive testing: Full test coverage with doctest framework
Quick Start
using namespace deepnote;
init_voice(voice, 3, nt::OscillatorFrequency(200.0f),
nt::SampleRate(48000.0f), nt::OscillatorFrequency(0.5f));
voice.set_target_frequency(nt::OscillatorFrequency(8000.0f));
for (size_t i = 0; i < num_samples; ++i) {
auto output = process_voice(voice, nt::AnimationMultiplier(1.0f),
nt::ControlPoint1(0.25f), nt::ControlPoint2(0.75f));
audio_buffer[i] = output.get();
}
Core voice implementation for the THX Deep Note effect synthesizer.
A synthesizer voice implementing the THX Deep Note effect.
Architecture Overview
The library is organized into several key components:
- DeepnoteVoice: Main voice class containing oscillators and state machine
- State Machine: Manages transitions between PENDING → IN_TRANSIT → AT_TARGET
- LFO Animation: Controls the speed and timing of frequency transitions
- Bezier Shaping: Provides non-linear curve shapes for natural-sounding animations
- Strong Types: Type-safe wrappers around float values (frequencies, rates, etc.)
Performance Characteristics
- CPU Usage: ~50 + (20 × num_oscillators) cycles per sample
- Memory Usage: ~2KB per voice (fixed allocation)
- Real-time Safe: No dynamic allocation in audio processing paths
- Scalable: Support for 1-16 oscillators depending on performance requirements
Examples
See the docs/examples/ directory for complete usage examples:
basic_usage.cpp - Simple Deep Note generation
vcvrack_integration.cpp - VCV Rack module integration
daisy_seed_integration.cpp - Embedded hardware usage
Testing
The library includes comprehensive unit tests using the doctest framework:
cd test
mkdir build && cd build
cmake .. && make
./bin/tests
License
This project is licensed under the MIT License - see LICENSE.txt for details.
Acknowledgments
- Inspired by the THX Deep Note sound effect
- Built on the DaisySP digital signal processing library
- Uses doctest for unit testing framework