+class proc_par : faust_exp -> process_type =
+ fun (exp_init : faust_exp) ->
+ object (self)
+ val _exp = exp_init
+ val _exp_left =
+ match exp_init with
+ | Par (e1, e2) -> e1
+ | _ -> raise (Process_error "par process constructor.")
+ val _exp_right =
+ match exp_init with
+ | Par (e1, e2) -> e2
+ | _ -> raise (Process_error "par process constructor.")
+
+ val proc_left = (new proc_factory)#make _exp_left
+ val proc_right = (new proc_factory)#make _exp_right
+
+ val _dim = (proc_left#dim)#par proc_right#dim
+ val _delay = max proc_left#delay proc_right#delay
+
+ method exp = _exp
+ method dim = _dim
+ method delay = _delay
+
+ method eval : beam_type -> beam_type =
+ fun (input : beam_type) ->
+ let (sub_input1, sub_input2) = input#cut proc_left#dim#input in
+ let sub_output1 = proc_left#eval sub_input1 in
+ let sub_output2 = proc_right#eval sub_input2 in
+ sub_output1#append sub_output2
+ end
+
+and proc_split : faust_exp -> process_type =
+ fun (exp_init : faust_exp) ->
+ object (self)
+ val _exp = exp_init
+ val _exp_left =
+ match exp_init with
+ | Split (e1, e2) -> e1
+ | _ -> raise (Process_error "par process constructor.")
+ val _exp_right =
+ match exp_init with
+ | Split (e1, e2) -> e2
+ | _ -> raise (Process_error "par process constructor.")
+
+ val proc_left = (new proc_factory)#make _exp_left
+ val proc_right = (new proc_factory)#make _exp_right
+
+ val _dim = (proc_left#dim)#split proc_right#dim
+ val _delay = proc_left#delay + proc_right#delay
+
+ method exp = _exp
+ method dim = _dim
+ method delay = _delay
+
+ method eval : beam_type -> beam_type =
+ fun (input : beam_type) ->
+ let mid_output = proc_left#eval input in
+ let mid_input = mid_output#matching proc_right#dim#input in
+ proc_right#eval mid_input
+ end
+
+
+and proc_merge : faust_exp -> process_type =
+ fun (exp_init : faust_exp) ->
+ object (self)
+ val _exp = exp_init
+ val _exp_left =
+ match exp_init with
+ | Merge (e1, e2) -> e1
+ | _ -> raise (Process_error "merge process constructor.")
+ val _exp_right =
+ match exp_init with
+ | Merge (e1, e2) -> e2
+ | _ -> raise (Process_error "merge process constructor.")
+
+ val proc_left = (new proc_factory)#make _exp_left
+ val proc_right = (new proc_factory)#make _exp_right
+
+ val _dim = (proc_left#dim)#merge proc_right#dim
+ val _delay = proc_left#delay + proc_right#delay
+
+ method exp = _exp
+ method dim = _dim
+ method delay = _delay
+
+ method eval : beam_type -> beam_type =
+ fun (input : beam_type) ->
+ let mid_output = proc_left#eval input in
+ let mid_input = mid_output#matching proc_right#dim#input in
+ proc_right#eval mid_input
+
+ end
+
+and proc_seq : faust_exp -> process_type =
+ fun (exp_init : faust_exp) ->
+ object (self)
+ val _exp = exp_init
+ val _exp_left =
+ match exp_init with
+ | Seq (e1, e2) -> e1
+ | _ -> raise (Process_error "seq process constructor.")
+ val _exp_right =
+ match exp_init with
+ | Seq (e1, e2) -> e2
+ | _ -> raise (Process_error "seq process constructor.")
+
+ val proc_left = (new proc_factory)#make _exp_left
+ val proc_right = (new proc_factory)#make _exp_right
+
+ val _dim = (proc_left#dim)#seq proc_right#dim
+ val _delay = proc_left#delay + proc_right#delay
+
+ method exp = _exp
+ method dim = _dim
+ method delay = _delay
+
+ method eval : beam_type -> beam_type =
+ fun (input : beam_type) ->
+ let mid_output = proc_left#eval input in
+ proc_right#eval mid_output
+ end
+
+and proc_rec : faust_exp -> process_type =
+ fun (exp_init : faust_exp) ->
+ object (self)
+ val _exp = exp_init
+ val _exp_left =
+ match exp_init with
+ | Rec (e1, e2) -> e1
+ | _ -> raise (Process_error "rec process constructor.")
+ val _exp_right =
+ match exp_init with
+ | Rec (e1, e2) -> e2
+ | _ -> raise (Process_error "rec process constructor.")
+
+ val proc_left = (new proc_factory)#make _exp_left
+ val proc_right = (new proc_factory)#make _exp_right
+
+ val _dim = (proc_left#dim)#_rec proc_right#dim
+ val _delay = proc_left#delay
+
+ method exp = _exp
+ method dim = _dim
+ method delay = _delay
+
+ method eval : beam_type -> beam_type =
+ fun (input : beam_type) ->
+ let mid_output = proc_left#eval input in
+ proc_right#eval mid_output
+