public void Add(Timing t, Music.Section section) { Bar += t.Bar; Beat += t.Beat; Unit += t.Unit; Fix(section); }
public void Subtract(Timing t, Music.Section section) { Bar -= t.Bar; Beat -= t.Beat; Unit -= t.Unit; Fix(section); }
public void IncrementBeat(Music.Section section) { Beat++; Fix(section); }
public void Decrement(Music.Section section) { Unit--; Fix(section); }
public void Increment(Music.Section section) { Unit++; Fix(section); }
public void Fix(Music.Section section) { int totalUnit = Bar * section.UnitPerBar + Beat * section.UnitPerBeat + Unit; Bar = totalUnit / section.UnitPerBar; Beat = (totalUnit - Bar * section.UnitPerBar) / section.UnitPerBeat; Unit = (totalUnit - Bar * section.UnitPerBar - Beat * section.UnitPerBeat); }
public int GetMusicalTime(Music.Section section) { return(Bar * section.UnitPerBar + Beat * section.UnitPerBeat + Unit); }
public float TotalSeconds(Music.Section section) { return((float)((Bar * section.UnitPerBar + Beat * section.UnitPerBeat + Unit) * 60.0f / section.Tempo)); }
public int TotalUnit(Timing timing, Music.Section section) { return(timing.Bar * section.UnitPerBar + timing.Beat * section.UnitPerBeat + timing.Unit); }