Deepnote Synthesizer Voice Library v1.0.0
A C++14 header-only library implementing the THX Deep Note effect
Loading...
Searching...
No Matches
deepnotevoice.hpp File Reference

Core voice implementation for the THX Deep Note effect synthesizer. More...

#include "Synthesis/oscillator.h"
#include "oscfrequency.hpp"
#include "ranges/range.hpp"
#include "ranges/scaler.hpp"
#include "unitshapers/bezier.hpp"
#include "voice/frequencytable.hpp"
#include <algorithm>
#include <array>
#include <stdexcept>
#include <string>

Go to the source code of this file.

Classes

struct  deepnote::DeepnoteVoice
 A synthesizer voice implementing the THX Deep Note effect. More...
 

Functions

void deepnote::init_voice (DeepnoteVoice &voice, const size_t oscillator_count, const nt::OscillatorFrequency start_frequency, const nt::SampleRate sample_rate, const nt::OscillatorFrequency lfo_frequency, const nt::DetuneHz detune=nt::DetuneHz(constants::DEFAULT_DETUNE_HZ))
 Initialize a DeepnoteVoice with specified parameters.
 
template<typename TraceFunc = NoopTrace>
nt::OscillatorValue deepnote::process_voice (DeepnoteVoice &voice, const nt::AnimationMultiplier lfo_multiplier, const nt::ControlPoint1 cp1, const nt::ControlPoint2 cp2, const TraceFunc &trace_functor=NoopTrace())
 Process a single audio sample from the voice.
 

Detailed Description

Core voice implementation for the THX Deep Note effect synthesizer.

This file contains the DeepnoteVoice class which manages multiple detuned oscillators for creating the classic THX Deep Note sound. Features include non-linear frequency transitions via Bezier curves, state-based animation system, and LFO-driven modulation.

Author
David Irvine
Date
2025

Copyright (c) 2025 David Irvine

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file deepnotevoice.hpp.

Function Documentation

◆ init_voice()

void deepnote::init_voice ( DeepnoteVoice voice,
const size_t  oscillator_count,
const nt::OscillatorFrequency  start_frequency,
const nt::SampleRate  sample_rate,
const nt::OscillatorFrequency  lfo_frequency,
const nt::DetuneHz  detune = nt::DetuneHz(constants::DEFAULT_DETUNE_HZ) 
)
inline

Initialize a DeepnoteVoice with specified parameters.

Parameters
voiceVoice instance to initialize
oscillator_countNumber of oscillators (1 to MAX_OSCILLATORS)
start_frequencyInitial frequency in Hz
sample_rateAudio sample rate in Hz
lfo_frequencyBase LFO frequency for animation in Hz
detuneOscillator detuning amount in Hz (default: 2.5 Hz)

Definition at line 279 of file deepnotevoice.hpp.

◆ process_voice()

template<typename TraceFunc = NoopTrace>
nt::OscillatorValue deepnote::process_voice ( DeepnoteVoice voice,
const nt::AnimationMultiplier  lfo_multiplier,
const nt::ControlPoint1  cp1,
const nt::ControlPoint2  cp2,
const TraceFunc &  trace_functor = NoopTrace() 
)

Process a single audio sample from the voice.

This is the main processing function that should be called once per audio sample. It handles frequency transitions, applies Bezier curve shaping, and generates the combined output from all oscillators.

Parameters
voiceVoice instance to process
lfo_multiplierSpeed multiplier for animation (1.0 = normal speed)
cp1First Bezier control point [0,1]
cp2Second Bezier control point [0,1]
trace_functorOptional function for debugging/logging (default: no-op)
Returns
Combined oscillator output value

Definition at line 393 of file deepnotevoice.hpp.