LMMS
Loading...
Searching...
No Matches
dsp::basic_synth Struct Referenceabstract

#include <synth.h>

Inheritance diagram for dsp::basic_synth:
calf_plugins::wavetable_audio_module dsp::drawbar_organ calf_plugins::organ_audio_module

Public Member Functions

virtual void setup (int sr)
virtual void trim_voices ()
virtual dsp::voicegive_voice ()
virtual void steal_voice ()
virtual void render_to (float(*output)[2], int nsamples)
virtual void note_on (int note, int vel)
virtual void percussion_note_on (int note, int vel)
virtual void control_change (int ctl, int val)
virtual void note_off (int note, int vel)
virtual void pitch_bend (int amt)
 amt = -8192 to 8191
virtual void on_pedal_release ()
virtual bool check_percussion ()
virtual ~basic_synth ()

Protected Types

typedef basic_pool< dsp::voice * > voice_array

Protected Member Functions

void init_voices (int count)
void kill_note (int note, int vel, bool just_one)
virtual dsp::voicealloc_voice ()=0

Protected Attributes

int sample_rate
 Current sample rate.
bool hold
 Hold pedal state.
bool sostenuto
 Sostenuto pedal state.
voice_array allocated_voices
 All voices available.
voice_array active_voices
 Voices currently playing.
voice_array unused_voices
 Voices allocated, but not used.
std::bitset< 128 > gate
 Gate values for all 128 MIDI notes.
unsigned int polyphony_limit
 Maximum allocated number of channels.

Detailed Description

Base class for all kinds of polyphonic instruments, provides somewhat reasonable voice management, pedal support - and little else. It's implemented as a base class with virtual functions, so there's some performance loss, but it shouldn't be horrible.

Todo
it would make sense to support all notes off controller too

Member Typedef Documentation

◆ voice_array

Constructor & Destructor Documentation

◆ ~basic_synth()

basic_synth::~basic_synth ( )
virtual

Member Function Documentation

◆ alloc_voice()

virtual dsp::voice * dsp::basic_synth::alloc_voice ( )
protectedpure virtual

◆ check_percussion()

virtual bool dsp::basic_synth::check_percussion ( )
inlinevirtual

Reimplemented in dsp::drawbar_organ.

◆ control_change()

void basic_synth::control_change ( int ctl,
int val )
virtual

◆ give_voice()

dsp::voice * basic_synth::give_voice ( )
virtual

◆ init_voices()

void basic_synth::init_voices ( int count)
protected

◆ kill_note()

void basic_synth::kill_note ( int note,
int vel,
bool just_one )
protected

◆ note_off()

void basic_synth::note_off ( int note,
int vel )
virtual

◆ note_on()

void basic_synth::note_on ( int note,
int vel )
virtual

◆ on_pedal_release()

void basic_synth::on_pedal_release ( )
virtual

◆ percussion_note_on()

virtual void dsp::basic_synth::percussion_note_on ( int note,
int vel )
inlinevirtual

Reimplemented in dsp::drawbar_organ.

◆ pitch_bend()

virtual void dsp::basic_synth::pitch_bend ( int amt)
inlinevirtual

amt = -8192 to 8191

Reimplemented in calf_plugins::wavetable_audio_module, and dsp::drawbar_organ.

◆ render_to()

void basic_synth::render_to ( float(*) output[2],
int nsamples )
virtual

◆ setup()

virtual void dsp::basic_synth::setup ( int sr)
inlinevirtual

Reimplemented in dsp::drawbar_organ.

◆ steal_voice()

void basic_synth::steal_voice ( )
virtual

◆ trim_voices()

void basic_synth::trim_voices ( )
virtual

Member Data Documentation

◆ active_voices

voice_array dsp::basic_synth::active_voices
protected

Voices currently playing.

◆ allocated_voices

voice_array dsp::basic_synth::allocated_voices
protected

All voices available.

◆ gate

std::bitset<128> dsp::basic_synth::gate
protected

Gate values for all 128 MIDI notes.

◆ hold

bool dsp::basic_synth::hold
protected

Hold pedal state.

◆ polyphony_limit

unsigned int dsp::basic_synth::polyphony_limit
protected

Maximum allocated number of channels.

◆ sample_rate

int dsp::basic_synth::sample_rate
protected

Current sample rate.

◆ sostenuto

bool dsp::basic_synth::sostenuto
protected

Sostenuto pedal state.

◆ unused_voices

voice_array dsp::basic_synth::unused_voices
protected

Voices allocated, but not used.


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