Skip to content

ChartSnap

namespace Griff.Modules.Rhythm;
public struct ChartSnap

A grid a chart’s notes snap to: each beat split into Divisions. 1/4 is a note a beat (in 4/4), 1/8 two, 1/16 four, and the triplets three (1/8 triplets) or six (1/16 triplets).

public static IReadOnlyList<ChartSnap> All { get; }

The grids to pick from, coarsest first.

public int Divisions { get; init; }
public string Name { get; init; }
public static IReadOnlyList<string> Names { get; }

The grids’ names, coarsest first.

public double Step { get; }

How many beats apart the grid’s lines are.

public void Deconstruct(out string Name, out int Divisions)
public override bool Equals(object obj)
public bool Equals(ChartSnap other)
public double Floor(double beat)

The grid line at or before beat.

public override int GetHashCode()
public static ChartSnap Named(string? name)

The grid called name (“1/16”, “1/8 triplets”, or “16”, “1/12”, “12th”), or 1/8 if there’s none.

public double Snap(double beat)

The grid line nearest beat.

public override string ToString()