Refactoring faustine in beam.ml -> method output.
[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 to_string : string
26 method normalize : unit
27 method add : value_type -> value_type
28 method neg : value_type
29 method sub : value_type -> value_type
30 method mul : value_type -> value_type
31 method recip : value_type
32 method div : value_type -> value_type
33 method zero : value_type
34 method floor : value_type
35 method int : value_type
36 method sin : value_type
37 method cos : value_type
38 method atan : value_type
39 method sqrt : value_type
40 method atan2 : value_type -> value_type
41 method _mod : value_type -> value_type
42 method larger : value_type -> value_type
43 method smaller : value_type -> value_type
44 end;;
45
46
47 type symbol = Add
48 | Sup
49 | Mul
50 | Div
51 | Pass
52 | Stop
53 | Mem
54 | Delay
55 | Floor
56 | Int
57 | Sin
58 | Cos
59 | Atan
60 | Atantwo
61 | Sqrt
62 | Rdtable
63 | Mod
64 | Vectorize
65 | Vconcat
66 | Vpick
67 | Serialize
68 | Larger
69 | Smaller
70 | Prefix
71 | Selecttwo
72 | Selectthree
73
74
75 type faust_exp =
76 Const of basic
77 | Ident of symbol
78 | Par of faust_exp * faust_exp
79 | Seq of faust_exp * faust_exp
80 | Rec of faust_exp * faust_exp
81 | Split of faust_exp * faust_exp
82 | Merge of faust_exp * faust_exp
83
84
85 class type signal_type =
86 object
87 method frequency : int
88 method at : time -> value_type
89 method add_memory : int -> unit
90 method add : signal_type -> signal_type
91 method neg : signal_type
92 method sub : signal_type -> signal_type
93 method mul : signal_type -> signal_type
94 method div : signal_type -> signal_type
95 method delay : signal_type -> signal_type
96 method mem : signal_type
97 method vectorize : signal_type -> signal_type
98 method serialize : signal_type
99 method vconcat : signal_type -> signal_type
100 method vpick : signal_type -> signal_type
101 method floor : signal_type
102 method int : signal_type
103 method sin : signal_type
104 method cos : signal_type
105 method atan : signal_type
106 method atan2 : signal_type -> signal_type
107 method sqrt : signal_type
108 method _mod : signal_type -> signal_type
109 method larger : signal_type -> signal_type
110 method smaller : signal_type -> signal_type
111 method rdtable : signal_type -> signal_type -> signal_type
112 method select2 : signal_type -> signal_type -> signal_type
113 method select3 : signal_type -> signal_type -> signal_type -> signal_type
114 method prefix : signal_type -> signal_type
115 end;;
116
117
118 class type beam_type =
119 object
120 method get : signal_type array
121 method length : int
122 method sub : int -> int -> beam_type
123 method append : beam_type -> beam_type
124 method matching : int -> beam_type
125 method time : time -> value_type array
126 method output : int -> (int list) * (float array list)
127 end;;
128
129
130 class type dimension_type =
131 object
132 method input : int
133 method output : int
134 end;;
135
136
137 class type expression_type =
138 object
139 method get_exp : faust_exp
140 method get_dim : dimension_type
141 method get_delay : int
142 method to_string : string
143 method evaluate : beam_type -> beam_type
144 end;;