X-Git-Url: https://svn.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/66f23d4fabf89ad09adbd4dfc15ac6b5b2b7da83..912dbfbf1eb4809f28e4e3a8bdfe76c47e018259:/interpreter/main.ml diff --git a/interpreter/main.ml b/interpreter/main.ml index 21c2a8e..54c7f1a 100644 --- a/interpreter/main.ml +++ b/interpreter/main.ml @@ -13,7 +13,7 @@ exception Missing_Expression;; let version = "Faustine: 0.0.1";; -let set_GC () = + let set_GC () = let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 0xFFFFFF } in let _ = Gc.set { (Gc.get()) @@ -37,15 +37,15 @@ let format_output = ref "wav";; let basename_output = ref "output";; let option_usage = "usage: " ^ Sys.argv.(0) - ^ " [-d dsp_src] [-i input] [-t time] [--odir dir] [--oformat wav/csv] [--obasename name]";; + ^ " [-f dsp_src] [-i input] [-l length] [--odir dir] [--oformat wav/csv] [--obasename name]";; let option_unknown = fun x -> raise (Arg.Bad ("Bad argument : " ^ x)) let speclist = [ - ("-d", Arg.String (fun s -> path_dsp := s), ": set dsp source file"); + ("-f", Arg.String (fun s -> path_dsp := s), ": faust .dsp source file"); ("-i", Arg.String (fun s -> incr size_input; inputs := !inputs @ [s]), ": set input wave file"); - ("-t", Arg.Int (fun i -> time_max := i), ": set max output length"); + ("-l", Arg.Int (fun i -> time_max := i), ": maximun number of output samples"); ("--odir", Arg.String (fun s -> dir_output := s), ": set output directory"); ("--oformat", Arg.String (fun s -> format_output := s), ": set output format"); ("--obasename", Arg.String (fun s -> basename_output := s), ": set output basename"); @@ -53,7 +53,12 @@ let speclist = [ let main () = - +(* + let () = print_endline (Scanf.Scanning.name_of_input (Scanf.Scanning.stdin)) in + let () = print_endline (Unix.readlink "/proc/self/fd/0") in + let () = print_endline (Unix.readlink "/proc/self/fd/1") in + let () = print_endline (Unix.readlink "/proc/self/fd/2") in +*) let () = Arg.parse speclist option_unknown option_usage in let _ = Sys.signal Sys.sigalrm Sys.Signal_ignore in let _ = set_GC () in @@ -62,46 +67,46 @@ let main () = let () = print_string(" Faustine -> Reading input ...") in - let tic0 = Sys.time () in + let tic0 = Unix.time () in let input = io#read !inputs in - let toc0 = Sys.time () in + let toc0 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc0 -. tic0)) ^ "s.)") in let () = print_string(" Faustine -> Preprocessing...") in - let tic1 = Sys.time () in + let tic1 = Unix.time () in let faust_core = Preprocess.preprocess !path_dsp in - let toc1 = Sys.time () in + let toc1 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc1 -. tic1)) ^ "s.)") in let () = print_string(" Faustine -> Constructing process...") in - let tic2 = Sys.time () in + let tic2 = Unix.time () in let faust_exp = exp_of_string faust_core in let proc = (new proc_factory)#make faust_exp in - let toc2 = Sys.time () in + let toc2 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc2 -. tic2)) ^ "s.)") in - let () = print_string(" Faustine -> Evaluating...") in - let tic3 = Sys.time () in + let () = print_string(" Faustine -> Constructing signals...") in + let tic3 = Unix.time () in let output = proc#eval input in - let toc3 = Sys.time () in + let toc3 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc3 -. tic3)) ^ "s.)") in - let () = print_string(" Faustine -> Calculating...") in - let tic4 = Sys.time () in + let () = print_string(" Faustine -> Evaluating...") in + let tic4 = Unix.time () in let data = output#output !time_max in let rates = output#frequency in - let toc4 = Sys.time () in + let toc4 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc4 -. tic4)) ^ "s.)") in let () = print_string(" Faustine -> Writing output...") in - let tic5 = Sys.time () in + let tic5 = Unix.time () in let output_paths = io#write rates data in - let toc5 = Sys.time () in + let toc5 = Unix.time () in let () = print_endline(" Done. (duration: " ^ (string_of_float (toc5 -. tic5)) ^ "s.)") in let _ = Array.map print_endline