From: WANG Date: Thu, 5 Sep 2013 13:56:33 +0000 (+0200) Subject: Add rate_type in interpreter/types.ml. X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/commitdiff_plain/e4c4706aa217ba2c8fca216860764ad5ef7d740a?ds=sidebyside;hp=8689b48b5ce6b24b36c16889e84f439823cabdc1 Add rate_type in interpreter/types.ml. --- diff --git a/architecture/morpho.lib b/architecture/morpho.lib index 6741f36..fc24c6a 100644 --- a/architecture/morpho.lib +++ b/architecture/morpho.lib @@ -58,10 +58,10 @@ licenceplate(x, y, o1, c2, t3, t4, t5, t6, o7, o8, d9) = _ <: (opening_line(x, y //licenceplate(x, y) = _ <: (opening_line(x, y, 4), closing_line(x, y, 2) : threshold(x, 1, 50), threshold(x, 150, 255) : and : opening_column(x, y, 4) : opening_line(x, y, 4) : dilations_square(x, y, 4)), _ : and; -//process = dilations(8, 8, 3); +//process = dilations_line(8, 8, 3); //process = erosions(8, 8, 3); //process = open(8, 8, 2); //process = close(8, 8, 5); -//process = licenceplate(4, 4, 15, 8, 1, 50, 150, 255, 4, 4, 2); +//process = licenceplate(100, 50, 15, 8, 1, 50, 150, 255, 4, 4, 2); diff --git a/examples/dilation/dilation.dsp b/examples/dilation/dilation.dsp index d81f458..42b9181 100644 --- a/examples/dilation/dilation.dsp +++ b/examples/dilation/dilation.dsp @@ -1,3 +1,3 @@ -import ("../../architecture/morph.lib"); +import ("../../architecture/morpho.lib"); -process = dilations(112, 150, 2); +process = dilations_square(112, 150, 2); diff --git a/examples/dilation/dilation.sh b/examples/dilation/dilation.sh index 01c29c0..5eed92b 100644 --- a/examples/dilation/dilation.sh +++ b/examples/dilation/dilation.sh @@ -1 +1 @@ -../../interpretor/faustine -d dilation.dsp -i letter_j.csv --oformat csv +../../interpretor/faustine -d dilation.dsp -i letter_j.csv -t 150 --oformat csv diff --git a/examples/licenseplate/licenceplate.dsp b/examples/licenseplate/licenceplate.dsp index 4ade83c..2d230c3 100644 --- a/examples/licenseplate/licenceplate.dsp +++ b/examples/licenseplate/licenceplate.dsp @@ -1,6 +1,6 @@ import ("../../architecture/morpho.lib"); -process = licenceplate(640, 383, 15, 8, 1, 50, 150, 255, 4, 4, 2); +process = licenceplate(300, 100, 15, 8, 1, 50, 150, 255, 4, 4, 2); //process = licenceplate(195, 117, 1, 4, 1, 50, 150, 255, 1, 1, 2); diff --git a/examples/sinwave/output1.wav b/examples/sinwave/output1.wav index 5a728e2..37a80e3 100644 Binary files a/examples/sinwave/output1.wav and b/examples/sinwave/output1.wav differ diff --git a/examples/sinwave/sin.sh b/examples/sinwave/sin.sh index 3a4b202..899249e 100644 --- a/examples/sinwave/sin.sh +++ b/examples/sinwave/sin.sh @@ -1 +1 @@ -../../interpretor/faustine -d sin.dsp +faustine -d sin.dsp diff --git a/interpretor/main.ml b/interpretor/main.ml index 8637875..21c2a8e 100644 --- a/interpretor/main.ml +++ b/interpretor/main.ml @@ -21,11 +21,11 @@ let set_GC () = let _ = Gc.set { (Gc.get()) with Gc.space_overhead = 100 } in let _ = Gc.set { (Gc.get()) - with Gc.max_overhead = 0xFFFFF } in + with Gc.max_overhead = 0xFFF } in let _ = Gc.set { (Gc.get()) with Gc.stack_limit = 0xFFFFF } in let _ = Gc.set { (Gc.get()) - with Gc.allocation_policy = 0 } in + with Gc.allocation_policy = 1 } in () ;; let path_dsp = ref "";; diff --git a/interpretor/types.ml b/interpretor/types.ml index 352afbe..3f0631b 100644 --- a/interpretor/types.ml +++ b/interpretor/types.ml @@ -87,9 +87,18 @@ type faust_exp = | Merge of faust_exp * faust_exp +class type rate_type = + object + method to_int : int + method to_float : float + method equal : rate_type -> bool + method mul : int -> rate_type + method div : int -> rate_type + end + class type signal_type = object - method frequency : int + method frequency : rate_type method at : time -> value_type method add_memory : int -> unit method add : signal_type -> signal_type