ChartPlaybackStream
namespace Griff.Modules.Rhythm;
public sealed class ChartPlaybackStream : IAudioStreamWhat a chart editor plays: a song from part way in, after a lead-in, with a metronome’s clicks on its beats (always in the lead-in, and through the song when Metronome is on) and a tick on each of the notes of Ticks as it’s reached, each starting on its very sample. Seconds of song are counted from the song’s start (SongSecondsAt), so what a Voice playing it has had heard says where in the song the player is. Without a song it’s the clicks alone, for as long as it plays.
Properties
Section titled “Properties”Channels
Section titled “Channels”public int Channels { get; }Frames
Section titled “Frames”public long Frames { get; }A song’s stream ends a moment after the song; clicks alone go on until stopped.
Metronome
Section titled “Metronome”public bool Metronome { get; set; }Clicks on every beat through the song (a higher one on each bar’s first). They always count the lead-in.
SampleRate
Section titled “SampleRate”public int SampleRate { get; }SongSeconds
Section titled “SongSeconds”public double SongSeconds { get; }How many seconds the song lasts (0 without one).
public double[] Ticks { get; set; }The beats to tick on (the notes of the chart), earliest first; set from any thread.
Volume
Section titled “Volume”public float Volume { get; set; }How loud the song plays, 0 to 1.
Methods
Section titled “Methods”Dispose
Section titled “Dispose”public void Dispose()public int Read(Span<float> buffer)Rewind
Section titled “Rewind”public void Rewind()SongSecondsAt
Section titled “SongSecondsAt”public double SongSecondsAt(double seconds)Where in the song (seconds from its start) the stream is seconds after it started.