New primitives tested in examples/primitives.
--- /dev/null
+import ("fft.lib");
+
+process = 3.3 : vectorize(5) <: float, floor, ceil, rint, (_, (2 : vectorize(5)) <: ^, pow), (int : _, (2 : vectorize(5)) : - : _, (0 : vectorize(5)) <: &, |, xor), (_, (3 : vectorize(5)) <: >=, <=, ==, !=, >, <), (_, (3.3 : vectorize(5)) <: >=, <=, ==, !=, >, <), (_, (3 : vectorize(5)) : - <: acos, asin, tan, exp, log, log10, abs), (_, (2 : vectorize(5) : float) <: fmod, remainder) : nconcat(30) : serialize;
--- /dev/null
+faustine -d primitives.dsp -t 30 --oformat csv
let rec basic_adjust : (float -> float) -> basic -> basic =
fun oper -> fun b ->
match b with
- |N i -> R (float_of_int i)
- |R f -> R (floor f)
+ |N i -> R (oper (float_of_int i))
+ |R f -> R (oper f)
|Vec vec -> Vec (new vector vec#size
(fun_unary (basic_adjust oper) vec#nth))
- |Zero -> R 0.
+ |Zero -> R (oper 0.)
|Error -> Error;;
let basic_floor = basic_adjust floor;;
| "-" { IDENT Sub}
| "*" { IDENT Mul}
| "/" { IDENT Div}
-| "^" { IDENT Power}
| "_" { IDENT Pass}
| "!" { IDENT Stop}
| "&" { IDENT And}
| "|" { IDENT Or}
-| "xor" { IDENT Xor}
+| "^" { IDENT Xor}
| "mem" { IDENT Mem}
| "@" { IDENT Delay}
| "floor" { IDENT Floor}
| "sqrt" { IDENT Sqrt}
| "log" { IDENT Ln}
| "logten" { IDENT Lg}
-| "pow" { IDENT Power}
+| "powf" { IDENT Power}
| "abs" { IDENT Abs}
-| "fmod" { IDENT Fmod}
+| "fmodf" { IDENT Fmod}
| "%" { IDENT Mod}
| "remainder" { IDENT Remainder}
| "vectorize" { IDENT Vectorize}
if (ptr == sigOR ) return "|";
if (ptr == sigXOR) return "^";
- if (ptr == sigLeftShift ) return "<<";
- if (ptr == sigRightShift) return ">>";
+ if (ptr == sigLeftShift ) return "<< ";
+ if (ptr == sigRightShift) return " >>";
if (ptr == sigLT) return "< ";
if (ptr == sigLE) return "<=";
if (ptr == sigGT) return " >";
- if (ptr == sigGE) return ">=";
+ if (ptr == sigGE) return " >=";
if (ptr == sigEQ) return "==";
if (ptr == sigNE) return "!=";
public:
- Log10Prim() : xtended("log10f") {}
+ Log10Prim() : xtended("logten") {}
virtual unsigned int arity () { return 1; }