1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <link rel=
"stylesheet" href=
"style.css" type=
"text/css">
5 <meta content=
"text/html; charset=iso-8859-1" http-equiv=
"Content-Type">
6 <link rel=
"Start" href=
"index.html">
7 <link rel=
"previous" href=
"Faustexp.html">
8 <link rel=
"next" href=
"Preprocess.html">
9 <link rel=
"Up" href=
"index.html">
10 <link title=
"Index of types" rel=Appendix
href=
"index_types.html">
11 <link title=
"Index of exceptions" rel=Appendix
href=
"index_exceptions.html">
12 <link title=
"Index of values" rel=Appendix
href=
"index_values.html">
13 <link title=
"Index of modules" rel=Appendix
href=
"index_modules.html">
14 <link title=
"Types" rel=
"Chapter" href=
"Types.html">
15 <link title=
"Parser" rel=
"Chapter" href=
"Parser.html">
16 <link title=
"Lexer" rel=
"Chapter" href=
"Lexer.html">
17 <link title=
"Value" rel=
"Chapter" href=
"Value.html">
18 <link title=
"Signal" rel=
"Chapter" href=
"Signal.html">
19 <link title=
"Faustexp" rel=
"Chapter" href=
"Faustexp.html">
20 <link title=
"Interpreter" rel=
"Chapter" href=
"Interpreter.html">
21 <link title=
"Preprocess" rel=
"Chapter" href=
"Preprocess.html">
22 <link title=
"Main" rel=
"Chapter" href=
"Main.html"><title>Interpreter
</title>
25 <div class=
"navbar"><a href=
"Faustexp.html">Previous
</a>
26 <a href=
"index.html">Up
</a>
27 <a href=
"Preprocess.html">Next
</a>
29 <center><h1>Module
<a href=
"type_Interpreter.html">Interpreter
</a></h1></center>
31 <pre><span class=
"keyword">module
</span> Interpreter:
<code class=
"code">sig
</code> <a href=
"Interpreter.html">..
</a> <code class=
"code">end
</code></pre>Module: Interpreter
32 Description: input beam -
> process -
> output beam
<br>
33 <b>Author(s):
</b> WANG Haisheng
34 Created:
15/
05/
2013 Modified:
04/
06/
2013<br>
36 <pre><span id=
"EXCEPTIONEvaluation_Error"><span class=
"keyword">exception
</span> Evaluation_Error
</span> <span class=
"keyword">of
</span> <code class=
"type">string
</code></pre>
38 Exception raised during interpretation of faust process.
<br>
40 <br><code><span id=
"TYPEinterpreter_macro"><span class=
"keyword">type
</span> <code class=
"type"></code>interpreter_macro
</span> =
</code><table class=
"typetable">
42 <td align=
"left" valign=
"top" >
43 <code><span class=
"keyword">|
</span></code></td>
44 <td align=
"left" valign=
"top" >
45 <code><span class=
"constructor">Number_samples_int
</span></code></td>
49 <td align=
"left" valign=
"top" >
50 <code><span class=
"keyword">|
</span></code></td>
51 <td align=
"left" valign=
"top" >
52 <code><span class=
"constructor">Max_Eval_Time_int
</span></code></td>
57 Macro constants of this file.
<br>
60 <pre><span id=
"VALinterpreter_macro_to_value"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.interpreter_macro_to_value.html">interpreter_macro_to_value
</a></span> :
<code class=
"type"><a href=
"Interpreter.html#TYPEinterpreter_macro">interpreter_macro
</a> -
> int
</code></pre><div class=
"info">
61 val interpreter_macro_to_value : returns the value associated with the macro.
<br>
63 <pre><span id=
"VALfun_array_to_fun"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.fun_array_to_fun.html">fun_array_to_fun
</a></span> :
<code class=
"type">('a -
> 'b) array -
> 'a -
> 'b array
</code></pre><div class=
"info">
64 val func_of_func_array : (int -
> value) array -
> (int -
> value array),
65 applies the same int parameter to each element of function array,
66 produces a value array.
<br>
68 <pre><span id=
"VALcomputing"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.computing.html">computing
</a></span> :
<code class=
"type">(int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a> array) -
> int -
> int -
> float array array array
</code></pre><div class=
"info">
69 val computing : (int -
> value array) -
> int -
> int -
> float array array array,
70 applies time sequence
"0,1,2,3,...,max" to signal beam,
71 returns primitive output data.
<br>
73 <pre><span id=
"VALmatrix_transpose"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.matrix_transpose.html">matrix_transpose
</a></span> :
<code class=
"type">'a array array -
> int -
> 'a array array
</code></pre><div class=
"info">
74 val matrix_transpose : 'a array array -
> 'a array array,
75 transposes the input matrix.
<br>
77 <pre><span id=
"VALchannels"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.channels.html">channels
</a></span> :
<code class=
"type">'a array array array -
> int -
> int array
</code></pre><div class=
"info">
78 val channels : 'a array array array -
> int -
> int array,
79 returns an array of number of channels.
<br>
81 <pre><span id=
"VALarrange"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.arrange.html">arrange
</a></span> :
<code class=
"type">'a array array array -
> int -
> 'a array list
</code></pre><div class=
"info">
82 val arrange : 'a array array array -
> int -
> 'a array list,
83 arranges the output data in
"array list" form.
<br>
85 <pre><span id=
"VALcompute"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.compute.html">compute
</a></span> :
<code class=
"type">(int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>) list -
> int list * float array list
</code></pre><div class=
"info">
86 val compute : (int -
> value) list -
> (int list) * (float array list).
87 input: a list of signal functions
88 output: channel number list, data list.
<br>
90 <pre><span id=
"VALsublist"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.sublist.html">sublist
</a></span> :
<code class=
"type">'a list -
> int -
> int -
> 'a list
</code></pre><div class=
"info">
91 val sublist : 'a list -
> int -
> int -
> 'a list,
92 <code class=
"code">sublist l start length
</code>, returns the sublist of list 'l',
93 from index 'start', with length 'length'.
<br>
95 <pre><span id=
"VALmake_beam"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.make_beam.html">make_beam
</a></span> :
<code class=
"type">'a list * float array list -
> ('a * (int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>)) list
</code></pre><div class=
"info">
96 val make_beam : (int list) * (float array list) -
> (int * (int -
> value)) list,
97 input: (sample rate list, data list)
98 output: beam = (sample rate, function) list
<br>
100 <pre><span id=
"VALinterpret_const"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.interpret_const.html">interpret_const
</a></span> :
<code class=
"type">'a -
> 'b list -
> (int * ('c -
> 'a)) list
</code></pre><div class=
"info">
101 val interpret_const : value -
> beam -
> beam, generates constant signal with frequency
0.
<br>
103 <pre><span id=
"VALinterpret_ident"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.interpret_ident.html">interpret_ident
</a></span> :
<code class=
"type"><a href=
"Types.html#TYPEsymbol">Types.symbol
</a> -
><br> (int * (int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>)) list -
> (int * (int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>)) list
</code></pre><div class=
"info">
104 val interpret_ident : string -
> beam -
> beam,
105 generates signals according to identified symbols.
<br>
107 <pre><span id=
"VALeval"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.eval.html">eval
</a></span> :
<code class=
"type"><a href=
"Types.html#TYPEfaust_exp">Types.faust_exp
</a> -
><br> <a href=
"Types.html#TYPEdimension">Types.dimension
</a> -
><br> (int * (int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>)) list -
> (int * (int -
> <a href=
"Types.html#TYPEvalue">Types.value
</a>)) list
</code></pre><div class=
"info">
108 val rec eval : faust_exp -
> beam -
> beam,
109 main interpretation work is done here.
<br>
111 <pre><span id=
"VALextract_rate"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.extract_rate.html">extract_rate
</a></span> :
<code class=
"type">(int * 'a) list -
> int list
</code></pre><div class=
"info">
112 val extract_rate : (int * (int -
> value)) list -
> int list,
113 gets the sample rate list from beam.
<br>
115 <pre><span id=
"VALinterpreter"><span class=
"keyword">val
</span> <a href=
"code_VALInterpreter.interpreter.html">interpreter
</a></span> :
<code class=
"type"><a href=
"Types.html#TYPEfaust_exp">Types.faust_exp
</a> -
><br> int list * float array list -
> int list * int list * float array list
</code></pre><div class=
"info">
116 val interpreter : faust_exp -
> (int list) * (float array list) -
>
117 (int list) * (int list) * (float array list)
118 input: faust expression, sample rate list * input data list
119 output: channel list * sample rate list * output data list.
<br>