daisysp::HarmonicOscillator¶
Harmonic Oscillator Module based on Chebyshev polynomials. More...
#include <harmonic_osc.h>
Public Functions¶
Name | |
---|---|
HarmonicOscillator() | |
~HarmonicOscillator() | |
void | Init(float sample_rate) |
float | Process() |
void | SetFreq(float freq) |
void | SetFirstHarmIdx(int idx) |
void | SetAmplitudes(const float * amplitudes) |
void | SetSingleAmp(const float amp, int idx) |
Detailed Description¶
Harmonic Oscillator Module based on Chebyshev polynomials.
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 ~HarmonicOscillator¶
function Init¶
Parameters:
- sample_rate Audio engine samplerate
Initialize harmonic oscillator
function Process¶
Get the next floating point sample
function SetFreq¶
Parameters:
- freq Freq to be set in Hz.
Set the main frequency
function SetFirstHarmIdx¶
Parameters:
- idx Default behavior is 1. Values < 0 default to 1.
Offset the set of harmonics. Passing in 3 means "harmonic 0" is the 3rd harm., 1 is the 4th, etc.
function SetAmplitudes¶
Parameters:
- amplitudes Amplitudes to set. Sum of all amplitudes must be < 1. The array referenced must be at least as large as num_harmonics.
Set the amplitudes of each harmonic of the root.
function SetSingleAmp¶
Parameters:
- amp Amplitude to set
- idx Which harmonic to set.
Sets one amplitude. Does nothing if idx out of range.
---¶
Updated on 2024-01-03 at 19:38:46 +0000