Class daisysp::HarmonicOscillator¶
template <int num_harmonics>
ClassList > daisysp > HarmonicOscillator
Harmonic Oscillator Module based on Chebyshev polynomials.More...
#include <harmonic_osc.h>
Public Functions¶
| Type | Name |
|---|---|
| HarmonicOscillator () |
|
| void | Init (float sample_rate) |
| float | Process () |
| void | SetAmplitudes (const float * amplitudes) |
| void | SetFirstHarmIdx (int idx) |
| void | SetFreq (float freq) |
| void | SetSingleAmp (const float amp, int idx) |
| ~HarmonicOscillator () |
Detailed Description¶
Author:
Ben Sergentanis
Date:
Dec 2020 Harmonic Oscillator Module based on Chebyshev polynomials Works well for a small number of harmonics. For the higher order harmonics. We need to reinitialize the recurrence by computing two high harmonics.
Ported from pichenettes/eurorack/plaits/dsp/oscillator/harmonic_oscillator.h to an independent module. Original code written by Emilie Gillet in 2016.
Public Functions Documentation¶
function HarmonicOscillator¶
function Init¶
Initialize harmonic oscillator
Parameters:
sample_rateAudio engine samplerate
function Process¶
Get the next floating point sample
function SetAmplitudes¶
Set the amplitudes of each harmonic of the root.
Parameters:
amplitudesAmplitudes to set. Sum of all amplitudes must be < 1. The array referenced must be at least as large as num_harmonics.
function SetFirstHarmIdx¶
Offset the set of harmonics. Passing in 3 means "harmonic 0" is the 3rd harm., 1 is the 4th, etc.
Parameters:
idxDefault behavior is 1. Values < 0 default to 1.
function SetFreq¶
Set the main frequency
Parameters:
freqFreq to be set in Hz.
function SetSingleAmp¶
Sets one amplitude. Does nothing if idx out of range.
Parameters:
ampAmplitude to setidxWhich harmonic to set.
function ~HarmonicOscillator¶
The documentation for this class was generated from the following file external-docs/DaisySP/Source/Synthesis/harmonic_osc.h