Commit 898141d6 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix all compiler errors other than non-existant Buffer type

parent 20eefcc1
......@@ -59,6 +59,11 @@ void stk_ADSR_init(t_stk_ADSR *x)
x->sampleRate = 44100;
}
t_env_state stk_ADSR_getState(t_stk_ADSR *x)
{
return x->state;
}
void stk_ADSR_sampleRateChanged(t_stk_ADSR *x, t_float newRate,
t_float oldRate)
{
......@@ -67,7 +72,7 @@ void stk_ADSR_sampleRateChanged(t_stk_ADSR *x, t_float newRate,
x->releaseRate = oldRate * x->releaseRate / newRate;
}
void stkADSR_setSampleRate(t_stk_ADSR *x, t_float newRate)
void stk_ADSR_setSampleRate(t_stk_ADSR *x, t_float newRate)
{
x->sampleRate = newRate;
}
......
......@@ -16,13 +16,13 @@
*/
/***************************************************/
/* ADSR envelope states.
/* ADSR envelope states. */
typedef enum {
ATTACK, /*!< Attack */
DECAY, /*!< Decay */
SUSTAIN, /*!< Sustain */
RELEASE, /*!< Release */
IDLE /*!< Before attack / after release */
ATTACK, /* Attack */
DECAY, /* Decay */
SUSTAIN, /* Sustain */
RELEASE, /* Release */
IDLE /* Before attack / after release */
} t_env_state;
typedef struct _stk_ADSR {
......@@ -38,6 +38,12 @@ typedef struct _stk_ADSR {
t_float sampleRate;
} t_stk_ADSR;
/* initialize the struct members to sane values */
void stk_ADSR_init(t_stk_ADSR *x);
/* set the sample rate */
void stk_ADSR_setSampleRate(t_stk_ADSR *x, t_float newRate);
/* Set target = 1, state = ATTACK. */
void stk_ADSR_keyOn(t_stk_ADSR *x);
......@@ -60,7 +66,7 @@ void stk_ADSR_setSustainLevel(t_stk_ADSR *x, t_float level);
void stk_ADSR_setReleaseRate(t_stk_ADSR *x, t_float rate);
/* Set the attack rate based on a time duration (seconds). */
void stk_ADSR_setAttackTime(t_stk_float *x, t_float time);
void stk_ADSR_setAttackTime(t_stk_ADSR *x, t_float time);
/* Set the decay rate based on a time duration (seconds). */
void stk_ADSR_setDecayTime(t_stk_ADSR *x, t_float time);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment