synththing/src/utils/envelope.h

36 lines
667 B
C

/*
* Filename: envelope.h
*
* Description:
*
*
* Version:
* Created: Wed Oct 30 17:15:02 2019
* Revision: None
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
*
*/
#ifndef _H_ENVELOPE
#define _H_ENVELOPE
#include <stdbool.h>
#include "../common.h"
typedef struct Envelope {
// these values are in samples.
unsigned int attack;
unsigned int decay;
unsigned int release;
float sustain_level;
float max_level;
float min_level;
bool gate;
float(*process)(struct Envelope *, EngineState *);
} Envelope;
float envelope_process(Envelope *self, EngineState *t);
Envelope* envelope_new();
#endif