private void composeBars(List <D_Bar> bars, ref string lilypondString, ref int current_scope_octave) { D_Note previous_note = null; D_Measure current_measure = bars[0].measure; foreach (D_Bar bar in bars) { lilypondString += " "; if (bar.measure != current_measure) { current_measure = bar.measure; composeMeasureInformation(current_measure, ref lilypondString); lilypondString += " "; } foreach (D_Note note in bar.notes) { lilypondString += LilypondNoteComposer.placeNoteInLilypondString(note, previous_note, ref current_scope_octave); lilypondString += " "; if (!note.is_rest) { previous_note = note; } } lilypondString += "|\r\n"; } }
private void composeMeasureInformation(D_Measure measure, ref string lilypondString) { lilypondString += String.Format("\\time {0}/{1}\r\n", measure.beats_per_bar, measure.beat_length); }