Zongzi.Score.TimeSigMap (zongzi v0.3.0)

Copy Markdown

Compiled time signature map from time signature change events.

Delegates to RecordMap for compilation and bar-based binary search.

Summary

Types

compiled_event()

@type compiled_event() :: %{
  start_pos: Zongzi.Score.Record.position(),
  end_pos: Zongzi.Score.Record.end_position(),
  start_bar: pos_integer(),
  start_tick: Zongzi.Score.Tick.numeric_tick(),
  end_tick: Zongzi.Score.Tick.t(),
  time_sig: Zongzi.Score.TimeSig.t()
}

t()

@type t() :: tuple()

Functions

bar_to_tick(compiled, target_bar, tpqn)

@spec bar_to_tick(t(), Zongzi.Score.TimeSig.bar(), pos_integer()) ::
  {:ok, Zongzi.Score.Tick.numeric_tick()} | {:error, term()}

compile(events, opts \\ [])

@spec compile(
  Zongzi.Score.TimeSig.time_sig_events(),
  keyword()
) :: {:ok, t()} | {:error, term()}

tick_to_bar(compiled, target_tick, tpqn)

@spec tick_to_bar(t(), Zongzi.Score.Tick.numeric_tick(), pos_integer()) ::
  {:ok, Zongzi.Score.TimeSig.bar()} | {:error, term()}