public static string MeasureToString(MemoMeasure measure, MemoStyle style) { var sb = new StringBuilder(); sb.AppendLine(measure.Ordinal.ToString()); using (var ibeat = measure.Beats.GetEnumerator()) { var hasBeat = ibeat.MoveNext(); foreach (var scene in measure.Scenes) { foreach (var line in MemoSceneFormatter.SceneToStrings(scene)) { sb.Append(line); if (hasBeat && (ibeat.Current.Hits.First(x => x > 0) <= scene.OfType <MemoNote>().Max(p => p.Ordinal))) { sb.Append(DefaultSpace); sb.Append(ibeat.Current); hasBeat = ibeat.MoveNext(); } sb.AppendLine(); } if (scene != measure.Scenes.Last()) { sb.AppendLine(); } } } return(sb.ToString()); }
public static string BeatToString(MemoBeat beat, MemoStyle style) { var sb = new StringBuilder(); sb.Append(DefaultSeperator); var hits = beat.Hits; var bpm = beat.Bpm; for (var i = 0; i < hits.Count; i++) { if (bpm.ContainsKey(i)) { sb.Append($"({bpm[i]})"); } sb.Append(BeatCharset[hits[i]]); } sb.Append(DefaultSeperator); return(sb.ToString()); }
public string ToString(MemoStyle style) { return(MemoMeasureFormatter.MeasureToString(this, style)); }