SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Render::Voice::Voice Class Reference

A voice renders audio samples for a given note / pitch. More...

#include <Voice.hpp>

Public Member Functions

 Voice (double sampleRate, const MIDI::Channel &channel, const Setup &setup)
 Construct a new voice renderer. More...
 
void keyReleased ()
 Signal the envelopes that the key is no longer pressed, transitioning to release phase. More...
 
bool isActive () const
 
bool canLoop () const
 
double render ()
 

Detailed Description

A voice renders audio samples for a given note / pitch.

Constructor & Destructor Documentation

◆ Voice()

Voice::Voice ( double  sampleRate,
const MIDI::Channel channel,
const Setup setup 
)

Construct a new voice renderer.

Parameters
sampleRatethe sample rate to use for generating audio
channelthe MIDI state associated with the renderer
setupthe zones to apply to build the generator state

References SF2::Entity::Generator::delayModulatorLFO, SF2::Entity::Generator::delayVibratoLFO, SF2::Entity::Generator::frequencyModulatorLFO, and SF2::Entity::Generator::frequencyVibratoLFO.

Member Function Documentation

◆ canLoop()

bool SF2::Render::Voice::Voice::canLoop ( ) const
inline
Returns
true if the voice can enter a loop if it is available

References SF2::Render::Voice::State::continuously, SF2::Render::Voice::State::duringKeyPress, and SF2::Render::Envelope::Generator::isGated().

Referenced by render().

◆ isActive()

bool SF2::Render::Voice::Voice::isActive ( ) const
inline
Returns
true if this voice is still rendering interesting samples

References SF2::Render::Envelope::Generator::isActive().

Referenced by render().

◆ keyReleased()

void SF2::Render::Voice::Voice::keyReleased ( )
inline

Signal the envelopes that the key is no longer pressed, transitioning to release phase.

References SF2::Render::Envelope::Generator::gate().

◆ render()


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