libresidfp 1.1.1
Public Types | Public Member Functions | Friends | List of all members
reSIDfp::EnvelopeGenerator Class Reference

#include <EnvelopeGenerator.h>

Public Types

enum class  State { ATTACK , DECAY_SUSTAIN , RELEASE }
 

Public Member Functions

void clock ()
 
uint8_t output () const
 
void reset ()
 
void writeCONTROL_REG (uint8_t control)
 
void writeATTACK_DECAY (uint8_t attack_decay)
 
void writeSUSTAIN_RELEASE (uint8_t sustain_release)
 
uint8_t readENV () const
 

Friends

class State
 

Detailed Description

A 15 bit LFSR is used to implement the envelope rates, in effect dividing the clock to the envelope counter by the currently selected rate period.

In addition, another 5 bit counter is used to implement the exponential envelope decay, in effect further dividing the clock to the envelope counter. The period of this counter is set to 1, 2, 4, 8, 16, 30 at the envelope counter values 255, 93, 54, 26, 14, 6, respectively.

Member Enumeration Documentation

◆ State

The envelope state machine's distinct states. In addition to this, envelope has a hold mode, which freezes envelope counter to zero.

Member Function Documentation

◆ clock()

RESIDFP_INLINE void reSIDfp::EnvelopeGenerator::clock ( )

SID clocking.

◆ output()

uint8_t reSIDfp::EnvelopeGenerator::output ( ) const
inline

Get the Envelope Generator digital output.

◆ readENV()

uint8_t reSIDfp::EnvelopeGenerator::readENV ( ) const
inline

Return the envelope current value.

Returns
envelope counter value

◆ reset()

void reSIDfp::EnvelopeGenerator::reset ( )

SID reset.

◆ writeATTACK_DECAY()

void reSIDfp::EnvelopeGenerator::writeATTACK_DECAY ( uint8_t  attack_decay)

Write Attack/Decay register.

Parameters
attack_decayattack/decay value

◆ writeCONTROL_REG()

void reSIDfp::EnvelopeGenerator::writeCONTROL_REG ( uint8_t  control)

Write control register.

Parameters
controlcontrol register value

◆ writeSUSTAIN_RELEASE()

void reSIDfp::EnvelopeGenerator::writeSUSTAIN_RELEASE ( uint8_t  sustain_release)

Write Sustain/Release register.

Parameters
sustain_releasesustain/release value

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