Skip to content

Commit

Permalink
micromap: fix that time-related variables were broken in non-array cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Feb 17, 2025
1 parent 0026a25 commit ee4fd38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
16 changes: 0 additions & 16 deletions src/plugins/score-plugin-fx/Fx/MathHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,6 @@ static void setMathExpressionTiming(
self.cur_pos = parent_dur > 0 ? double(input_time) / parent_dur : 0;
}

template <typename State>
static void setMathExpressionTiming(
State& self, ossia::time_value input_time, ossia::time_value prev_time,
ossia::time_value parent_dur, double modelToSamples)
{
setMathExpressionTiming(
self, input_time.impl * modelToSamples, prev_time.impl * modelToSamples,
parent_dur.impl * modelToSamples);
}

// template <typename State>
// static void setMathExpressionTiming(State& self, const ossia::token_request& tk, ossia::exec_state_facade st)
// {
// setMathExpressionTiming(self, tk.date, tk.prev_date, tk.parent_duration, st.modelToSamples());
// }

template <typename State>
static void setMathExpressionTiming(State& self, const halp::tick_flicks& tk)
{
Expand Down
12 changes: 3 additions & 9 deletions src/plugins/score-plugin-fx/Fx/MathMapping_generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,10 @@ struct GenericMathMapping
const ossia::value& v, value_output_callback& output, const halp::tick_flicks& tk,
State& self)
{
//auto ratio = st.modelToSamples();
//auto parent_dur = tk.parent_duration * ratio;
//for(const ossia::timed_value& v : input.get_data())
//{
// int64_t new_time = tk.prev_date.impl * ratio + timestamp;
// setMathExpressionTiming(self, new_time, self.last_value_time, parent_dur);
// self.last_value_time = new_time;
setMathExpressionTiming(
self, tk.start_in_flicks, self.last_value_time, tk.relative_position);
self.last_value_time = tk.start_in_flicks;

// FIXME
// setMathExpressionTiming(self, new_time, self.last_value_time, parent_dur);
switch(v.get_type())
{
case ossia::val_type::NONE:
Expand Down

0 comments on commit ee4fd38

Please sign in to comment.