-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfm-phase.h
28 lines (20 loc) · 899 Bytes
/
fm-phase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef FM_PHASE_H
#define FM_PHASE_H
#include "clowncommon/clowncommon.h"
typedef struct FM_Phase_State
{
cc_u32l position;
cc_u32l step;
cc_u16l f_number_and_block;
cc_u16l key_code;
cc_u16l detune;
cc_u16l multiplier;
} FM_Phase_State;
void FM_Phase_State_Initialise(FM_Phase_State *phase);
#define FM_Phase_GetKeyCode(phase) ((phase)->key_code)
void FM_Phase_SetFrequency(FM_Phase_State *phase, cc_u8f modulation, cc_u8f sensitivity, cc_u16f f_number_and_block);
void FM_Phase_SetDetuneAndMultiplier(FM_Phase_State *phase, cc_u8f modulation, cc_u8f sensitivity, cc_u16f detune, cc_u16f multiplier);
void FM_Phase_SetModulationAndSensitivity(FM_Phase_State *phase, cc_u8f modulation, cc_u8f sensitivity);
#define FM_Phase_Reset(phase) ((phase)->position = 0)
#define FM_Phase_Increment(phase) ((phase)->position += (phase)->step)
#endif /* FM_PHASE_H */