LMMS
Loading...
Searching...
No Matches
zyncarla::ADnote Class Reference

#include <ADnote.h>

Inheritance diagram for zyncarla::ADnote:
zyncarla::SynthNote

Classes

struct  Global
struct  Voice

Public Member Functions

 ADnote (ADnoteParameters *pars, SynthParams &spars, WatchManager *wm=0, const char *prefix=0)
 ~ADnote ()
void legatonote (LegatoParams pars)
int noteout (float *outl, float *outr)
void releasekey ()
bool finished () const
void entomb (void)
virtual SynthNotecloneLegato (void) override
Public Member Functions inherited from zyncarla::SynthNote
 SynthNote (SynthParams &pars)
virtual ~SynthNote ()
void setVelocity (float velocity_)

Private Member Functions

void setupVoice (int nvoice)
int setupVoiceUnison (int nvoice)
void setupVoiceDetune (int nvoice)
void setupVoiceMod (int nvoice, bool first_run=true)
void setfreq (int nvoice, float in_freq)
void setfreqFM (int nvoice, float in_freq)
void compute_unison_freq_rap (int nvoice)
void computecurrentparameters ()
void initparameters (WatchManager *wm, const char *prefix)
void KillVoice (int nvoice)
void KillNote ()
float getvoicebasefreq (int nvoice) const
float getFMvoicebasefreq (int nvoice) const
void ComputeVoiceOscillator_LinearInterpolation (int nvoice)
void ComputeVoiceOscillator_CubicInterpolation (int nvoice)
void ComputeVoiceOscillatorMorph (int nvoice)
void ComputeVoiceOscillatorRingModulation (int nvoice)
void ComputeVoiceOscillatorFrequencyModulation (int nvoice, int FMmode)
void ComputeVoiceOscillatorPitchModulation (int nvoice)
void ComputeVoiceWhiteNoise (int nvoice)
void ComputeVoicePinkNoise (int nvoice)
void ComputeVoiceDC (int nvoice)
void fadein (float *smps) const

Private Attributes

