ChartSnap
namespace Griff.Modules.Rhythm;
public struct ChartSnapA 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).
Properties
Section titled “Properties”public static IReadOnlyList<ChartSnap> All { get; }The grids to pick from, coarsest first.
Divisions
Section titled “Divisions”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.
Methods
Section titled “Methods”Deconstruct
Section titled “Deconstruct”public void Deconstruct(out string Name, out int Divisions)Equals
Section titled “Equals”public override bool Equals(object obj)Equals
Section titled “Equals”public bool Equals(ChartSnap other)public double Floor(double beat)The grid line at or before beat.
GetHashCode
Section titled “GetHashCode”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.
ToString
Section titled “ToString”public override string ToString()