libmsx
C library for MSX
Loading...
Searching...
No Matches
sound_eg.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
18#pragma once
19
20#ifndef SOUND_EG_H
21#define SOUND_EG_H
22
23#include <stdbool.h>
24#include <stdint.h>
25
34#define SOUND_EG_TABLE_MAX (16)
35
37#define SOUND_EG_AHDSR (0)
39#define SOUND_EG_LPCM (1)
40
44 uint8_t attack_rate;
46 uint8_t hold_time;
48 uint8_t decay_rate;
52 uint8_t release_rate;
53};
54
58 uint8_t len;
60 uint8_t * data;
61};
62
85 uint8_t clz;
86 union {
90 void * param;
97 const struct sound_eg_AHDSR * ahdsr;
104 const struct sound_eg_LPCM * lpcm;
105 };
106};
107
120void sound_set_eg_table(const struct sound_eg_attribute * table);
121
124#endif
uint8_t hold_time
Period of hold phase.
Definition sound_eg.h:46
uint8_t decay_rate
Deccendant velocity of decay phase.
Definition sound_eg.h:48
uint8_t attack_rate
Asccendant velocity of attack phase.
Definition sound_eg.h:44
uint8_t * data
time series of the sampled signal levels (i.e.
Definition sound_eg.h:60
uint8_t release_rate
desccendant velocity of release phase
Definition sound_eg.h:52
uint8_t len
number of sampled signal levels
Definition sound_eg.h:58
uint8_t sustain_level
Output level of sustain phase.
Definition sound_eg.h:50
uint8_t clz
The class identifier of this envelope generator.
Definition sound_eg.h:85
void sound_set_eg_table(const struct sound_eg_attribute *table)
MSX (Re)set the software envelope generator attribute table.
Parameters for AHDSR envelope generator.
Definition sound_eg.h:42
Parameters for linear PCM (8-bit, 60Hz) envelope generator.
Definition sound_eg.h:56
Attributes of a software envelope generator object.
Definition sound_eg.h:81