libmsx
C library for MSX
Loading...
Searching...
No Matches
Software envelope generator APIs

Software envelope generator interface. More...

+ Collaboration diagram for Software envelope generator APIs:

Data Structures

struct  sound_eg_AHDSR
 Parameters for AHDSR envelope generator. More...
 
struct  sound_eg_LPCM
 Parameters for linear PCM (8-bit, 60Hz) envelope generator. More...
 
struct  sound_eg_attribute
 Attributes of a software envelope generator object. More...
 
union  sound_eg_attribute.__unnamed3__
 

Macros

#define SOUND_EG_TABLE_MAX   (16)
 The maximum number of elements for the envelope generator attribute table.
 
#define SOUND_EG_AHDSR   (0)
 The class identifier for AHDSR envelope generator.
 
#define SOUND_EG_LPCM   (1)
 The class identifier for LPCM envelope generator.
 

Functions

void sound_set_eg_table (const struct sound_eg_attribute *table)
 MSX (Re)set the software envelope generator attribute table.
 

Detailed Description

Software envelope generator interface.


Data Structure Documentation

◆ sound_eg_AHDSR

struct sound_eg_AHDSR

Parameters for AHDSR envelope generator.

Definition at line 42 of file sound_eg.h.

Data Fields
uint8_t attack_rate Asccendant velocity of attack phase.
uint8_t hold_time Period of hold phase.
uint8_t decay_rate Deccendant velocity of decay phase.
uint8_t sustain_level Output level of sustain phase.
uint8_t release_rate desccendant velocity of release phase

◆ sound_eg_LPCM

struct sound_eg_LPCM

Parameters for linear PCM (8-bit, 60Hz) envelope generator.

Definition at line 56 of file sound_eg.h.

Data Fields
uint8_t len number of sampled signal levels
uint8_t * data time series of the sampled signal levels (i.e.

wave form)

◆ sound_eg_attribute

struct sound_eg_attribute

Attributes of a software envelope generator object.

The attribute consists of the following two parts:

  1. an envelope generator class identifier clz
  2. a set of parameter constants param

The clz shall be one of the two classes:

  • SOUND_EG_AHDSR for AHDSR type envelope generator, or
  • SOUND_EG_LPCM for 8-bit 60Hz Linear PCM type envelope generator.

The param shall be a pointer to parameter constants, and it has the following two strictly typed sinonym:

  • ahdsr of const struct sound_eg_AHDSR * type for AHDSR type envelope generator.
  • lpcm of const struct sound_eg_LPCM * type for 8-bit 60Hz Linear PCM type envelope generator.

Definition at line 81 of file sound_eg.h.

Data Fields
uint8_t clz The class identifier of this envelope generator.
union sound_eg_attribute.__unnamed3__ __unnamed__

◆ sound_eg_attribute.__unnamed3__

union sound_eg_attribute.__unnamed3__

Definition at line 86 of file sound_eg.h.

Data Fields
void * param Pointer to parameter constants for this instance.
const struct sound_eg_AHDSR * ahdsr Pointer to parameter constants for this instance of the SOUND_EG_AHDSR class.

This is a strictly typed sinonym for param.

const struct sound_eg_LPCM * lpcm Pointer to parameter constants for this instance of the SOUND_EG_LPCM class.

This is a strictly typed sinonym for param.

Macro Definition Documentation

◆ SOUND_EG_TABLE_MAX

#define SOUND_EG_TABLE_MAX   (16)

The maximum number of elements for the envelope generator attribute table.

Definition at line 34 of file sound_eg.h.

◆ SOUND_EG_AHDSR

#define SOUND_EG_AHDSR   (0)

The class identifier for AHDSR envelope generator.

Definition at line 37 of file sound_eg.h.

◆ SOUND_EG_LPCM

#define SOUND_EG_LPCM   (1)

The class identifier for LPCM envelope generator.

Definition at line 39 of file sound_eg.h.

Function Documentation

◆ sound_set_eg_table()

void sound_set_eg_table ( const struct sound_eg_attribute table)

MSX (Re)set the software envelope generator attribute table.

This function sets the base address of the software envelope generator table to the given address table, or reset to the default if table was NULL.

The table should be an array of struct sound_eg_attribute with a maximum of 16 elements. Each element can contain the individual parameter settings of an envelope generator of type AHDSR or LPCM.

Parameters
tablebase address of the attribute table.