2 #include <Fx/MathMapping_generic.hpp>
3 #include <Fx/Types.hpp>
5 #include <boost/container/static_vector.hpp>
7 #include <halp/layout.hpp>
9 namespace Nodes::ArrayGenerator
13 halp_meta(name,
"Arraygen")
14 halp_meta(c_name,
"ArrayGenerator")
15 halp_meta(category,
"Control/Generators")
17 manual_url,
"https://ossia.io/score-docs/processes/exprtk.html#array-handling")
18 halp_meta(author,
"ossia score, ExprTK (Arash Partow)")
19 halp_meta(description,
"Applies a math expression to each member of an input.");
20 halp_meta(uuid,
"cf3df02f-a563-4e92-a739-b321d3a84252");
24 halp::lineedit<
"Expression",
"i"> expr;
25 halp::spinbox_i32<
"Size", halp::irange{0, 1024, 12}> sz;
37 void init(
double& cur_time,
double& cur_deltatime,
double& cur_pos)
39 expr.add_variable(
"i", instance);
41 expr.add_variable(
"po", po);
43 expr.add_variable(
"t", cur_time);
44 expr.add_variable(
"dt", cur_deltatime);
45 expr.add_variable(
"pos", cur_pos);
48 expr.register_symbol_table();
54 ossia::math_expression expr;
57 boost::container::static_vector<Expr, 1024> expressions;
59 double cur_deltatime{};
62 int64_t last_value_time{};
63 std::string last_expression;
66 ossia::exec_state_facade ossia_state;
68 using tick = halp::tick_flicks;
69 void operator()(
const tick& tk)
71 GenericMathMapping<State>::run_polyphonic(
72 inputs.sz.value, outputs.port.call, inputs.expr.value, tk, state);
77 halp_meta(layout, halp::layouts::vbox)
79 struct : halp::control<&ins::expr>
81 halp_flag(dynamic_size);
83 halp::control<&ins::sz> sz;
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33
Definition: Arraygen.hpp:36
Definition: Arraygen.hpp:23
Definition: Arraygen.hpp:76
Definition: Arraygen.hpp:12