public List<MidiTrack> ChangeMidiNotes(MidiOptions options)
{
List<MidiTrack> newtracks = new List<MidiTrack>();
for (int track = 0; track < tracks.Count; track++) {
if (options.tracks[track]) {
newtracks.Add(tracks[track].Clone() );
}
}
/* To make the sheet music look nicer, we round the start times
* so that notes close together appear as a single chord. We
* also extend the note durations, so that we have longer notes
* and fewer rest symbols.
*/
TimeSignature time = timesig;
if (options.time != null) {
time = options.time;
}
MidiFile.RoundStartTimes(newtracks, options.combineInterval, timesig);
MidiFile.RoundDurations(newtracks, time.Quarter);
if (options.twoStaffs) {
newtracks = MidiFile.CombineToTwoTracks(newtracks, timesig.Measure);
}
if (options.shifttime != 0) {
MidiFile.ShiftTime(newtracks, options.shifttime);
}
if (options.transpose != 0) {
MidiFile.Transpose(newtracks, options.transpose);
}
return newtracks;
}