let write_output_wave = fun channel_int_list -> fun rate_int_list -> fun data_float_array_list ->
let () = print_endline("Making output wave files...") in
let n_output = List.length data_float_array_list in
let n_array = Array.init n_output (fun n -> n) in
let make_file_name i = "output" ^ (string_of_int i) ^ ".wav" in
let make_chemin s = io_macro_to_string Output_Route_string ^ s in
let file_name_string_array = Array.map make_file_name n_array in
let file_chemin_string_array = Array.map make_chemin file_name_string_array in
let file_chemin_string_list = Array.to_list file_chemin_string_array in
let file_format = Sndfile.format Sndfile.MAJOR_WAV Sndfile.MINOR_PCM_16 in
let openwr = fun file_chemin_string -> fun channel -> fun rate ->
Sndfile.openfile ~info:(Sndfile.RDWR, file_format, channel, rate) file_chemin_string in
let openwr_fun_list = fun fl -> fun cl -> fun rl -> fun i ->
openwr (List.nth fl i) (List.nth cl i) (List.nth rl i) in
let output_file_list = List.map
(openwr_fun_list file_chemin_string_list channel_int_list rate_int_list)
(Array.to_list (Array.init n_output (fun n -> n))) in
let _ = List.map2 Sndfile.write output_file_list data_float_array_list in
let _ = List.map Sndfile.close output_file_list in
print_endline("Success.")