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,
double& count)
39 expr.add_variable(
"i", instance);
40 expr.add_variable(
"n", count);
42 expr.add_variable(
"po", po);
44 expr.add_variable(
"t", cur_time);
45 expr.add_variable(
"dt", cur_deltatime);
46 expr.add_variable(
"pos", cur_pos);
49 expr.register_symbol_table();
55 ossia::math_expression expr;
58 boost::container::static_vector<Expr, 1024> expressions;
61 double cur_deltatime{};
64 int64_t last_value_time{};
65 std::string last_expression;
68 ossia::exec_state_facade ossia_state;
70 using tick = halp::tick_flicks;
71 void operator()(
const tick& tk)
73 GenericMathMapping<State>::run_polyphonic(
74 inputs.sz.value, outputs.port.call, inputs.expr.value, tk, state);
79 halp_meta(layout, halp::layouts::vbox)
81 struct : halp::control<&ins::expr>
83 halp_flag(dynamic_size);
85 halp::control<&ins::sz> sz;