Skip to content

Commit

Permalink
Merge pull request #1260 from oxygen-dioxide/midi
Browse files Browse the repository at this point in the history
Fix openutau crash when exporting midi file with a note above 127
  • Loading branch information
stakira authored Sep 1, 2024
2 parents 631f4e2 + a63d1a4 commit a985ea9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenUtau.Core/Format/MidiWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ static public void Save(string filePath, UProject project) {
using (var objectsManager = new TimedObjectsManager<TimedEvent>(trackChunk.Events)) {
var events = objectsManager.Objects;
foreach (UNote note in voicePart.notes) {
//Ignore notes whose pitch is out of midi range
if(note.tone < 0 || note.tone > 127){
continue;
}
string lyric = note.lyric;
if (lyric == "+") {
lyric = "-";
Expand Down

0 comments on commit a985ea9

Please sign in to comment.