ADnoteParameterspars
unsigned char stereo
int midinote
float velocity
float basefreq
ONOFFTYPE NoteEnabled
struct zyncarla::ADnote::Global NoteGlobalPar
struct zyncarla::ADnote::Voice NoteVoicePar [NUM_VOICES]
float pinking [NUM_VOICES][14]
int unison_size [NUM_VOICES]
float unison_stereo_spread [NUM_VOICES]
float * oscposlo [NUM_VOICES]
float * oscfreqlo [NUM_VOICES]
intoscposhi [NUM_VOICES]
intoscfreqhi [NUM_VOICES]
float * oscposloFM [NUM_VOICES]
float * oscfreqloFM [NUM_VOICES]
float * unison_base_freq_rap [NUM_VOICES]
float * unison_freq_rap [NUM_VOICES]
bool * unison_invert_phase [NUM_VOICES]
struct { 
   float   amplitude 
   float *   step 
   float *   position 
unison_vibratto [NUM_VOICES]
unsigned intoscposhiFM [NUM_VOICES]
unsigned intoscfreqhiFM [NUM_VOICES]
float oldamplitude [NUM_VOICES]
float newamplitude [NUM_VOICES]
float FMoldamplitude [NUM_VOICES]
float FMnewamplitude [NUM_VOICES]
float * FMoldsmp [NUM_VOICES]
float * tmpwavel
float * tmpwaver
int max_unison
float ** tmpwave_unison
float * bypassl
float * bypassr
float globaloldamplitude
float globalnewamplitude
char firsttick [NUM_VOICES]
int portamento
float bandwidthDetuneMultiplier

Additional Inherited Members

Public Attributes inherited from zyncarla::SynthNote
class Allocatormemory
Protected Attributes inherited from zyncarla::SynthNote
class zyncarla::SynthNote::Legato legato
const Controllerctl
const SYNTH_Tsynth
const AbsTimetime
WatchManagerwm

Detailed Description

The "additive" synthesizer

Constructor & Destructor Documentation

◆ ADnote()

ADnote::ADnote ( ADnoteParameters * pars,
SynthParams & spars,
WatchManager * wm = 0,
const char * prefix = 0 )

Constructor.

Parameters
parsNote Parameters
sparsSynth Engine Agnostic Parameters

◆ ~ADnote()

ADnote::~ADnote ( )

Destructor

Member Function Documentation

◆ cloneLegato()

SynthNote * ADnote::cloneLegato ( void )
overridevirtual

Implements zyncarla::SynthNote.

◆ compute_unison_freq_rap()

void ADnote::compute_unison_freq_rap ( int nvoice)
private

Computes relative frequency for unison and unison's vibratto. Note: Must be called before setfreq* functions.

◆ computecurrentparameters()

void ADnote::computecurrentparameters ( )
private

Compute parameters for next tick

◆ ComputeVoiceDC()

void ADnote::ComputeVoiceDC ( int nvoice)
inlineprivate

◆ ComputeVoiceOscillator_CubicInterpolation()

void zyncarla::ADnote::ComputeVoiceOscillator_CubicInterpolation ( int nvoice)
inlineprivate

Compute the Oscillator's samples. Affects tmpwave_unison and updates oscposhi/oscposlo

Todo
remove this declaration if it is commented out

◆ ComputeVoiceOscillator_LinearInterpolation()

void ADnote::ComputeVoiceOscillator_LinearInterpolation ( int nvoice)
inlineprivate

Compute the Oscillator's samples. Affects tmpwave_unison and updates oscposhi/oscposlo

◆ ComputeVoiceOscillatorFrequencyModulation()

void ADnote::ComputeVoiceOscillatorFrequencyModulation ( int nvoice,
int FMmode )
inlineprivate

Computes the Frequency Modulated Oscillator.

Parameters
FMmodemodulation type 0=Phase 1=Frequency

◆ ComputeVoiceOscillatorMorph()

void ADnote::ComputeVoiceOscillatorMorph ( int nvoice)
inlineprivate

Computes the Oscillator samples with morphing. updates tmpwave_unison

◆ ComputeVoiceOscillatorPitchModulation()

void zyncarla::ADnote::ComputeVoiceOscillatorPitchModulation ( int nvoice)
inlineprivate

TODO

◆ ComputeVoiceOscillatorRingModulation()

void ADnote::ComputeVoiceOscillatorRingModulation ( int nvoice)
inlineprivate

Computes the Ring Modulated Oscillator.

◆ ComputeVoicePinkNoise()

void ADnote::ComputeVoicePinkNoise ( int nvoice)
inlineprivate

◆ ComputeVoiceWhiteNoise()

void ADnote::ComputeVoiceWhiteNoise ( int nvoice)
inlineprivate

Generate Noise Samples for Voice

◆ entomb()

void ADnote::entomb ( void )
virtual

Make a note die off next buffer compute

Implements zyncarla::SynthNote.

◆ fadein()

void ADnote::fadein ( float * smps) const
inlineprivate

Fadein in a way that removes clicks but keep sound "punchy"

◆ finished()

bool ADnote::finished ( ) const
virtual

Return if note is finished.

Returns
finished=1 unfinished=0

Implements zyncarla::SynthNote.

◆ getFMvoicebasefreq()

float ADnote::getFMvoicebasefreq ( int nvoice) const
inlineprivate

Get modulator's base frequency

◆ getvoicebasefreq()

float ADnote::getvoicebasefreq ( int nvoice) const
inlineprivate

Get the Voice's base frequency

◆ initparameters()

void ADnote::initparameters ( WatchManager * wm,
const char * prefix )
private

Initializes All Parameters

◆ KillNote()

void ADnote::KillNote ( )
private

Deallocate Note resources and voice resources

◆ KillVoice()

void ADnote::KillVoice ( int nvoice)
private

Deallocate/Cleanup given voice

◆ legatonote()

void ADnote::legatonote ( LegatoParams pars)
virtual

Alters the playing note for legato effect

initparameters();

Implements zyncarla::SynthNote.

◆ noteout()

int ADnote::noteout ( float * outl,
float * outr )
virtual

Compute Output Samples

Returns
0 if note is finished

Implements zyncarla::SynthNote.

◆ releasekey()

void ADnote::releasekey ( )
virtual

Release the key for the note and start release portion of envelopes.

Implements zyncarla::SynthNote.

◆ setfreq()

void ADnote::setfreq ( int nvoice,
float in_freq )
private

Changes the frequency of an oscillator.

Parameters
nvoicevoice to run computations on
in_freqnew frequency

◆ setfreqFM()

void ADnote::setfreqFM ( int nvoice,
float in_freq )
private

Set the frequency of the modulator oscillator

◆ setupVoice()

void ADnote::setupVoice ( int nvoice)
private

◆ setupVoiceDetune()

void ADnote::setupVoiceDetune ( int nvoice)
private

◆ setupVoiceMod()

void ADnote::setupVoiceMod ( int nvoice,
bool first_run = true )
private

◆ setupVoiceUnison()

int ADnote::setupVoiceUnison ( int nvoice)
private

Member Data Documentation

◆ amplitude

float zyncarla::ADnote::amplitude

◆ bandwidthDetuneMultiplier

float zyncarla::ADnote::bandwidthDetuneMultiplier
private

◆ basefreq

float zyncarla::ADnote::basefreq
private

◆ bypassl

float* zyncarla::ADnote::bypassl
private

◆ bypassr

float * zyncarla::ADnote::bypassr
private

◆ firsttick

char zyncarla::ADnote::firsttick[NUM_VOICES]
private

◆ FMnewamplitude

float zyncarla::ADnote::FMnewamplitude[NUM_VOICES]
private

◆ FMoldamplitude

float zyncarla::ADnote::FMoldamplitude[NUM_VOICES]
private

◆ FMoldsmp

float* zyncarla::ADnote::FMoldsmp[NUM_VOICES]
private

◆ globalnewamplitude

float zyncarla::ADnote::globalnewamplitude
private

◆ globaloldamplitude

float zyncarla::ADnote::globaloldamplitude
private

◆ max_unison

int zyncarla::ADnote::max_unison
private

◆ midinote

int zyncarla::ADnote::midinote
private

◆ newamplitude

float zyncarla::ADnote::newamplitude[NUM_VOICES]
private

◆ NoteEnabled

ONOFFTYPE zyncarla::ADnote::NoteEnabled
private

◆ NoteGlobalPar

struct zyncarla::ADnote::Global zyncarla::ADnote::NoteGlobalPar
private

◆ NoteVoicePar

struct zyncarla::ADnote::Voice zyncarla::ADnote::NoteVoicePar[NUM_VOICES]
private

◆ oldamplitude

float zyncarla::ADnote::oldamplitude[NUM_VOICES]
private

◆ oscfreqhi

int * zyncarla::ADnote::oscfreqhi[NUM_VOICES]
private

◆ oscfreqhiFM

unsigned int * zyncarla::ADnote::oscfreqhiFM[NUM_VOICES]
private

◆ oscfreqlo

float * zyncarla::ADnote::oscfreqlo[NUM_VOICES]
private

◆ oscfreqloFM

float * zyncarla::ADnote::oscfreqloFM[NUM_VOICES]
private

◆ oscposhi

int* zyncarla::ADnote::oscposhi[NUM_VOICES]
private

◆ oscposhiFM

unsigned int* zyncarla::ADnote::oscposhiFM[NUM_VOICES]
private

◆ oscposlo

float* zyncarla::ADnote::oscposlo[NUM_VOICES]
private

◆ oscposloFM

float* zyncarla::ADnote::oscposloFM[NUM_VOICES]
private

◆ pars

ADnoteParameters& zyncarla::ADnote::pars
private

◆ pinking

float zyncarla::ADnote::pinking[NUM_VOICES][14]
private

◆ portamento

int zyncarla::ADnote::portamento
private

◆ position

float* zyncarla::ADnote::position

◆ step

float* zyncarla::ADnote::step

◆ stereo

unsigned char zyncarla::ADnote::stereo
private

◆ tmpwave_unison

float** zyncarla::ADnote::tmpwave_unison
private

◆ tmpwavel

float* zyncarla::ADnote::tmpwavel
private

◆ tmpwaver

float* zyncarla::ADnote::tmpwaver
private

◆ unison_base_freq_rap

float* zyncarla::ADnote::unison_base_freq_rap[NUM_VOICES]
private

◆ unison_freq_rap

float* zyncarla::ADnote::unison_freq_rap[NUM_VOICES]
private

◆ unison_invert_phase

bool* zyncarla::ADnote::unison_invert_phase[NUM_VOICES]
private

◆ unison_size

int zyncarla::ADnote::unison_size[NUM_VOICES]
private

◆ unison_stereo_spread

float zyncarla::ADnote::unison_stereo_spread[NUM_VOICES]
private

◆ [struct]

struct { ... } zyncarla::ADnote::unison_vibratto[NUM_VOICES]

◆ velocity

float zyncarla::ADnote::velocity
private

The documentation for this class was generated from the following files: