X-Git-Url: https://scm.cri.mines-paristech.fr/git/Faustine.git/blobdiff_plain/0a259beff10a55b87cdbd1a836f4c01162fdd73d..992d59159547267e1491fcd1c5123765b4c452b8:/interpretor/process.ml?ds=inline diff --git a/interpretor/process.ml b/interpretor/process.ml index e7568df..ba13961 100644 --- a/interpretor/process.ml +++ b/interpretor/process.ml @@ -89,7 +89,8 @@ class proc_const : faust_exp -> process_type = method eval : beam_type -> beam_type = fun (input : beam_type) -> if input#get = [||] then - new beam [| new signal 0 (fun t -> new value self#const)|] + new beam [| new signal (new rate 0 1) + (fun t -> new value self#const)|] else raise (Process_error "proc_const accepts no input.") end;; @@ -130,28 +131,58 @@ class proc_ident : faust_exp -> process_type = ((input#get.(0))#mul input#get.(1)) | Div -> self#beam_of_ident n ((input#get.(0))#div input#get.(1)) + | Power -> self#beam_of_ident n + ((input#get.(0))#power input#get.(1)) + | And -> self#beam_of_ident n + ((input#get.(0))#_and input#get.(1)) + | Or -> self#beam_of_ident n + ((input#get.(0))#_or input#get.(1)) + | Xor -> self#beam_of_ident n + ((input#get.(0))#_xor input#get.(1)) | Mem -> self#beam_of_ident n ((input#get.(0))#mem) | Delay -> self#beam_of_ident n ((input#get.(0))#delay input#get.(1)) | Floor -> self#beam_of_ident n ((input#get.(0))#floor) + | Ceil -> self#beam_of_ident n + ((input#get.(0))#ceil) + | Rint -> self#beam_of_ident n + ((input#get.(0))#rint) | Int -> self#beam_of_ident n ((input#get.(0))#int) + | Float -> self#beam_of_ident n + ((input#get.(0))#float) | Sin -> self#beam_of_ident n ((input#get.(0))#sin) + | Asin -> self#beam_of_ident n + ((input#get.(0))#asin) | Cos -> self#beam_of_ident n ((input#get.(0))#cos) + | Acos -> self#beam_of_ident n + ((input#get.(0))#acos) + | Tan -> self#beam_of_ident n + ((input#get.(0))#tan) | Atan -> self#beam_of_ident n ((input#get.(0))#atan) | Atan2 -> self#beam_of_ident n ((input#get.(0))#atan2 input#get.(1)) + | Exp -> self#beam_of_ident n + ((input#get.(0))#exp) | Sqrt -> self#beam_of_ident n ((input#get.(0))#sqrt) - | Rdtable -> self#beam_of_ident n - ((input#get.(1))#rdtable input#get.(0) input#get.(2)) + | Ln -> self#beam_of_ident n + ((input#get.(0))#ln) + | Lg -> self#beam_of_ident n + ((input#get.(0))#lg) + | Abs -> self#beam_of_ident n + ((input#get.(0))#abs) | Mod -> self#beam_of_ident n ((input#get.(0))#_mod input#get.(1)) + | Fmod -> self#beam_of_ident n + ((input#get.(0))#fmod input#get.(1)) + | Remainder -> self#beam_of_ident n + ((input#get.(0))#remainder input#get.(1)) | Vectorize -> self#beam_of_ident n ((input#get.(0))#vectorize input#get.(1)) | Vconcat -> self#beam_of_ident n @@ -160,14 +191,26 @@ class proc_ident : faust_exp -> process_type = ((input#get.(0))#vpick input#get.(1)) | Serialize -> self#beam_of_ident n (input#get.(0))#serialize - | Larger -> self#beam_of_ident n - ((input#get.(0))#larger input#get.(1)) - | Smaller -> self#beam_of_ident n - ((input#get.(0))#smaller input#get.(1)) + | Gt -> self#beam_of_ident n + ((input#get.(0))#gt input#get.(1)) + | Lt -> self#beam_of_ident n + ((input#get.(0))#lt input#get.(1)) + | Geq -> self#beam_of_ident n + ((input#get.(0))#geq input#get.(1)) + | Leq -> self#beam_of_ident n + ((input#get.(0))#leq input#get.(1)) + | Eq -> self#beam_of_ident n + ((input#get.(0))#eq input#get.(1)) + | Neq -> self#beam_of_ident n + ((input#get.(0))#neq input#get.(1)) | Max -> self#beam_of_ident n ((input#get.(0))#max input#get.(1)) | Min -> self#beam_of_ident n ((input#get.(0))#min input#get.(1)) + | Shl -> self#beam_of_ident n + ((input#get.(0))#shl input#get.(1)) + | Shr -> self#beam_of_ident n + ((input#get.(0))#shr input#get.(1)) | Prefix -> self#beam_of_ident n ((input#get.(1))#prefix input#get.(0)) | Select2 -> self#beam_of_ident n @@ -175,6 +218,11 @@ class proc_ident : faust_exp -> process_type = | Select3 -> self#beam_of_ident n ((input#get.(0))#select3 input#get.(1) input#get.(2) input#get.(3)) + | Rdtable -> self#beam_of_ident n + ((input#get.(1))#rdtable input#get.(0) input#get.(2)) + | Rwtable -> self#beam_of_ident n + ((input#get.(0))#rwtable input#get.(1) + input#get.(2) input#get.(3) input#get.(4)) end;; class virtual process_binary = @@ -265,7 +313,7 @@ and proc_rec : faust_exp -> process_type = method eval : beam_type -> beam_type = fun (input : beam_type) -> let memory = Hashtbl.create self#delay in - let rates = ref (Array.make self#dim#output 0) in + let rates = ref (Array.make self#dim#output (new rate 0 1)) in let split : (time -> value_type array) -> (time -> value_type) array = fun beam_at ->