Zongzi. Score. Grid
(zongzi v0.3.0)
Copy Markdown
Timeline grid and quantization utilities. Snaps a free tick to the nearest grid line.
This module is illustrative — grid logic typically belongs to the editor / UI layer.
Summary
Functions
Snaps raw_tick to the nearest position on the given grid_type.
Snaps a tick relative to an original position, preserving the note's snapped absolute length.
Returns the number of ticks spanned by a single grid step.
Types
Functions
@spec snap_tick( Zongzi.Score.Tick.numeric_tick(), grid_type(), grid_strategy(), pos_integer() ) :: Zongzi.Score.Tick.numeric_tick()
Snaps raw_tick to the nearest position on the given grid_type.
@spec snap_tick_relative( Zongzi.Score.Tick.numeric_tick(), Zongzi.Score.Tick.numeric_tick(), grid_type(), pos_integer() ) :: Zongzi.Score.Tick.numeric_tick()
Snaps a tick relative to an original position, preserving the note's snapped absolute length.
@spec ticks_per_step(grid_type(), pos_integer()) :: pos_integer()
Returns the number of ticks spanned by a single grid step.