This repository has been archived by the owner on Jul 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
header.w
60 lines (49 loc) · 2.03 KB
/
header.w
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@* Header File.
|CTANGLE| will end up generating two files: a single C amalgamation and this
header file.
This header file exists for individuals who wish to use Voc in their own
programs. Voc follows Soundpipe's hardware-agnostic design, and should be
trivial to throw in any DSP inner loop.
The contents of the header is fairly minimal. Following a standard
header guard, the contents consist of:
\smallskip
\item{$\bullet$} a |typedef| around the opaque struct |sp_voc|
\item{$\bullet$} function declarations which adhere to the 4-stage
Soundpipe module lifecycle model.
\item{$\bullet$} a collection of setter/getter functions to allow to get and
set data from the opaque struct.
Since |Voc| makes use of opaque struct pointers, this header file will need
to declare setter/getter functions for any user parameters.
@(voc.h@>=
#ifndef SP_VOC
#define SP_VOC
typedef struct sp_voc sp_voc;
int sp_voc_create(sp_voc **voc);
int sp_voc_destroy(sp_voc **voc);
int sp_voc_init(sp_data *sp, sp_voc *voc);
int sp_voc_compute(sp_data *sp, sp_voc *voc, SPFLOAT *out);
int sp_voc_tract_compute(sp_data *sp, sp_voc *voc, SPFLOAT *in, SPFLOAT *out);
void sp_voc_set_frequency(sp_voc *voc, SPFLOAT freq);
SPFLOAT * sp_voc_get_frequency_ptr(sp_voc *voc);
SPFLOAT* sp_voc_get_tract_diameters(sp_voc *voc);
SPFLOAT* sp_voc_get_current_tract_diameters(sp_voc *voc);
int sp_voc_get_tract_size(sp_voc *voc);
SPFLOAT* sp_voc_get_nose_diameters(sp_voc *voc);
int sp_voc_get_nose_size(sp_voc *voc);
void sp_voc_set_tongue_shape(sp_voc *voc,
SPFLOAT tongue_index,
SPFLOAT tongue_diameter);
void sp_voc_set_glottis_enable(sp_voc *voc, int enable);
void sp_voc_set_tenseness(sp_voc *voc, SPFLOAT breathiness);
SPFLOAT * sp_voc_get_tenseness_ptr(sp_voc *voc);
void sp_voc_set_velum(sp_voc *voc, SPFLOAT velum);
SPFLOAT * sp_voc_get_velum_ptr(sp_voc *voc);
void sp_voc_set_diameters(sp_voc *voc,
int blade_start,
int lip_start,
int tip_start,
SPFLOAT tongue_index,
SPFLOAT tongue_diameter,
SPFLOAT *diameters);
int sp_voc_get_counter(sp_voc *voc);
#endif