New directory tree, with preprocessor/ inside interpretor/.
[Faustine.git] / interpretor / types.ml
1
2 type index = int;;
3
4 type time = int;;
5
6 type basic = N of int
7 | R of float
8 | Vec of vector
9 | Zero
10 | Error
11 and vector = < size : int; nth : (index -> basic) >;;
12
13 class type vector_type =
14 object
15 method size : int
16 method nth : index -> basic
17 end;;
18
19 class type value_type =
20 object
21 method get : basic
22 method to_int : int
23 method to_float : float
24 method to_float_array : float array
25 method of_float_array : float array -> value_type
26 method to_string : string
27 method normalize : unit
28 method add : value_type -> value_type
29 method neg : value_type
30 method sub : value_type -> value_type
31 method mul : value_type -> value_type
32 method recip : value_type
33 method div : value_type -> value_type
34 method zero : value_type
35 method floor : value_type
36 method int : value_type
37 method sin : value_type
38 method cos : value_type
39 method atan : value_type
40 method sqrt : value_type
41 method atan2 : value_type -> value_type
42 method _mod : value_type -> value_type
43 method larger : value_type -> value_type
44 method smaller : value_type -> value_type
45 method max : value_type -> value_type
46 method min : value_type -> value_type
47 end;;
48
49
50 type symbol = Add
51 | Sub
52 | Mul
53 | Div
54 | Pass
55 | Stop
56 | Mem
57 | Delay
58 | Floor
59 | Int
60 | Sin
61 | Cos
62 | Atan
63 | Atan2
64 | Sqrt
65 | Rdtable
66 | Mod
67 | Vectorize
68 | Vconcat
69 | Vpick
70 | Serialize
71 | Larger
72 | Smaller
73 | Max
74 | Min
75 | Prefix
76 | Select2
77 | Select3
78
79
80 type faust_exp =
81 Const of basic
82 | Ident of symbol
83 | Par of faust_exp * faust_exp
84 | Seq of faust_exp * faust_exp
85 | Rec of faust_exp * faust_exp
86 | Split of faust_exp * faust_exp
87 | Merge of faust_exp * faust_exp
88
89
90 class type signal_type =
91 object
92 method frequency : int
93 method at : time -> value_type
94 method add_memory : int -> unit
95 method add : signal_type -> signal_type
96 method neg : signal_type
97 method sub : signal_type -> signal_type
98 method mul : signal_type -> signal_type
99 method div : signal_type -> signal_type
100 method delay : signal_type -> signal_type
101 method mem : signal_type
102 method vectorize : signal_type -> signal_type
103 method serialize : signal_type
104 method vconcat : signal_type -> signal_type
105 method vpick : signal_type -> signal_type
106 method floor : signal_type
107 method int : signal_type
108 method sin : signal_type
109 method cos : signal_type
110 method atan : signal_type
111 method atan2 : signal_type -> signal_type
112 method sqrt : signal_type
113 method _mod : signal_type -> signal_type
114 method larger : signal_type -> signal_type
115 method smaller : signal_type -> signal_type
116 method max : signal_type -> signal_type
117 method min : signal_type -> signal_type
118 method rdtable : signal_type -> signal_type -> signal_type
119 method select2 : signal_type -> signal_type -> signal_type
120 method select3 : signal_type -> signal_type -> signal_type -> signal_type
121 method prefix : signal_type -> signal_type
122 end;;
123
124
125 class type beam_type =
126 object
127 method get : signal_type array
128 method width : int
129 method sub : int -> int -> beam_type
130 method cut : int -> beam_type * beam_type
131 method append : beam_type -> beam_type
132 method matching : int -> beam_type
133 method at : time -> value_type array
134 method output : int -> float array array array
135 method frequency : int array
136 end;;
137
138
139 class type dimension_type =
140 object
141 method input : int
142 method output : int
143 method par : dimension_type -> dimension_type
144 method seq : dimension_type -> dimension_type
145 method split : dimension_type -> dimension_type
146 method merge : dimension_type -> dimension_type
147 method _rec : dimension_type -> dimension_type
148 end;;
149
150
151 class type process_type =
152 object
153 method exp : faust_exp
154 method dim : dimension_type
155 method delay : int
156 method eval : beam_type -> beam_type
157 end;;
158
159
160 class type io_type =
161 object
162 method set : string -> string -> unit
163 method read : string array -> beam_type
164 method write : int array -> float array array array -> string array
165 end;;