Skip to content

Commit

Permalink
Safeguarding the midi range, as unfortunately certain instruments may…
Browse files Browse the repository at this point in the history
… cause midi 0 from verovio.
  • Loading branch information
yucongj committed Jun 14, 2024
1 parent 0cae404 commit 6a0463c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/ScoreParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ ScoreParser::generateScoreFiles(string dir, string scoreName, string meiFile)
jsonxx::Object note;
note.parse(toolkit.GetMIDIValuesForElement(id));
newNote.pitch = note.get<jsonxx::Number>("pitch");
if (newNote.pitch > 108 || newNote.pitch < 21) {
SVDEBUG << "Pitch/midi = " << newNote.pitch << " out of range. Ignored." << endl;
continue;
}

newNote.noteId = id;

Expand Down

0 comments on commit 6a0463c

Please sign in to comment.